File tree Expand file tree Collapse file tree 6 files changed +36
-6
lines changed Expand file tree Collapse file tree 6 files changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ RUN git clone https://github.com/micro-ROS/micro-ros-build.git src/micro-ros-bui
1818 && rm -rf gcc-arm-none-eabi-5_4-2016q2-20160622-linux.tar.bz2 gcc-arm-none-eabi-5_4-2016q2/share/doc \
1919 && wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 \
2020 && tar -xvf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 \
21- && rm -rf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 gcc-arm-none-eabi-5_4-2016q3/share/doc
21+ && rm -rf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 gcc-arm-none-eabi-5_4-2016q3/share/doc \
22+ && wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 \
23+ && tar -xvf gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 \
24+ && rm -rf gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 gcc-arm-none-eabi-4_8-2014q1/share/doc
2225
2326COPY ./entrypoint.sh /entrypoint.sh
2427
Original file line number Diff line number Diff line change 1+ SET (CMAKE_SYSTEM_NAME Generic)
2+ set (CMAKE_CROSSCOMPILING 1)
3+ set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
4+
5+ set (CMAKE_C_COMPILER $ENV{TOOLCHAIN_PREFIX} gcc)
6+ set (CMAKE_CXX_COMPILER $ENV{TOOLCHAIN_PREFIX} g++)
7+
8+ SET (CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "" )
9+ SET (CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "" )
10+
11+ set (FLAGS "-O2 -ffunction-sections -fdata-sections -fno-exceptions -mcpu=cortex-m3 -nostdlib -DARDUINO=10813 -mthumb --param max-inline-insns-single=500 -DF_CPU=84000000L -D'RCUTILS_LOG_MIN_SEVERITY=RCUTILS_LOG_MIN_SEVERITY_NONE'" CACHE STRING "" FORCE)
12+
13+ set (CMAKE_C_FLAGS_INIT "-std=c11 ${FLAGS} -DCLOCK_MONOTONIC=0 -D'__attribute__(x)='" CACHE STRING "" FORCE)
14+ set (CMAKE_CXX_FLAGS_INIT "-std=c++11 ${FLAGS} -fno-rtti -DCLOCK_MONOTONIC=0 -D'__attribute__(x)='" CACHE STRING "" FORCE)
15+
16+ set (__BIG_ENDIAN__ 0)
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ if [ $OPTIND -eq 1 ]; then
1414 PLATFORMS+=(" teensy4" )
1515 PLATFORMS+=(" teensy3" )
1616 PLATFORMS+=(" cortex_m0" )
17+ PLATFORMS+=(" cortex_m3" )
1718fi
1819
1920shift $(( OPTIND- 1 ))
@@ -109,6 +110,20 @@ if [[ " ${PLATFORMS[@]} " =~ " cortex_m0 " ]]; then
109110 cp -R firmware/build/libmicroros.a /arduino_project/src/cortex-m0plus/libmicroros.a
110111fi
111112
113+ # ####### Build for SAM (e.g. Arduino Due) ########
114+ if [[ " ${PLATFORMS[@]} " =~ " cortex_m3 " ]]; then
115+ rm -rf firmware/build
116+
117+ export TOOLCHAIN_PREFIX=/uros_ws/gcc-arm-none-eabi-4_8-2014q1/bin/arm-none-eabi-
118+ ros2 run micro_ros_setup build_firmware.sh /arduino_project/extras/library_generation/cortex_m3_toolchain.cmake /arduino_project/extras/library_generation/colcon_lowmem.meta
119+
120+ find firmware/build/include/ -name " *.c" -delete
121+ cp -R firmware/build/include/* /arduino_project/src/
122+
123+ mkdir -p /arduino_project/src/cortex-m3
124+ cp -R firmware/build/libmicroros.a /arduino_project/src/cortex-m3/libmicroros.a
125+ fi
126+
112127# ####### Generate extra files ########
113128find firmware/mcu_ws/ros2 \( -name " *.srv" -o -name " *.msg" -o -name " *.action" \) | awk -F" /" ' {print $(NF-2)"/"$NF}' > /arduino_project/available_ros2_types
114129find firmware/mcu_ws/extra_packages \( -name " *.srv" -o -name " *.msg" -o -name " *.action" \) | awk -F" /" ' {print $(NF-2)"/"$NF}' >> /arduino_project/available_ros2_types
Original file line number Diff line number Diff line change @@ -7,4 +7,4 @@ paragraph=micro-ROS Arduino library
77url =https://github.com/micro-ROS
88precompiled =true
99category =Other
10- architectures =OpenCR,Teensyduino,samd
10+ architectures =OpenCR,Teensyduino,samd,sam
Original file line number Diff line number Diff line change 11#include <stdio.h>
22#include <stdbool.h>
33
4- /*
54#if defined(ARDUINO_TEENSY41 ) || defined(ARDUINO_TEENSY40 ) || defined(ARDUINO_TEENSY32 )
65#include "teensy_transports.c.in"
76#elif defined(ARDUINO_ARCH_OPENCR )
87#include "opencr_transports.c.in"
9- #else
10- #error micro-ROS Library not supported for this platform
118#endif
12- */
139
1410// TODO: This should be fixed
1511#if defined(ARDUINO_TEENSY32 )
You can’t perform that action at this time.
0 commit comments