Look, asking for an RTOS on a chip with max. 32k flash and even worse max. 4k SRAM is not the obviousl thing to do. PSoC 5 has way more on-chip memory. PSoC 4 is highly memory constraint and I would strongly advice against any OS except for a small scheduler on this product family.
Looks like FreeRTOS can size into 4K ROM and 236 bytes RAM,
so quite feasable on PSOC 4.
MCU support listed at website -
- Supported processor families: PSoC 5 ARM Cortex-M3
- Supported tools: GCC, ARM Keil and RVDS - all in the PSoC Creator IDE
Maybe a port possible ?
Thanks for complementing:) answers. I'd remembered something and find the plentiful resource:
I write a RTOS for cortex-m0, such as psoc4.
It works very well in my product.
15 tasks (not include idle)
timer, semphore, flag, mutex, remote call service, critical section service.
4 levels priority, round robin schedule for each level.
no interrupt mask/disable for critical section. it uses SVC and PendSvc.
it just use 128 bytes ram or less if you want. The most usage of ram is stack ram for each task.
It is evry sufficien if it can use 1k byte ram.
In my product, it just occupis 300 bytes for 4 task, one for uart, on for I2C(LCD), one for service routin and one for idle task.
I recently finished the same! How did you overcome the bug in malloc() ? I had to write my own memory-manager.
T tried freertos.
3 tasks took 2600 bytes with minimal stack. So ram was too small for simple jobs.
elemnt14 shows example, which contains nothing except blinking leds.
And this is what Rtos can be used for on PSOC4.
I allocated stack of 100. I think it's 400 bytes, even if default freertos variable was char.
I this freertos use 32bit variables which cause hudge losses.
@bob, sorry, i don't use malloc. and i would like to disable heap created by creator ide.
is there an example for similar "mini-RTOS" as you made, or an explanation/guidelines how to make one yourself?
I'm working on a complicated project (many tasks, interfaces, end-points) based on PSOC 4, and having some kind of OS can make things easier...