Skip to content

Commit cbdc326

Browse files
maribucrasbe
andcommitted
boards/msbiot: use stdio_rtt by default
This makes using the board a bit easier, as in practise one will have to connect an ST-Link debugger in any case to debug, but connecting an UART adapter in addition feels more optional. Co-authored-by: crasbe <crasbe@gmail.com>
1 parent a8de72b commit cbdc326

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

boards/msbiot/Makefile.dep

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ endif
1111
ifneq (,$(filter saul_default,$(USEMODULE)))
1212
USEMODULE += mpu9150
1313
endif
14+
15+
# Use Segger's RTT unless another stdio_% is already used
16+
ifneq (,$(filter stdio_default,$(USEMODULE)))
17+
USEMODULE += stdio_rtt
18+
endif

boards/msbiot/doc.md

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,16 @@ found [here](https://github.com/RIOT-OS/RIOT/tree/master/tests/drivers/mpu9x50).
168168
|:--------------------- |:------------------------------------------------------------------------------------------------- |
169169
| Type | Nine-Axis MotionTracking Device (Gyro, Accel and Compass) |
170170
| Vendor | Invensense |
171-
| Product Specification | [Product Specification](https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Datasheet.pdf) |
172-
| Register Map | [Register Map](https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Register-Map.pdf) |
171+
| Product Specification | [Product Specification] |
172+
| Register Map | [Register Map] |
173173
| Driver | @ref drivers_mpu9x50 |
174174
| I²C Device | I2C1 (Mapped to I2C_0 in RIOT) |
175175
| SCL | PB6 |
176176
| SDA | PB7 |
177177
| IRQ Line | PB11 |
178178

179+
[Product Specification]: https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Datasheet.pdf
180+
[Register Map]: https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Register-Map.pdf
179181

180182
### Other components
181183

@@ -195,27 +197,16 @@ documentation of your used tools.
195197

196198
### Prerequisites
197199

198-
We strongly recommend the usage of the [GNU Tools for ARM Embedded Processors](https://launchpad.net/gcc-arm-embedded) toolchain for the MSB-IoT.
199-
Support for other toolchains was not tested!
200-
201200
RIOT's provided functionality for debugging and flashing the MSB-IoT is based
202201
on the [Open On-Chip Debugger](http://openocd.org/) tool. A wiki page with
203202
installation instructions and some other information can be found
204203
[here](https://github.com/RIOT-OS/RIOT/wiki/OpenOCD).
205204

206205

207-
### Quick start
208-
209-
For a quick getting started guide you can stick to the steps explained on
210-
[this page](https://github.com/RIOT-OS/RIOT/wiki/Getting-started-with-STM32F%5B0%7C3%7C4%5Ddiscovery-boards). Just make sure to use "msbiot" as the
211-
respective board name.
212-
213-
214206
### Compiling
215207

216208
```
217-
fabian@fabian-ThinkPad-L412:~/myriot/RIOT/examples/basic/hello-world$ BOARD=msbiot
218-
make
209+
fabian@fabian-ThinkPad-L412:~/myriot/RIOT/examples/basic/hello-world$ BOARD=msbiot make
219210
Building application "hello-world" for "msbiot" with MCU "stm32f4".
220211
221212
"make" -C /home/fabian/myriot/RIOT/boards/msbiot
@@ -235,8 +226,7 @@ Building application "hello-world" for "msbiot" with MCU "stm32f4".
235226
### Flashing
236227

237228
```
238-
fabian@fabian-ThinkPad-L412:~/myriot/RIOT/examples/basic/hello-world$ BOARD=msbiot
239-
make flash
229+
fabian@fabian-ThinkPad-L412:~/myriot/RIOT/examples/basic/hello-world$ BOARD=msbiot make flash
240230
Building application "hello-world" for "msbiot" with MCU "stm32f4".
241231
242232
"make" -C /home/fabian/myriot/RIOT/boards/msbiot
@@ -304,8 +294,7 @@ Done flashing
304294
### Debugging
305295

306296
```
307-
fabian@fabian-ThinkPad-L412:~/myriot/RIOT/examples/basic/hello-world$ BOARD=msbiot
308-
make debug
297+
fabian@fabian-ThinkPad-L412:~/myriot/RIOT/examples/basic/hello-world$ BOARD=msbiot make debug
309298
/home/fabian/myriot/RIOT/dist/tools/openocd/openocd.sh debug
310299
### Starting Debugging ###
311300
Open On-Chip Debugger 0.8.0 (2015-03-01-08:19)
@@ -329,15 +318,23 @@ reset_handler () at /home/fabian/myriot/RIOT/cpu/stm32f4/startup.c:54
329318
(gdb)
330319
```
331320

321+
### Using RTT as STDIO
322+
323+
By default `stdio_rtt` is used. So just connect the ST-Link and type
324+
`BOARD=msbiot make term` and you'll get the serial console.
332325

333326
### Using the UART for STDIO
334327

335-
The MCU's USART2 is set as the default input/output for the MSB-IoT inside
336-
RIOT (mapped to UART_0). It is initialized and configured automatically for
337-
every RIOT application and can be used for communication with your computer. The
338-
easiest way is to use an USB to TTL adapter:
328+
The MCU's USART2 that is routed to the pin headers is mapped as `UART_0` and
329+
the default UART for when `stdio_uart` is used. Since `stdio_rtt` is the default
330+
you need to use
331+
332+
```
333+
USEMODULE=stdio_uart BOARD=msbio make flash term
334+
```
339335

340-
Step 1: Connect your adapter and the boards pin strip with RX<=>PA02,
341-
TX<=>PA03 and GND<=>GND
336+
Note that you need to rebuild and flash the app when switching the stdio
337+
backend.
342338

343-
Step 2: Done. The MCUs USART2 is used as STDIO.
339+
Connect your adapter and the boards pin strip with RX<=>PA02, TX<=>PA03 and
340+
GND<=>GND

0 commit comments

Comments
 (0)