Closed wuhanstudio closed 3 years ago
Hello,
As you can see on the lib generation script, we use the same compiler version as the Arduino IDE for each board.
Your board is not currently supported by the library generator, but you can modify the script to use your own gcc version:
Clone this repo and modify this line to: export TOOLCHAIN_PREFIX=/toolchain/bin/arm-none-eabi-
https://github.com/micro-ROS/micro_ros_arduino/blob/94cb206d03cfb19aa3f1404f0d9d9cbd6b7bac6d/extras/library_generation/library_generation.sh#L88
Set the local path of the desired compiler:
export GCC_PATH=/local_path/gcc-arm-none-eabi-10-2020-q4-major
(Use your own local path)
Call the docker generator from the repo folder:
docker run -it --rm -v ${GCC_PATH}:/toolchain -v $(pwd):/project --env MICROROS_LIBRARY_FOLDER=extras microros/micro_ros_static_library_builder:foxy -p cortex_m3
The generated library should be on src/cortex-m3/libmicroros.a
:
~/workspace/micro_ros_arduino$ strings src/cortex-m3/libmicroros.a | grep "GCC: ("
$ GCC: (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)
Thanks for your help. Now both ROS1 (rosserial) and ROS2 (micro_ros) works on RT-Thread (RTOS).
https://github.com/wuhanstudio/micro_ros
ROS1 (rosserial):
ROS2 (micro_ros):
Great!
I am closing the issue, feel free to reopen if needed
Issue template
Steps to reproduce the issue
Additional information
I notice that the gcc version being used to generate libmicroros.a is 5.4, which is a little outdated.
This could cause the error
undefined reference to __ctype_ptr__
if someone uses a newer version of gcc.https://stackoverflow.com/questions/54940410/gnu-toolchain-newlib-compatibility-between-toolchain-versions-undefined-symb