Running FreeRTOS on CM0+

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NiBu_4687336
Level 5
Level 5
5 solutions authored 50 replies posted 25 replies posted

Hi.

The most recent discussion on this topic dates back to 2018. At that point, Cypress did not support running FreeRTOS on the PSoC 6's CM0+ core.

First - has that position changed? Is there any official support for FreeRTOS on the CM0+?

Second - has anyone done this, especially using ModusToolbox? If so, would  you please share your experience here?

A side issue is that the procedure for developing dual-CPU applications using ModusToolbox omits the FreeRTOS include directories from the compiler command line. The obvious brute-force workaround would be to add them in the CM0+ Makefile. Is there a better way?

There is a CM0 port of FreeRTOS available directly from FreeRTOS - download the FreeRTOS distro, then look in

<distro root>/FreeRTOS/Source/portable/<compiler>/ARM_CM0

The port is not specific to the PSoC 6, of course, and I'm unclear exactly what, if anything, needs to be changed.

For background, we plan to run FreeRTOS on both PSoC 6 cores. The CM0+ will handle data acquisition code (external multi-channel SPI ADC via DMA), and lightweight feature detection. The CM4 will be called into action for heavyweight processing when a feature is detected.

Thanks,

-Nick

0 Likes
1 Solution

To update this thread on my experience, once I switched to ModusToolbox 2.2, I found that the "stock" FreeRTOS CM0 port worked without significant changes. Use the FreeRTOS-Kernel repository to avoid all the demo and "plus" code. You'll still have to prune all the unused compilers (i.e. everything except GCC) from the "portable" directory, and then the unused processors (i.e. everything except ARM_CM0) from the GCC compiler directory, or ModusToolbox will try to compile them all. You can either prune the unused heap_N.c files, or modify them as Cypress did so that only the selected version compiles.

I should note that there are no differences between the CM0 and CM0+ processors that affect the code they run, so there is no port specifically targeting the CM0+.

Be prepared to fiddle with the Makefile a bit. Beware that the Makefile may have a hard-coded starting address for the CM4 code, which will step on any value in the linker script. You should be able simply to delete that definition from the Makefile. The "make" facility is rather byzantine, and not well documented, so be prepared for some head-scratching and experimentation.

The document that is intended to explain dual-core programming (PSoC 6 MCU Dual-CPU System Design) is a bit thin, and does not entirely match the configuration used in the example I chose to work with, the mtb-example-psoc6-dual-cpu-ipc-pipes project. Also, ModusToolbox doesn't play particularly nicely with the basic setup either, as most of the magic is placed where Eclipse CDT's code navigation can't find it. A good text search tool (e.g. find + grep) will come in handy be required.

Have fun!

-Nick

View solution in original post

0 Likes
16 Replies