Skip to content

Commit 0788fa5

Browse files
RTriouxjamoralp
andauthored
Add support for nucleo F446RE (#251)
* Add support for nucleo F446RE * Based on already existing repository for nucleo F446ZE * Add codeowners, Readme HW table and CI * Trigger CI including freertos_apps changes * Revert "Trigger CI including freertos_apps changes" This reverts commit 0dc19b7. Co-authored-by: Jose Antonio Moral <joseantoniomoralparras@gmail.com>
1 parent 2ffb85f commit 0788fa5

11 files changed

Lines changed: 188 additions & 1 deletion

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
config/freertos/nucleo_f446ze/ @alsaibie
33
config/freertos/esp32/ @donRaphaco
44
config/freertos/nucleo_f746zg/ @edesta-be
5-
config/freertos/nucleo_f767zi/ @jnugen
5+
config/freertos/nucleo_f767zi/ @jnugen
6+
config/freertos/nucleo_f446re/ @RTrioux

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ jobs:
108108
transport_arguments: -t serial -d 1
109109
binary: 'firmware/freertos_apps/microros_olimex_e407_extensions/build/micro-ROS.elf'
110110

111+
- rtos: freertos
112+
platform: nucleo_f446re
113+
configuration: int32_publisher
114+
transport_arguments: -t serial -d 1
115+
binary: 'firmware/freertos_apps/microros_nucleo_f446re_extensions/build/micro-ROS.elf'
116+
111117
- rtos: freertos
112118
platform: nucleo_f446ze
113119
configuration: int32_publisher

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This package is the **official build system for micro-ROS**. It provides tools a
2424
| [Nuttx](https://nuttx.org/) | [Olimex STM32-E407](https://www.olimex.com/Products/ARM/ST/STM32-E407/open-source-hardware) | v7.29 | `nuttx olimex-stm32-e407` |
2525
| [FreeRTOS](https://www.freertos.org/) | [Crazyflie 2.1](https://www.bitcraze.io/crazyflie-2-1/) | v10.2.1 - CF 2020.06 | `freertos crazyflie21` |
2626
| [FreeRTOS](https://www.freertos.org/) | [Olimex STM32-E407](https://www.olimex.com/Products/ARM/ST/STM32-E407/open-source-hardware) | STM32CubeMX latest | `freertos olimex-stm32-e407` |
27+
| [FreeRTOS](https://www.freertos.org/) | [ST Nucleo F446RE](https://www.st.com/en/evaluation-tools/nucleo-f446re.html) <sup>1</sup> | STM32CubeMX latest | `freertos nucleo_f446re` |
2728
| [FreeRTOS](https://www.freertos.org/) | [ST Nucleo F446ZE](https://www.st.com/en/evaluation-tools/nucleo-f446ze.html) <sup>1</sup> | STM32CubeMX latest | `freertos nucleo_f446ze` |
2829
| [FreeRTOS](https://www.freertos.org/) | [ST Nucleo F746ZG](https://www.st.com/en/evaluation-tools/nucleo-f746zg.html) <sup>1</sup> | STM32CubeMX latest | `freertos nucleo_f746zg` |
2930
| [FreeRTOS](https://www.freertos.org/) | [ST Nucleo F767ZI](https://www.st.com/en/evaluation-tools/nucleo-f746zg.html) <sup>1</sup> | STM32CubeMX latest | `freertos nucleo_f767zi` |
@@ -132,6 +133,7 @@ In summary, the supported configurations for transports are:
132133
| ST B-L475E-IOT01A | - | - | USB, UART, Network |
133134
| Crazyflie 2.1 | - | Custom Radio Link | - |
134135
| Espressif ESP32 | - | UART, WiFI UDP | - |
136+
| ST Nucleo F446RE <sup>1</sup> | - | UART | - |
135137
| ST Nucleo F446ZE <sup>1</sup> | - | UART | - |
136138
| ST Nucleo H743ZI <sup>1</sup> | - | - | UART |
137139
| ST Nucleo F746ZG <sup>1</sup> | - | UART | UART |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repositories:
2+
freertos_apps:
3+
type: git
4+
url: https://github.com/micro-ros/freertos_apps
5+
version: foxy
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446re_extensions
2+
3+
. $PREFIX/config/utils.sh
4+
5+
pushd $EXTENSIONS_DIR >/dev/null
6+
7+
export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1)
8+
9+
if [ -v UROS_CUSTOM_APP_FOLDER ]; then
10+
export UROS_APP_FOLDER="$UROS_CUSTOM_APP_FOLDER/$UROS_APP"
11+
else
12+
export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP"
13+
fi
14+
15+
if [ -d "$UROS_APP_FOLDER" ]; then
16+
echo "Selected app: $UROS_APP"
17+
else
18+
echo "App not found: $UROS_APP"
19+
print_available_apps
20+
exit 1
21+
fi
22+
23+
if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "build" ]; then
24+
# Clean micro-ROS build
25+
rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log
26+
27+
# Clean build
28+
make clean
29+
30+
# Build micro-ROS stack
31+
make libmicroros
32+
fi
33+
34+
# Build firmware
35+
make -j$(nproc) UROS_APP_FOLDER=$UROS_APP_FOLDER
36+
popd >/dev/null
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"names": {
3+
"tracetools": {
4+
"cmake-args": [
5+
"-DTRACETOOLS_DISABLED=ON",
6+
"-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
7+
]
8+
},
9+
"rcutils": {
10+
"cmake-args": [
11+
"-DENABLE_TESTING=OFF",
12+
"-DRCUTILS_NO_FILESYSTEM=ON",
13+
"-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON",
14+
"-DRCUTILS_NO_64_ATOMIC=ON"
15+
]
16+
},
17+
"microxrcedds_client": {
18+
"cmake-args": [
19+
"-DUCLIENT_PIC=OFF",
20+
"-DUCLIENT_PROFILE_DISCOVERY=OFF"
21+
]
22+
},
23+
"rmw_microxrcedds": {
24+
"cmake-args": [
25+
"-DRMW_UXRCE_XML_BUFFER_LENGTH=400",
26+
"-DRMW_UXRCE_TRANSPORT=custom_serial",
27+
"-DRMW_UXRCE_DEFAULT_SERIAL_DEVICE=3"
28+
]
29+
},
30+
"tracetools": {
31+
"cmake-args": [
32+
"-DTRACETOOLS_DISABLED=ON",
33+
"-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
34+
]
35+
}
36+
}
37+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../client_uros_packages.repos
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446re_extensions
2+
3+
. $PREFIX/config/utils.sh
4+
5+
function help {
6+
echo "Configure script need an argument."
7+
echo " --transport -t serial or serial-usb"
8+
echo " --dev -d agent string descriptor in a serial-like transport"
9+
}
10+
11+
echo $CONFIG_NAME > $FW_TARGETDIR/APP
12+
# TODO add USB-OTG support
13+
if [ "$UROS_TRANSPORT" == "serial" ]; then
14+
echo "Using serial device USART$UROS_AGENT_DEVICE."
15+
16+
cp -f $EXTENSIONS_DIR/uros_transport/stm32f446re_serial_transport.c $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/serial/serial_transport_external.c
17+
cp -f $EXTENSIONS_DIR/uros_transport/stm32f446re_serial_transport.h $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/transport/serial/serial_transport_external.h
18+
update_meta "microxrcedds_client" "UCLIENT_EXTERNAL_SERIAL=ON"
19+
update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=ON"
20+
update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF"
21+
update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF"
22+
23+
update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom_serial"
24+
update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_SERIAL_DEVICE="$UROS_AGENT_DEVICE
25+
26+
remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP"
27+
remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT"
28+
29+
echo "Configured $UROS_TRANSPORT mode with agent at USART$UROS_AGENT_DEVICE"
30+
31+
else
32+
help
33+
fi
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
pushd $FW_TARGETDIR >/dev/null
2+
# Install toolchain
3+
mkdir toolchain
4+
5+
6+
# Install toolchain
7+
echo "Downloading ARM compiler, this may take a while"
8+
curl -fsSLO https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2
9+
tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null
10+
rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2
11+
12+
# Import repos
13+
vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos
14+
15+
# ignore broken packages
16+
touch mcu_ws/ros2/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE
17+
touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE
18+
touch mcu_ws/ros2/rcl/COLCON_IGNORE
19+
touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_c/COLCON_IGNORE
20+
touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE
21+
touch mcu_ws/ros2/rcpputils/COLCON_IGNORE
22+
touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE
23+
touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE
24+
25+
rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro foxy --skip-keys="$SKIP"
26+
popd >/dev/null
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446re_extensions
2+
3+
USE_STFLASH=false
4+
5+
pushd $EXTENSIONS_DIR > /dev/null
6+
7+
if [ -f build/micro-ROS.bin ]; then
8+
9+
echo "Flashing firmware for $RTOS platform $PLATFORM"
10+
if [ $USE_STFLASH = true ]; then
11+
st-flash --reset write build/micro-ROS.bin 0x8000000
12+
else
13+
if lsusb -d 0483:374b; then
14+
ST_INTERFACE=interface/stlink-v2-1.cfg
15+
elif lsusb -d 0483:3748; then
16+
ST_INTERFACE=interface/stlink-v2.cfg
17+
else
18+
# TODO: add stlink v3, should it be stlink.cfg ?
19+
echo "Error. Unsuported OpenOCD USB programmer"
20+
exit 1
21+
fi
22+
openocd -f $ST_INTERFACE -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase build/micro-ROS.bin 0x08000000" -c "reset" -c "exit"
23+
fi
24+
else
25+
echo "build/micro-ROS.bin not found: please compile before flashing."
26+
fi
27+
28+
popd > /dev/null

0 commit comments

Comments
 (0)