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
18
18
&& rm -rf gcc-arm-none-eabi-5_4-2016q2-20160622-linux.tar.bz2 gcc-arm-none-eabi-5_4-2016q2/share/doc \
19
19
&& 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 \
20
20
&& 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
22
25
23
26
COPY ./entrypoint.sh /entrypoint.sh
24
27
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
14
14
PLATFORMS+=(" teensy4" )
15
15
PLATFORMS+=(" teensy3" )
16
16
PLATFORMS+=(" cortex_m0" )
17
+ PLATFORMS+=(" cortex_m3" )
17
18
fi
18
19
19
20
shift $(( OPTIND- 1 ))
@@ -109,6 +110,20 @@ if [[ " ${PLATFORMS[@]} " =~ " cortex_m0 " ]]; then
109
110
cp -R firmware/build/libmicroros.a /arduino_project/src/cortex-m0plus/libmicroros.a
110
111
fi
111
112
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
+
112
127
# ####### Generate extra files ########
113
128
find firmware/mcu_ws/ros2 \( -name " *.srv" -o -name " *.msg" -o -name " *.action" \) | awk -F" /" ' {print $(NF-2)"/"$NF}' > /arduino_project/available_ros2_types
114
129
find 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
7
7
url =https://github.com/micro-ROS
8
8
precompiled =true
9
9
category =Other
10
- architectures =OpenCR,Teensyduino,samd
10
+ architectures =OpenCR,Teensyduino,samd,sam
Original file line number Diff line number Diff line change 1
1
#include <stdio.h>
2
2
#include <stdbool.h>
3
3
4
- /*
5
4
#if defined(ARDUINO_TEENSY41 ) || defined(ARDUINO_TEENSY40 ) || defined(ARDUINO_TEENSY32 )
6
5
#include "teensy_transports.c.in"
7
6
#elif defined(ARDUINO_ARCH_OPENCR )
8
7
#include "opencr_transports.c.in"
9
- #else
10
- #error micro-ROS Library not supported for this platform
11
8
#endif
12
- */
13
9
14
10
// TODO: This should be fixed
15
11
#if defined(ARDUINO_TEENSY32 )
You can’t perform that action at this time.
0 commit comments