Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add port for Nucleo-F767ZI #247

Merged
merged 5 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* @pablogs9 @jamoralp @FranFin
config/freertos/nucleo_f446ze/ @alsaibie
config/freertos/esp32/ @donRaphaco
config/freertos/nucleo_f746zg/ @edesta-be
config/freertos/nucleo_f746zg/ @edesta-be
config/freertos/nucleo_f767zi/ @jnugen
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ jobs:
configuration: int32_publisher
transport_arguments: -t serial -d 1
binary: 'firmware/freertos_apps/microros_nucleo_f746zg_extensions/build/micro-ROS.elf'

- rtos: freertos
platform: nucleo_f767zi
configuration: int32_publisher
transport_arguments: -t serial -d 1
binary: 'firmware/freertos_apps/microros_nucleo_f767zi_extensions/build/micro-ROS.elf'

- rtos: freertos
platform: esp32
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This package is the **official build system for micro-ROS**. It provides tools a
| [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` |
| [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` |
| [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` |
| [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` |
| [FreeRTOS](https://www.freertos.org/) | [Espressif ESP32](https://www.espressif.com/en/products/socs/esp32/overview) | v8.2.0 | `freertos esp32` |
| [Zephyr](https://www.zephyrproject.org/) | [Olimex STM32-E407](https://www.olimex.com/Products/ARM/ST/STM32-E407/open-source-hardware) | v2.4.99 | `zephyr olimex-stm32-e407` |
| [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` |
Expand Down Expand Up @@ -134,6 +135,7 @@ In summary, the supported configurations for transports are:
| ST Nucleo F446ZE <sup>1</sup> | - | UART | - |
| ST Nucleo H743ZI <sup>1</sup> | - | - | UART |
| ST Nucleo F746ZG <sup>1</sup> | - | UART | UART |
| ST Nucleo F767ZI <sup>1</sup> | - | UART | - |

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

Expand Down
5 changes: 5 additions & 0 deletions config/freertos/nucleo_f767zi/board.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repositories:
freertos_apps:
type: git
url: https://github.com/micro-ros/freertos_apps
version: foxy
36 changes: 36 additions & 0 deletions config/freertos/nucleo_f767zi/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f767zi_extensions

. $PREFIX/config/utils.sh

pushd $EXTENSIONS_DIR >/dev/null

export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1)

if [ -v UROS_CUSTOM_APP_FOLDER ]; then
export UROS_APP_FOLDER="$UROS_CUSTOM_APP_FOLDER/$UROS_APP"
else
export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP"
fi

if [ -d "$UROS_APP_FOLDER" ]; then
echo "Selected app: $UROS_APP"
else
echo "App not found: $UROS_APP"
print_available_apps
exit 1
fi

if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "build" ]; then
# Clean micro-ROS build
rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log

# Clean build
make clean

# Build micro-ROS stack
make libmicroros
fi

# Build firmware
make -j$(nproc) UROS_APP_FOLDER=$UROS_APP_FOLDER
popd >/dev/null
36 changes: 36 additions & 0 deletions config/freertos/nucleo_f767zi/client-colcon.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"names": {
"tracetools": {
"cmake-args": [
"-DTRACETOOLS_DISABLED=ON",
"-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
]
},
"rcutils": {
"cmake-args": [
"-DENABLE_TESTING=OFF",
"-DRCUTILS_NO_FILESYSTEM=ON",
"-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON"
]
},
"microxrcedds_client": {
"cmake-args": [
"-DUCLIENT_PIC=OFF",
"-DUCLIENT_PROFILE_DISCOVERY=OFF"
]
},
"rmw_microxrcedds": {
"cmake-args": [
"-DRMW_UXRCE_XML_BUFFER_LENGTH=400",
"-DRMW_UXRCE_TRANSPORT=custom_serial",
"-DRMW_UXRCE_DEFAULT_SERIAL_DEVICE=3"
]
},
"tracetools": {
"cmake-args": [
"-DTRACETOOLS_DISABLED=ON",
"-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
]
}
}
}
50 changes: 50 additions & 0 deletions config/freertos/nucleo_f767zi/client_uros_packages.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
repositories:
eProsima/Micro-CDR:
type: git
url: https://github.com/eProsima/micro-CDR.git
version: foxy
eProsima/Micro-XRCE-DDS-Client:
type: git
url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git
version: foxy

# MicroROS

uros/rcl:
type: git
url: https://github.com/micro-ROS/rcl
version: foxy
uros/rclc:
type: git
url: https://github.com/micro-ROS/rclc
version: master
uros/rcutils:
type: git
url: https://github.com/micro-ROS/rcutils
version: foxy
uros/micro_ros_msgs:
type: git
url: https://github.com/micro-ROS/micro_ros_msgs.git
version: foxy
uros/rmw_microxrcedds:
type: git
url: https://github.com/micro-ROS/rmw-microxrcedds.git
version: foxy
uros/rosidl_typesupport:
type: git
url: https://github.com/micro-ROS/rosidl_typesupport.git
version: foxy
uros/rosidl_typesupport_microxrcedds:
type: git
url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git
version: foxy
uros/tracetools:
type: git
url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing
version: foxy_microros

# Remove this when it returns to ros2.repos
ros2/tinydir_vendor:
type: git
url: https://github.com/ros2/tinydir_vendor.git
version: master
64 changes: 64 additions & 0 deletions config/freertos/nucleo_f767zi/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f767zi_extensions

. $PREFIX/config/utils.sh

function help {
echo "Configure script need an argument."
echo " --transport -t udp, serial or serial-usb"
echo " --dev -d agent string descriptor in a serial-like transport"
echo " --ip -i agent IP in a network-like transport"
echo " --port -p agent port in a network-like transport"
}

echo $CONFIG_NAME > $FW_TARGETDIR/APP

if [ "$UROS_TRANSPORT" == "udp" ]; then

update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT="$UROS_TRANSPORT
update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP="$UROS_AGENT_IP
update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT="$UROS_AGENT_PORT
update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF"
update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=ON"
update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF"

remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_SERIAL_DEVICE"
remove_meta "microxrcedds_client" "UCLIENT_EXTERNAL_SERIAL"
remove_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_HEADER_SERIAL"
remove_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_SRC_SERIAL"

echo "Configured $UROS_TRANSPORT mode with agent at $UROS_AGENT_IP:$UROS_AGENT_PORT"

elif [ "$UROS_TRANSPORT" == "serial" ]; then
echo "Using serial device USART$UROS_AGENT_DEVICE."

cp -f $EXTENSIONS_DIR/Src/nucleo_f767zi_serial_transport.c $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/serial/serial_transport_external.c
cp -f $EXTENSIONS_DIR/Inc/nucleo_f767zi_serial_transport.h $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/transport/serial/serial_transport_external.h
update_meta "microxrcedds_client" "UCLIENT_EXTERNAL_SERIAL=ON"
update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=ON"
update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF"
update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF"

update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom_serial"
update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_SERIAL_DEVICE="$UROS_AGENT_DEVICE

remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP"
remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT"

echo "Configured $UROS_TRANSPORT mode with agent at USART$UROS_AGENT_DEVICE"

elif [ "$UROS_TRANSPORT" == "serial-usb" ]; then
echo "Using serial USB device. EXPERIMENTAL."

cp -f $EXTENSIONS_DIR/Src/nucleo_f767zi_usb_transport.c $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/serial/serial_transport_external.c
cp -f $EXTENSIONS_DIR/Inc/nucleo_f767zi_usb_transport.h $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/transport/serial/serial_transport_external.h
update_meta "microxrcedds_client" "UCLIENT_EXTERNAL_SERIAL=ON"
update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom_serial"

remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP"
remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT"

echo "Configured $UROS_TRANSPORT mode with agent"
else
help
fi
26 changes: 26 additions & 0 deletions config/freertos/nucleo_f767zi/create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pushd $FW_TARGETDIR >/dev/null
# Install toolchain
mkdir toolchain


# Install toolchain
echo "Downloading ARM compiler, this may take a while"
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
tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null
rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2

# Import repos
vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos

# ignore broken packages
touch mcu_ws/ros2/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE
touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE
touch mcu_ws/ros2/rcl/COLCON_IGNORE
touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_c/COLCON_IGNORE
touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE
touch mcu_ws/ros2/rcpputils/COLCON_IGNORE
touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE
touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE

rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro foxy --skip-keys="$SKIP"
popd >/dev/null
24 changes: 24 additions & 0 deletions config/freertos/nucleo_f767zi/flash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
OLIMEX_EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f767zi_extensions

pushd $OLIMEX_EXTENSIONS_DIR > /dev/null

if [ -f build/micro-ROS.bin ]; then
echo "Flashing firmware for $RTOS platform $PLATFORM"

if lsusb -d 15BA:002a; then
PROGRAMMER=interface/ftdi/nucleo-arm-usb-tiny-h.cfg
elif lsusb -d 15BA:0003;then
PROGRAMMER=interface/ftdi/nucleo-arm-usb-ocd.cfg
elif lsusb -d 15BA:002b;then
PROGRAMMER=interface/ftdi/nucleo-arm-usb-ocd-h.cfg
else
echo "Error. Unsuported OpenOCD USB programmer"
exit 1
fi

openocd -f $PROGRAMMER -f target/stm32f7x.cfg -c init -c "reset halt" -c "flash write_image erase build/micro-ROS.bin 0x08000000" -c "reset" -c "exit"
else
echo "build/micro-ROS.bin not found: please compile before flashing."
fi

popd > /dev/null
12 changes: 12 additions & 0 deletions config/freertos/nucleo_f767zi/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>firmware</name>
<version>0.0.0</version>
<description>Micro-ROS dependecies for FreeRTOS and STM32F767ZI Nucleo Board</description>
<maintainer email="[email protected]">James Nugen</maintainer>
<license>APL2</license>

<build_depend>openocd</build_depend>

</package>