Search code examples
zephyr-rtos

Clarification of the meaning of "App" in ZephyrOS


The Zephyr project comes with lots of "apps". The definition seems to me to be "App = your program + ZephyrOS"

The word "app" to me implies you could have many inside one binary, ie multitasking. I can see how you can just start a thread for each program you want to run, but in the zephyr lingo does this still count as as single "app"?

Should I develop every program I may want running as a thread as a library with some entrypoint function, and dispatch them from the main app? Or is there some way of combining multiple distinct apps into one image?


Solution

  • You are right, in Zephyr the term "app" generally refers to a single application or program that you build and run on top of the Zephyr RTOS. Typically, you'll have one "app" running on your embedded device, which includes your custom code, Zephyr OS, necessary device drivers, and libraries, all combined into a single firmware image that gets flashed onto the hardware. This approach isn't unique to Zephyr; it's common in embedded systems, where one primary application is built and deployed to the device — unlike general-purpose computers or platforms like the Raspberry Pi, where multiple applications can run concurrently.

    As for multitasking, yes in Zephyr lingo this is just "one app". This is similar to other embedded RTOSs (e.g. FreeRTOS) where there are multiple threads that get kicked off and managed within a single application. Similarly, in your case you probably want to build everything under one app and generate one binary that gets flashed into your device, even if it has multiple threads and contains multi-tasking.

    However there are exceptions to this. For example, if you are building for a target with multiple cores (e.g. the nRF5340 which has an application core and a network core), then you may need to build two apps, one for each core. This allows each processor to have its dedicated firmware, though they often work together through inter-processor communication or a shared memory.

    The links below have some good explanation on this subject:-