eclipse-cyclonedds / cyclonedds

Eclipse Cyclone DDS project
https://projects.eclipse.org/projects/iot.cyclonedds
Other
878 stars 360 forks source link

Is it possible to modify cycloneDDS freeRTOS-simulator project and port it to the embeded device #1509

Open WZQ997-BJT opened 1 year ago

WZQ997-BJT commented 1 year ago

Dear CycloneDDS Team, I'm working on porting (cycloneDDS+FreeRTOS) to Aurix TC397,and I've check some issues here, so I know that the first step is look at FreeRTOS-Simulator example,now I have built it with cycloneDDS through step guide.I'm sure I have to change toolchain,to select the correct compiler,and maybe also CMakeLists. Do I have to change the source code also like ddsrt? And is it possible to just make some small change to FreeRTOS Simulator project(https://github.com/BartP6703/cyclonedds/tree/freertos) ,and compile it to run at my embeded device.And I was compiling it on Windows 11,using Tasking compiler(Compiler of the Aurix TC397).

image

cyclonedds-freertos.zip

PatrickM-ZS commented 1 year ago

Hi @WZQ997-BJT, thanks for trying out our project. At first glance, Aurix TC3xx should be capable of running CycloneDDS. We regularly build the latest codebase for comparable hardware with FreeRTOS/LwIP.

Unfortunately the support for FreeRTOS simulator is unfinished and didn't get merged, so the sources in the repo you mentioned are quite outdated. It makes use of the FreeRTOS-Sim here, which we've used on Linux but doesn't support Windows.

Nowadays FreeRTOS is adopted by Amazon and things have changed. The latest downloads include simulators for both Windows and Linux/POSIX systems: https://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html

We're keen to extend and update our FreeRTOS support so if you're interested in contributing I'll try to assist where I can. I think you should start out with the current code base, attempting to revive the old FreeRTOS simulator branch may not be worth the effort due to all the refactoring since then. You may still find some clues or inspiration though, eg. in the travis build script. I'll have to dive deeper into recent developments but I don't think much of the FreeRTOS (or LwIP) internals have changed. So the code in ddsrt may still work as-is. The effort would mostly involve adding support to the build system, so it can be configured to target the modern FreeRTOS simulators and network stack.

WZQ997-BJT commented 1 year ago

Thank you very much! Previously I had FreeRtos + Application successfully cross compile and running on TC397,and now I want to replace that application with cycloneDDS and cycloneDDS helloworld application, but when I try to cross compile it, I encounter the following problem.(inet_pton not found etc........) It would be really nice if you give me some guide about adding building support, do I need to also compile them with lwip?

image
PatrickM-ZS commented 1 year ago

Yes, you need LwIP too. Back when FreeRTOS support was added, lwip was the only viable option (the native FreeRTOS+TCP stack had issues with certain drivers, thread safety etc). So you need to use both -DWITH_FREERTOS=on and -DWITH_LWIP=on in the cmake configure command.