Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit 1ee3168

Browse files
authored
Merge pull request #327 from betzw/betzw_x_nucleo_wb
Support for STM Radio Expansion Boards
2 parents eea422f + 9861988 commit 1ee3168

File tree

8 files changed

+123
-13
lines changed

8 files changed

+123
-13
lines changed

README.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This example supports these shields:
6565

6666
* [AT86RF233/212B](https://github.com/ARMmbed/atmel-rf-driver)
6767
* [NXP-MCR20a](https://github.com/ARMmbed/mcr20a-rf-driver)
68-
* [X-NUCLEO-IDS01A4](https://github.com/ARMmbed/stm-spirit1-rf-driver) (*a.k.a.* Spirit1) radio shields. Check instructions for compilation [here](#compile-configuration-for-spirit1)
68+
* [X-NUCLEO-IDS01A4](https://github.com/ARMmbed/stm-spirit1-rf-driver) (*a.k.a.* Spirit1) radio shields. Check instructions for compilation [here](#compile-configuration-for-spirit1).
6969

7070
To select the radio shield make sure that the `mbed_app.json` file points to the correct radio driver type:
7171

@@ -122,12 +122,12 @@ For sub-GHz shields ([Spirit1](https://github.com/ARMmbed/stm-spirit1-rf-driver)
122122

123123
```json
124124
"mbed-mesh-api.6lowpan-nd-channel-page": 2,
125-
"mbed-mesh-api.6lowpan-nd-channel": 1
125+
"mbed-mesh-api.6lowpan-nd-channel": 1,
126+
"mbed-mesh-api.6lowpan-nd-channel-mask": "(1<<1)"
126127
```
127128

128129
For more information about the radio shields, see [the related documentation](docs/radio_module_identify.md).
129130

130-
=======
131131
#### Supported combinations of board and shields
132132

133133
See Mesh-minimal's [Notes on different hardware](https://github.com/ARMmbed/mbed-os-example-mesh-minimal/blob/master/Hardware.md) for known combinations of development boards and RF shields that have been tested with mesh networking stack.
@@ -155,6 +155,7 @@ With Thread, you can change the operating mode of the client from the default ro
155155
* UBLOX_EVK_ODIN_W2. Check instructions for compilation [here](#compile-configuration-for-odin-wifi).
156156
* K64F + GROVE SEEED shield using [ESP8266](https://en.wikipedia.org/wiki/ESP8266) WiFi module.
157157
* NUCLEO_F429ZI + GROVE SEEED shield using [ESP8266](https://en.wikipedia.org/wiki/ESP8266) WiFi module.
158+
* [NUCLEO_F401RE](https://os.mbed.com/platforms/ST-Nucleo-F401RE/) + [X-NUCLEO-IDW0XX1](https://github.com/ARMmbed/wifi-x-nucleo-idw01m1/).
158159

159160
To run this application using ESP8266 WiFi Interface, you need:
160161

@@ -166,8 +167,8 @@ To run this application using ESP8266 WiFi Interface, you need:
166167

167168
```json
168169
"network-interface": {
169-
"help": "options are ETHERNET,WIFI,MESH_LOWPAN_ND,MESH_THREAD.",
170-
"value": "WIFI"
170+
"help": "options are ETHERNET,WIFI_ESP8266,WIFI_IDW0XX1,WIFI_ODIN,MESH_LOWPAN_ND,MESH_THREAD.",
171+
"value": "WIFI_ESP8266"
171172
}
172173
```
173174

@@ -201,14 +202,36 @@ For example, NUCLEO_F401RE requires a different serial connection:
201202

202203
#### Compile configuration for ODIN WiFi
203204

204-
To compile ODIN WiFi configuration, you need to tell mbed NOT to compile the related files. To do that, set up a `.mbedignore` file. An example file is available in the `configs` folder.
205+
To compile ODIN WiFi configuration, you need to tell mbed NOT to compile mesh files for example. To do that, set up a `.mbedignore` file. An example file is available in the `configs` folder.
205206

206207
This should resolve the issue:
207208

208-
```
209-
cp configs/eth-wifi-mbedignore ./.mbedignore
210-
```
211-
209+
``` bash
210+
cp configs/wifi_odin_v4.json mbed_app.json
211+
<use your favourite editor to modify mbed_app.json for WiFi details>
212+
cp configs/mesh-mbedignore ./.mbedignore
213+
```
214+
215+
#### Compile configuration for STM `X-NUCLEO-IDW0XX1` WiFi expansion boards
216+
217+
Currently, two STM WiFi expansion boards are available:
218+
- `X-NUCLEO-IDW01M1`, which is the Morpho form-factor board, and
219+
- `X-NUCLEO-IDW04A1`, which is the Arduino form-factor board.
220+
221+
The label is clearly printed on the PCB.
222+
223+
To compile STM X-NUCLEO WiFi configuration, you need to tell mbed NOT to compile mesh files for example. To do that, set up a `.mbedignore` file. Example files are available in the `configs` folder.
224+
225+
This should resolve the issue (example for `X-NUCLEO-IDW01M1`):
226+
227+
``` bash
228+
cp configs/wifi_idw01m1_v4.json mbed_app.json
229+
<use your favourite editor to modify mbed_app.json for WiFi details>
230+
cp configs/mesh-mbedignore ./.mbedignore
231+
```
232+
233+
If you have issues with the `X-NUCLEO-IDW04A1` board, please double-check that macro `IDW04A1_WIFI_HW_BUG_WA` has been added to the `macros` section of the `mbed_app.json` file.
234+
212235
### Non listed board support
213236

214237
Apart from the listed configurations, this example can work on other Mbed OS supported hardware boards which support any of the given network interface including Ethernet, WiFi, Mesh (6LoWPAN) or Thread, provided the configuration fulfills condition that the target hardware has TLS entropy implemented for it. On devices where hardware entropy is not present, TLS is disabled by default. This would result in compile time failures or linking failures.

build_all.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,10 @@ mbed compile -m K64F -t $TOOL
5959
cp BUILD/K64F/$TOOL/mbed-os-example-client.bin k64f-$TOOL-Thread.bin
6060
mbed compile -m NUCLEO_F429ZI -t $TOOL
6161
cp ./BUILD/NUCLEO_F429ZI/$TOOL/mbed-os-example-client.bin f429zi-$TOOL-Thread.bin
62+
63+
echo WiFi-X-Nucleo
64+
cp configs/wifi_idw01m1_v4.json mbed_app.json
65+
cp configs/wifi-idw0xx1-mbedignore .mbedignore
66+
mbed compile -m NUCLEO_F401RE -t $TOOL
67+
cp ./BUILD/NUCLEO_F401RE/GCC_ARM/mbed-os-example-client.bin f401re-$TOOL-WifiXNucleo.bin
68+

configs/mesh-mbedignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
easy-connect/esp8266-driver/*
2+
easy-connect/wifi-x-nucleo-idw01m1/*

configs/wifi_idw01m1_v4.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"config": {
3+
"network-interface":{
4+
"help": "Options are ETHERNET, WIFI_ESP8266, WIFI_IDW0XX1, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
5+
"value": "WIFI_IDW0XX1"
6+
},
7+
"wifi-ssid": {
8+
"help": "WiFi SSID",
9+
"value": "\"SSID\""
10+
},
11+
"wifi-password": {
12+
"help": "WiFi Password",
13+
"value": "\"Password\""
14+
},
15+
"wifi-tx": {
16+
"help": "TX pin for serial connection to external device",
17+
"value": "PA_9"
18+
},
19+
"wifi-rx": {
20+
"help": "RX pin for serial connection to external device",
21+
"value": "PA_10"
22+
}
23+
},
24+
"macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\"", "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES","MBEDTLS_TEST_NULL_ENTROPY"],
25+
"target_overrides": {
26+
"*": {
27+
"target.features_add": ["COMMON_PAL"],
28+
"platform.stdio-baud-rate": 115200,
29+
"platform.stdio-convert-newlines": true,
30+
"mbed-trace.enable": 0,
31+
"idw0xx1.expansion-board": "IDW01M1",
32+
"drivers.uart-serial-txbuf-size": 730,
33+
"drivers.uart-serial-rxbuf-size": 730
34+
}
35+
}
36+
}

configs/wifi_idw04a1_v4.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"config": {
3+
"network-interface":{
4+
"help": "Options are ETHERNET, WIFI_ESP8266, WIFI_IDW0XX1, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
5+
"value": "WIFI_IDW0XX1"
6+
},
7+
"wifi-ssid": {
8+
"help": "WiFi SSID",
9+
"value": "\"SSID\""
10+
},
11+
"wifi-password": {
12+
"help": "WiFi Password",
13+
"value": "\"Password\""
14+
},
15+
"wifi-tx": {
16+
"help": "TX pin for serial connection to external device",
17+
"value": "D8"
18+
},
19+
"wifi-rx": {
20+
"help": "RX pin for serial connection to external device",
21+
"value": "D2"
22+
}
23+
},
24+
"macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\"", "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES","MBEDTLS_TEST_NULL_ENTROPY", "IDW04A1_WIFI_HW_BUG_WA"],
25+
"target_overrides": {
26+
"*": {
27+
"target.features_add": ["COMMON_PAL"],
28+
"platform.stdio-baud-rate": 115200,
29+
"platform.stdio-convert-newlines": true,
30+
"mbed-trace.enable": 0,
31+
"idw0xx1.expansion-board": "IDW04A1",
32+
"drivers.uart-serial-txbuf-size": 750,
33+
"drivers.uart-serial-rxbuf-size": 750
34+
}
35+
}
36+
}

easy-connect.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/ARMmbed/easy-connect/#bf821b0695ccada3620a6091503eb53a2a1ac3c8
1+
https://github.com/ARMmbed/easy-connect/#6af200df4817ec38661b409c7ba417e6098e8f1f

main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class LedResource {
197197
status_ticker.attach_us(blinky, 250000);
198198
return;
199199
}
200-
// Wait requested time, then continue prosessing the blink pattern from next position.
200+
// Wait requested time, then continue processing the blink pattern from next position.
201201
Thread::wait(blink_args->blink_pattern.at(blink_args->position));
202202
blink_args->position++;
203203
}
@@ -326,6 +326,11 @@ void button_clicked() {
326326
updates.release();
327327
}
328328

329+
// debug printf function
330+
void trace_printer(const char* str) {
331+
printf("%s\r\n", str);
332+
}
333+
329334
// Entry point to the program
330335
int main() {
331336

@@ -361,6 +366,8 @@ Add MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES and MBEDTLS_TEST_NULL_ENTROPY in mbed_app
361366
printf("\nStarting mbed Client example\n");
362367
363368
mbed_trace_init();
369+
mbed_trace_print_function_set(trace_printer);
370+
mbed_trace_config_set(TRACE_MODE_COLOR | TRACE_ACTIVE_LEVEL_INFO | TRACE_CARRIAGE_RETURN);
364371
365372
NetworkInterface* network = easy_connect(true);
366373
if(network == NULL) {

mbed_app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"config": {
33
"network-interface":{
4-
"help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD, CELLULAR_ONBOARD",
4+
"help": "Options are ETHERNET, WIFI_IDW0XX1, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD, CELLULAR_ONBOARD",
55
"value": "ETHERNET"
66
},
77
"mesh_radio_type": {

0 commit comments

Comments
 (0)