Skip to content

Commit c97beef

Browse files
committed
Support for frdm rw612
Signed-off-by: Simone Orru <simone.orru@secomind.com>
1 parent ff9bfc5 commit c97beef

17 files changed

Lines changed: 549 additions & 58 deletions

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ You can now build the sample with the following command:
4949
```sh
5050
west build --sysbuild -p -b mimxrt1064_evk clea_cpu_monitoring_zephyr/app/
5151
```
52+
Or if choosing the FRDM-RW612 board:
53+
```sh
54+
west build --sysbuild -p -b frdm_rw612 clea_cpu_monitoring_zephyr/app -DEXTRA_CONF_FILE="prj-wifi.conf"
55+
```
56+
5257
Then flash it with the command:
5358
```sh
5459
west flash --runner=linkserver

app/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ test_sysbuild()
2424

2525
# create source files list
2626
FILE(GLOB app_common_sources ${CMAKE_CURRENT_LIST_DIR}/src/*.c)
27+
if(NOT CONFIG_WIFI)
28+
LIST(REMOVE_ITEM app_common_sources ${CMAKE_CURRENT_LIST_DIR}/src/wifi.c)
29+
endif()
2730
target_sources(app PRIVATE ${app_common_sources})
2831
target_include_directories(app PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include)
2932

app/Kconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@ endmenu
44

55
menu "CPU metrics sample application"
66

7+
config WIFI_SSID
8+
string "WiFi SSID"
9+
depends on WIFI
10+
default ""
11+
help
12+
WiFi access point SSID.
13+
14+
config WIFI_PASSWORD
15+
string "WiFi password"
16+
depends on WIFI
17+
default ""
18+
help
19+
WiFi access point password.
20+
21+
config CPU_TEMP_SENSOR
22+
bool "CPU temperature sensor"
23+
default n
24+
help
25+
Temperature sensor embedded within the CPU die.
26+
27+
config AMBIENT_TEMP_SENSOR
28+
bool "Ambient temperature sensor"
29+
default n
30+
help
31+
Temperature sensor embedded within the ambient.
32+
733
config ASTARTE_DEVICE_ID
834
string "Astarte device ID"
935
default ""

app/boards/frdm_rw612.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# (C) Copyright 2025, SECO Mind Srl
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Enable the WiFi
6+
CONFIG_WIFI_NXP=y
7+
8+
# Use a large log buffer size
9+
CONFIG_LOG_BUFFER_SIZE=32768
10+
11+
# Set the ambient temperature sensor in the demo
12+
CONFIG_AMBIENT_TEMP_SENSOR=y

app/boards/frdm_rw612.overlay

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* (C) Copyright 2025, SECO Mind Srl
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&w25q512jvfiq {
8+
partitions {
9+
astarte_partition: partition@3E00000 {
10+
label = "astarte";
11+
reg = <0x03E00000 DT_SIZE_K(128)>;
12+
};
13+
edgehog_partition: partition@3E20000 {
14+
label = "edgehog";
15+
reg = <0x03E20000 DT_SIZE_K(128)>;
16+
};
17+
};
18+
};

app/boards/mimxrt1064_evk.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ CONFIG_EDGEHOG_DEVICE_USE_EDGEHOG_PARTITION=y
1010

1111
CONFIG_LOG_MODE_DEFERRED=y
1212
CONFIG_LOG_BUFFER_SIZE=32768
13+
14+
CONFIG_CPU_TEMP_SENSOR=y

app/include/wifi.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* (C) Copyright 2025, SECO Mind Srl
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef WIFI_H
8+
#define WIFI_H
9+
10+
#include <zephyr/net/wifi.h>
11+
12+
/**
13+
* @brief Initialize the wifi driver
14+
*/
15+
void app_wifi_init(void);
16+
17+
/**
18+
* @brief Connect the wifi to an SSID
19+
*/
20+
int app_wifi_connect(const char *ssid, enum wifi_security_type sec, const char *psk);
21+
22+
#endif /* WIFI_H */
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"interface_name": "com.example.poc.AmbientTemp",
3+
"version_major": 0,
4+
"version_minor": 1,
5+
"type": "datastream",
6+
"ownership": "device",
7+
"aggregation": "individual",
8+
"mappings": [
9+
{
10+
"endpoint": "/temp",
11+
"type": "double",
12+
"database_retention_policy": "use_ttl",
13+
"database_retention_ttl": 5184000,
14+
"explicit_timestamp": true,
15+
"description": "SOC temperature in °C"
16+
}
17+
]
18+
}

app/interfaces/generated_interfaces.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,28 @@
1010
// Interface names should resemble as closely as possible their respective .json file names.
1111
// NOLINTBEGIN(readability-identifier-naming)
1212

13+
static const astarte_mapping_t com_example_poc_AmbientTemp_mappings[1] = {
14+
15+
{
16+
.endpoint = "/temp",
17+
.type = ASTARTE_MAPPING_TYPE_DOUBLE,
18+
.reliability = ASTARTE_MAPPING_RELIABILITY_UNRELIABLE,
19+
.explicit_timestamp = true,
20+
.allow_unset = false,
21+
},
22+
};
23+
24+
const astarte_interface_t com_example_poc_AmbientTemp = {
25+
.name = "com.example.poc.AmbientTemp",
26+
.major_version = 0,
27+
.minor_version = 1,
28+
.type = ASTARTE_INTERFACE_TYPE_DATASTREAM,
29+
.ownership = ASTARTE_INTERFACE_OWNERSHIP_DEVICE,
30+
.aggregation = ASTARTE_INTERFACE_AGGREGATION_INDIVIDUAL,
31+
.mappings = com_example_poc_AmbientTemp_mappings,
32+
.mappings_length = 1U,
33+
};
34+
1335
static const astarte_mapping_t com_example_poc_CpuMetrics_mappings[1] = {
1436

1537
{

app/interfaces/generated_interfaces.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
// Interface names should resemble as closely as possible their respective .json file names.
1919
// NOLINTBEGIN(readability-identifier-naming)
20+
extern const astarte_interface_t com_example_poc_AmbientTemp;
2021
extern const astarte_interface_t com_example_poc_CpuMetrics;
2122
extern const astarte_interface_t com_example_poc_CpuTemp;
2223
// NOLINTEND(readability-identifier-naming)

0 commit comments

Comments
 (0)