Skip to content

Commit b5cb056

Browse files
Juan Flores MuñozFranFin
andauthored
#7995 Micro-ROS configuration NuttX tutorial (#140)
* Adding tutorial: add a new micro-ros config * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Update _docs/tutorials/advanced/nuttx/add_microros_config/index.md Co-Authored-By: FranFin <58737168+FranFin@users.noreply.github.com> * Changing disclamer point Co-authored-by: FranFin <58737168+FranFin@users.noreply.github.com>
1 parent 947dcc0 commit b5cb056

3 files changed

Lines changed: 104 additions & 0 deletions

File tree

_data/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
- tutorials/advanced/nuttx/debugging_gdb_openocd
6666
- tutorials/advanced/nuttx/debugging_vscode
6767
- tutorials/advanced/nuttx/microros_nuttx_bsp
68+
- tutorials/advanced/nuttx/add_microros_config
6869
- tutorials/advanced/nuttx/microros_6lowpan_tutorial
6970

7071
- title: Advanced Tutorials with FreeRTOS
65.1 KB
Loading
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: Micro-ROS configuration for NuttX
3+
permalink: /docs/tutorials/advanced/nuttx/add_microros_config/
4+
---
5+
6+
| RTOS | ROS2 Version |
7+
|:-----:|:------------:|
8+
| NuttX | Dashing |
9+
10+
In this tutorial, we will see how to set a basic Micro-ROS configuration for NuttX over serial communication. Since this guide is only focused on setting the configuration, you should check the tutorial linked here before: [Adding Micro-ROS to a NuttX board configuration](https://micro-ros.github.io/docs/tutorials/advanced/nuttx/microros_nuttx_bsp/)
11+
12+
**Disclamer**
13+
14+
This guide is not guarantee to work on every NuttX supported board, because each one has a different level of peripheral implementation and memory available.
15+
16+
## Required hardware
17+
18+
- Any NuttX supported board with at least these characteristics:
19+
- STM32 MCU.
20+
- RAM: 125 Kb.
21+
- Flash: 512 kb.
22+
- Serial communication peripheral.
23+
24+
- USB-TTY serial cable.
25+
26+
## Workspace set-up
27+
28+
As a first thing, we're going to create a Micro-ROS workspace. To do so, we will execute the following commands on a console:
29+
30+
```
31+
source /opt/ros/$ROS_DISTRO/setup.bash
32+
33+
mkdir uros_ws && cd uros_ws
34+
35+
git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro-ros-build.git src/micro-ros-build
36+
37+
rosdep update && rosdep install --from-path src --ignore-src -y
38+
39+
colcon build
40+
41+
source install/local_setup.bash
42+
```
43+
44+
45+
46+
## Set the base configuration
47+
48+
In this guide we will give Micro-ROS support for the [Olimex-STM32-H407 board](https://www.olimex.com/Products/ARM/ST/STM32-H407/open-source-hardware) as an example.
49+
50+
This board is a simplified version of our supported Olimex-STM32-E407 board.
51+
52+
In the previous console, execute the following commands to set the basic configuration:
53+
```bash
54+
ros2 run micro_ros_setup create_firmware_ws.sh nuttx olimex-stm32-h407
55+
ros2 run micro_ros_setup configure_firmware.sh nsh
56+
```
57+
58+
If everything goes fine, it should output the message:
59+
```bash
60+
Copy files
61+
Refreshing...
62+
```
63+
64+
Now the basic NSH configuration is set. With the steps that follow, we will set the required configuration to run Micro-ROS on this board.
65+
66+
## Micro-ROS configuration.
67+
68+
In the same console as before, run the commands:
69+
```bash
70+
cd firmware/NuttX
71+
make menuconfig
72+
```
73+
74+
The menu below should appear:
75+
![](images/nuttx_menuconfig.png)
76+
77+
Note: Remember that you should follow this previous tutorial before starting it. [Adding Micro-ROS to a NuttX board configuration](https://micro-ros.github.io/docs/tutorials/advanced/nuttx/microros_nuttx_bsp/)
78+
79+
In the menu, you need to set the following configuration.
80+
81+
- System Type > STM32 Peripheral Support > USART3
82+
- RTOS Features > Clocks and Timers > Support CLOCK_MONOTONIC
83+
- Device Drivers > Serial Driver Support > Serial TERMIOS support
84+
- Library Routines > Standard Math Library
85+
- Library Routines > sizeof(_Bool) is a 8-bits
86+
- Library Routines > Build uClibc++ (must be installed)
87+
- Application Configuration > micro-ROS
88+
- Application Configuration > micro-ROS > Transport > Serial Transport
89+
- Application Configuration > Examples > microROS Publisher
90+
91+
Push two times the key "ESC" and set yes, when it asks you if you want to save it.
92+
93+
Now the configuration is properly set, the only thing left is to compile it. To do so, continue in the same console and execute the commands:
94+
```
95+
cd ../..
96+
ros2 run micro_ros_setup build_firmware.sh
97+
```
98+
99+
If everything goes fine, it should return the following output:
100+
```bash
101+
CP: nuttx.hex
102+
CP: nuttx.bin
103+
```

0 commit comments

Comments
 (0)