Cross compile to FreeRTOS #978
-
Hi, I have found this [https://github.com//issues/7](FreeRTOS discussion). The next step of my project is to change the board from Raspberry Pi to STM32 based MCU. since the discussion was dated back in 2018 and the framework was a little bit different from current version, would you mind pointing out the difference? For example, since |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 33 replies
-
We've made a few attempts to get F Prime to run on FreeRTOS, and the problem has been trying to get a board with a mature BSP rather than the FreeRTOS API itself. I looked into it, and it looks straightforward. If you have a board to test it with, perhaps we can create an |
Beta Was this translation helpful? Give feedback.
-
I was getting distracted with other works but I finally have time to start looking into this. I have forked fprime repo and I will be using that to work on porting Ref to Nucleo-H743ZI2 with freeRTOS (I vaguely remember my colleague suggestion on using Chibi OS. I will probably look into that too.) I have followed the porting guide and downloaded gcc-arm-none-eabi. I believe this is the right compiler because pretty much any project with stm32 that is built with make/cmake use this compiler. I believe I can still use Linux's standard type here. I managed to get a BSP for the board by using CubeMX. The problem is I'm kind of lost on what to do next with these to build a hardware driver and OS layer stuff. |
Beta Was this translation helpful? Give feedback.
-
Not sure if this is a place to ask this question but I'm not sure if and how thread joining is being used in F'? Since there is no task joining in freeRTOS, if it's not necessary then I could just skip it entirely. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I have updated my code in my repo. I have added OS layer file that call freertos API and try to make a deployment that blink a onboard LED, similar to what @LeStarch did on his arduino cross compiler. Since freeRTOS doesn't have a file system, I am using baremetal for file system for now. after running
I am trying to something similar to the arduino cmake toolchain by creating a cmake function and then have a component's cmake call that function for linking the libraries. I want to do it this way because there are lots of components and OS layer stuff that would need to be linked to the board's BSP and freeRTOS API. I'm sure I misunderstand something big here but I'm not quite sure on how to fix it. |
Beta Was this translation helpful? Give feedback.
-
This usually means you haven't linked in the OS layer for your FreeRTOS port. You have to implement those functions. What we've been doing is keeping a set of sub-repos here with OS ports. You can create a sub-repo there and follow the pattern for the other ports. Then other people can take advantage of your work. From the thread, it looks like you were starting to write those adaptation classes. |
Beta Was this translation helpful? Give feedback.
-
Another quick question. For task creation function in FreeRTOS here, it requires the pointer to the task entry function |
Beta Was this translation helpful? Give feedback.
-
@rawinza555: The function signature for the
See the |
Beta Was this translation helpful? Give feedback.
-
So I tried to build the target again and these error messages shows up
It seems like I might have done something wrong with including the linker script |
Beta Was this translation helpful? Give feedback.
-
I managed to get everything compiled and get an executable. A few follow up questions.
|
Beta Was this translation helpful? Give feedback.
-
It's been a while. I was busy with other projects until now. I believe the problem is that I didn't include startup file into the cmake (Found this by accident. I had a separate project with stm32 using cmake and I forgot to add the startup file there and the exact thing happen). It make sense. The debugger shows the line of the code, the code compiled successfully and flashed but it doesn't even start and I can't even step over the code. Normally I have to add the startup file ( |
Beta Was this translation helpful? Give feedback.
-
Hi! This is Bill from the Melbourne Space Program. So we have been on a similar mission trying to get fprime running with FreeRTOS on a STM board. At this point, we are quite lost. And we as a student organization unfortunately don't have too much embedded dev experience. This thread stopped a year ago so I am wondering if there has been any further development. Also, some setup in rawinza's repo also seems outdated with the migration from xml to fpp... So I am hoping we could get some pointers from you guys. And it would be even better if you could help us take a look at our setup, which is on this branch of our fork. Thanks a lot in advance for your help! Also please let me know if you would like me to open a new thread for the discussion to avoid bloating this thread. |
Beta Was this translation helpful? Give feedback.
@rawinza555: The function signature for the
Os::Task::start()
call includes the task entry function:See the
taskRoutine
argument. You should be able to pass this to the FreeRTOS function.