-
Notifications
You must be signed in to change notification settings - Fork 134
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
Support RTEMS #397
Comments
I started to compile against an old RTEMS toolchain of mine, since it was ready on my PC. rtems_toolchain.cmake
rtems.colcon.meta
In my ros2_workspace:
Compilation goes on without critical failures. I met only a bug in:
where
|
A lot of warnings though. This one occurs at every package.
This annoying warning can be suppressed by commenting out the following line:
in |
Is there a list of all the definitions in colcon.meta? |
I discovered that no matter if in your custom toolchain you add a line such:
the |
Some updates: rtems-toolchain.cmake
rtems-colcon.meta
I commented out:
in Here is the only notable warning/error popping out of my build step:
|
I opended some PRs to fix the warnings. Next step is waiting to retrieve my Beaglebone Black (which now I don't have with me, but it will be again sometime in the following weeks) and start some tests. |
TODOs (suggestions welcomed):
In particular, one doubt of mine is how to specify which serial/network port to use on the board to the micro-ros library. Hoping it is somewhere in the documentation. If anyone can pinpoint me, it would be awesome. |
Are there any tests which don't require networking and just check basic services to start with? And I would recommend trying arm/zynq on qemu first. If you need a example RTEMS configuration and initialization that sets things up and then calls main(), just ask and I'll email it to you privately |
I believe the basic setup could be a RTEMS application with 1 task and 1 micro-ROS publisher. |
In parallel with making myself a new RTEMS environment (with the goal to execute some default tests in the emulator before starting to add micro-ROS in the mix), I'm reading more about micro-ROS. I have some questions in my mind, but the first one is: EDIT: let me rephrase that: using generate_lib, is there any target-specific source code implementation needed to support micro-ROS, or I just need to use its API as normal when writing a task of my RTOS image? |
I tried to dig in the source code, following the source of an example: |
I can't tell if this is a micro-ROS or RTEMS question. I can't imagine ROS needs anything from POSIX that RTEMS does not have. We have this guide in our documentation set (https://docs.rtems.org/branches/master/posix-compliance/index.html) which details how RTEMS aligns against various C and POSIX based standards.
If a package has a POSIX port which is geared to embedded environments (e.g. doesn't use fork/exec, graphics, etc.), then it often just compiles for RTEMS. The issues that must be addressed are RTEMS initialization and configuration and possibly contents of the initial filesystem. |
Thank you @joelsherrill for your answers! Yes, I followed the source code pointed and used by the demo but never found fork/exec. When I have time, I'll also do a keyword based research around the codebase just as an additional check. |
Hello everyone, finally I got a clean RTEMS 5.1 erc32 BSP (sparc) built on my PC. A year ago, I wrote this simple CMake template fort RTEMS. Now I started porting the ping-pong microROS app. I started copy-pasting some code from freeRTOS ping-pong example and up to now, the compiler errors are:
In practice, two problems up to now:
I suspect the second one is related to the simulator not having a serial port implemented, so I may fix it changing microROS build configuration to use network instead of serial port. But the first issue is the most critical IMHO, and I don't know how to proceed. Any help? |
Seems that adding to
solved the GLOBAL_OFFSET_TABLE problem. Now I have the issue with the unimpemented |
Seems that RTEMS deliberately does not support poll() call. https://docs.rtems.org/branches/master/posix-compliance/posix-compliance.html https://docs.rtems.org/releases/rtems-docs-4.11.1/bsp-howto/console.html RTEMS relies on termios. I need to investigate how to maybe offer an alternative to the POSIX implementation |
Another round of updates: I read the sources and found that for now the simplest way to get to a minimal demo is to use UDP transport with the microros_build_conf_2.zip It builds. Now the "hard" part is to test it. |
Can you give me some help about what you are saying?
Is qemu helpful for testing also tcp/udp and uarts? Is it possible? Do you have some demo code for interface configuration? |
Email me at joel AT rtems dot org and I will email you back a quick start network example for zynq qemu that should help you. If you don't initialize the network stack, then there is no networking. |
This branch (https://github.com/roncapat/Micro-XRCE-DDS-Client/tree/foxy) adds a TCP/UDP implementation suitable for RTEMS. It is a clean POSIX using select() call instead of poll(). I will not open a PR until I see it run on RTEMS and not only build correctly. |
@joelsherrill I wrote to you by email but sadly no response... Today I set up my beaglebone black and now I'm stuck at the same point of setting up networking. Could you send me the example at roncapat@gmail.com ? It would be very helpful for me. |
@roncapat Not sure what happened. I don't see any email from you about this. But I went ahead and sent it. Poke me if you don't get it. |
Thank you so much! Hope to share some project updates before Christmas :) |
Working again on the subject. This time I'm here to share a build issue related to glibc 2.46. On my system (Ubuntu 20.04) I have
On the internet, I found only this reference to a simple patch to use whenever host GCC is version 9. However, I have GCC 8 as host compiler and GCC 7.5 as ARM compiler from RSB tools. I tried to apply manually the patch to the source files and rebuild but files are probably being overwritten. Anyone has the solution to trigger a sb-set-builder rebuild without overwriting source files? EDIT: more readable patch but not directly applicable. Patches can be added to the build process in file EDIT 2: SOLVED In
after the last |
Another error while trying to build
the proper fix should be this one. Trying to follow the same patching logic of the glibc problem. EDIT: SOLVED In
after the last EDIT 2: |
@joelsherrill I think I got to a good point. The task passes all allocations for the DDS, and now the application fails to establish a qemu-outgoing TCP connection to my local host. In fact, the connect() call fails and I receive no handshake on host side. Do you have hints on how to configure gateway or other parameters for outgoing connections from RTEMS app in qemu? |
connect() from RTEMS QEMU guest tries to connect to microROS Agent on the TCP host port 8888. (127.0.0.1:8888) but returns EADDRNOTAVAIL, when using QEMU SLIRP which by default should allow outgoing packets to 127.0.0.1. RTEMS is configured to use DHCP, as Joel told me to do in his tutorial. Any suggestions about how to proceed? |
Aaaand: IT WORKS! PingPong example ran successfully on my machine after a very long weekend. First of all, before forgetting it forever, here is what I found useful to set a tap network between host and qemu:
I used qemu from rtems-libbsd. My current command line is:
For now, the application connects to the host and set ups correctly all publishers and subscribers. The timer ticks every 2 secs and published a ping message, but unfortunately I can't see it while EDIT: the communication works for the first 4 PINGs. After them, seems like the timer is called but the actual publication of the message is not happening anymore. |
Solved the bug. It was an issue on host->target communication, where the custom code for the DDS failed to poll presence of incoming data. Seems I was not resetting the FD_SET prior to calling select(). Now that everything works well, I do some cleanups and open a PR for the DDS Client. |
If possible, I'd keep this Issue open. Since support was merged, now the next step would be to find a way to add scripting support for RTEMS build in this repo. When I will have more time I'll give it a try. |
Rapid note about testing serial transport with QEMU: command line:
When launched, a message like this is printed:
this means that on your host Launch the micro_ros_agent with command line:
and only then you can launch your RTEMS mros application. |
It would be interesting to use micro-ROS on RTEMS (The Real-Time Executive for Multiprocessor Systems).
It is an RTOS used in space applications.
It offers POSIX interface.
A simple and cheap SBC like a BeagleBone Black would be sufficient to make tests on hardware (but everything can be done also virtually).
For now, I do not have the time to try alone,
Of course, if I ever find the time I will try on my own and share PRs if it's ok.
The text was updated successfully, but these errors were encountered: