Skip to content

Commit 98d01c7

Browse files
committed
Mbed initial support (#266)
Update
1 parent 8c0b5da commit 98d01c7

14 files changed

Lines changed: 124 additions & 15 deletions

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ jobs:
184184
configuration: weather_publisher
185185
binary: 'firmware/bin/weather_publisher'
186186

187+
- rtos: mbed
188+
platform: disco_l475vg_iot01a
189+
binary: 'firmware/micro_ros_mbed/cmake_build/mbed-microros.bin'
187190
steps:
188191
- uses: actions/checkout@v2
189192
with:
@@ -192,7 +195,12 @@ jobs:
192195
- name: Dependencies
193196
run: |
194197
apt update
195-
apt install -y python3-colcon-metadata python3-pip
198+
# Install last version of CMake
199+
apt install -y apt-transport-https ca-certificates gnupg software-properties-common wget
200+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
201+
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
202+
apt-get update
203+
apt install -y python3-colcon-metadata python3-pip cmake
196204
rosdep update --rosdistro $ROS_DISTRO
197205
rosdep install -y --from-paths src --ignore-src -y
198206

.github/workflows/nightly.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ jobs:
320320
configuration: weather_publisher
321321
binary: 'firmware/bin/weather_publisher'
322322

323+
- distro: rolling
324+
branch: main
325+
rtos: mbed
326+
platform: disco_l475vg_iot01a
327+
binary: 'firmware/micro_ros_mbed/cmake_build/mbed-microros.bin'
323328
steps:
324329
- uses: actions/checkout@v2
325330
with:
@@ -329,7 +334,12 @@ jobs:
329334
- name: Dependencies
330335
run: |
331336
apt update
332-
apt install -y python3-colcon-metadata python3-pip
337+
# Install last version of CMake
338+
apt install -y apt-transport-https ca-certificates gnupg software-properties-common wget
339+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
340+
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
341+
apt-get update
342+
apt install -y python3-colcon-metadata python3-pip cmake
333343
rosdep update --rosdistro $ROS_DISTRO
334344
rosdep install -y --from-paths src --ignore-src -y
335345

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ This package is the **official build system for micro-ROS**. It provides tools a
3333
| [Zephyr](https://www.zephyrproject.org/) | [ST B-L475E-IOT01A](https://docs.zephyrproject.org/latest/boards/arm/disco_l475_iot1/doc/index.html) | v2.4.99 | `zephyr discovery_l475_iot1` |
3434
| [Zephyr](https://www.zephyrproject.org/) | [ST Nucleo H743ZI](https://www.st.com/en/evaluation-tools/nucleo-h743zi.html) <sup>1</sup> | v2.4.99 | `zephyr nucleo_h743zi` |
3535
| [Zephyr](https://www.zephyrproject.org/) | [Zephyr emulator](https://docs.zephyrproject.org/2.3.0/boards/posix/native_posix/doc/index.html) | v2.4.99 | `zephyr host` |
36+
| [Mbed](https://os.mbed.com/) | [ST B-L475E-IOT01A](https://os.mbed.com/platforms/ST-Discovery-L475E-IOT01A/) | v6.6 | `mbed disco_l475vg_iot01a` |
3637
| - | Static library (.a) and headers (.h) <sup>3</sup> | - | `generate_lib` |
3738
| Linux | *Host <sup>2</sup>* | Ubuntu 18.04/20.04 | `host` |
3839

@@ -50,6 +51,7 @@ micro-ROS also offers some other ways to crosscompile it for different platforms
5051

5152
- a standalone **[micro-ROS component for ESP-IDF](https://github.com/micro-ROS/micro_ros_espidf_component)**: this package enables the integration of micro-ROS in any Espressif ESP32 IDF project.
5253
- a standalone **[micro-ROS module for Zephyr RTOS](https://github.com/micro-ROS/micro_ros_zephyr_module)**: this package enables the integration of micro-ROS in any Zephyr RTOS workspace.
54+
- a standalone **[micro-ROS module for Mbed RTOS](https://github.com/micro-ROS/micro_ros_mbed)**: this package enables the integration of micro-ROS in any Mbed RTOS workspace.
5355
- a precompiled set of **[Arduino IDE libraries](https://github.com/micro-ROS/micro_ros_arduino)**: this package enables the integration of micro-ROS in the Arduino IDE for some hardware platforms.
5456

5557
# Dependencies
@@ -78,7 +80,7 @@ source /opt/ros/$ROS_DISTRO/setup.bash
7880

7981
mkdir uros_ws && cd uros_ws
8082

81-
git clone -b master https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup
83+
git clone -b main https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup
8284

8385
rosdep update && rosdep install --from-path src --ignore-src -y
8486

@@ -128,17 +130,17 @@ Please note that each RTOS has its configuration approach that you might use for
128130

129131
In summary, the supported configurations for transports are:
130132

131-
| | NuttX | FreeRTOS | Zephyr |
132-
| ----------------------------- | :----------------: | :---------------: | :----------------: |
133-
| Olimex STM32-E407 | USB, UART, Network | UART, Network | USB, UART |
134-
| ST B-L475E-IOT01A | - | - | USB, UART, Network |
135-
| Crazyflie 2.1 | - | Custom Radio Link | - |
136-
| Espressif ESP32 | - | UART, WiFI UDP | - |
137-
| ST Nucleo F446RE <sup>1</sup> | - | UART | - |
138-
| ST Nucleo F446ZE <sup>1</sup> | - | UART | - |
139-
| ST Nucleo H743ZI <sup>1</sup> | - | - | UART |
140-
| ST Nucleo F746ZG <sup>1</sup> | - | UART | UART |
141-
| ST Nucleo F767ZI <sup>1</sup> | - | UART | - |
133+
| | NuttX | FreeRTOS | Zephyr | Mbed |
134+
| ----------------------------- | :----------------: | :---------------: | :----------------: | :----------------: |
135+
| Olimex STM32-E407 | USB, UART, Network | UART, Network | USB, UART | - |
136+
| ST B-L475E-IOT01A | - | - | USB, UART, Network | UART |
137+
| Crazyflie 2.1 | - | Custom Radio Link | - | - |
138+
| Espressif ESP32 | - | UART, WiFI UDP | - | - |
139+
| ST Nucleo F446RE <sup>1</sup> | - | UART | - | - |
140+
| ST Nucleo F446ZE <sup>1</sup> | - | UART | - | - |
141+
| ST Nucleo H743ZI <sup>1</sup> | - | - | UART | - |
142+
| ST Nucleo F746ZG <sup>1</sup> | - | UART | UART | - |
143+
| ST Nucleo F767ZI <sup>1</sup> | - | UART | - | - |
142144

143145
*<sup>1</sup> Community supported, may have lack of official support*
144146

config/mbed/dev_ros2_packages.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
keep:
2+
none
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repositories:

config/mbed/generic/board.repos

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repositories:
2+
micro_ros_mbed:
3+
type: git
4+
url: https://github.com/micro-ROS/micro_ros_mbed
5+
version: main

config/mbed/generic/build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
. $PREFIX/config/utils.sh
2+
3+
export PATH=~/.local/bin:"$PATH"
4+
5+
pushd $FW_TARGETDIR >/dev/null
6+
7+
pushd micro_ros_mbed >/dev/null
8+
mbed-tools compile -m $PLATFORM -t GCC_ARM
9+
popd >/dev/null
10+
11+
popd >/dev/null
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repositories:

config/mbed/generic/create.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
CMAKE_VERSION_NUMBER=$(cmake --version | grep "[0-9]*\.[0-9]*\.[0-9]*" | cut -d ' ' -f 3)
2+
CMAKE_VERSION_MAJOR_NUMBER=$(echo $CMAKE_VERSION_NUMBER | cut -d '.' -f 1)
3+
CMAKE_VERSION_MINOR_NUMBER=$(echo $CMAKE_VERSION_NUMBER | cut -d '.' -f 2)
4+
CMAKE_VERSION_PATCH_NUMBER=$(echo $CMAKE_VERSION_NUMBER | cut -d '.' -f 3)
5+
6+
if ! (( $CMAKE_VERSION_MAJOR_NUMBER > 3 || \
7+
$CMAKE_VERSION_MAJOR_NUMBER == 3 && $CMAKE_VERSION_MINOR_NUMBER > 19 || \
8+
$CMAKE_VERSION_MAJOR_NUMBER == 3 && $CMAKE_VERSION_MINOR_NUMBER == 19 && $CMAKE_VERSION_PATCH_NUMBER >= 0 )); then
9+
echo "Error: installed CMake version must be equal or greater than 3.19.0."
10+
echo "Your current version is $CMAKE_VERSION_NUMBER."
11+
echo "Please if not installed follow the instructions: https://apt.kitware.com/"
12+
exit 1
13+
fi
14+
15+
export PATH=~/.local/bin:"$PATH"
16+
17+
pushd $FW_TARGETDIR >/dev/null
18+
19+
pip3 install mbed-tools
20+
21+
# Import repos
22+
vcs import --input $PREFIX/config/$RTOS/generic/board.repos
23+
24+
pushd micro_ros_mbed >/dev/null
25+
mbed-tools deploy
26+
pip3 install -r mbed-os/requirements.txt
27+
popd >/dev/null
28+
29+
# TODO (pablogs): Avoid current approach and rely on the standalone module
30+
# rm -rf dev_ws mcu_ws
31+
popd >/dev/null

config/mbed/generic/flash.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
. $PREFIX/config/utils.sh
2+
3+
export PATH=~/.local/bin:"$PATH"
4+
5+
pushd $FW_TARGETDIR >/dev/null
6+
7+
pushd micro_ros_mbed >/dev/null
8+
mbed-tools compile -m DISCO_L475VG_IOT01A -t GCC_ARM -f
9+
popd >/dev/null
10+
11+
popd >/dev/null

0 commit comments

Comments
 (0)