Integrating bare-metal code with RTOS task

Hello, I am new to FreeRTOS, and have some question with respect to integrating FreeRTOS tasks with bare-metal program. I have application where i would like to acquire data from sensor outside freeRtos everytime interrupt occurs from hardware.
1) Is it possible to switch between FreeRTos task and bare-metal application based on interrupt frequency once scheduler is started ? 2) If so, then can i populate queues and give semaphore when the required amount of data is collected in bare metal code to wake up a task to process acquired data ? Any suggestion is much appreciated, Regards Query1920

Integrating bare-metal code with RTOS task

My first comment is that it is sort of logically impossible to switch from a ‘FreeRTOS Task’ to a ‘bare-metal application’ without something like a virtual machine, as genearlly bare-metal means the application is running with any form of OS in memory. What can be done is take a bare-metal application and make it into a task that runs under FreeRTOS, even if that task doesn’t particularly act like a typical tasks (using spin-waits for I/O and such). That bare-metalish task can use FreeRTOS operations to communicate with other tasks if it wants. FreeRTOS, being basically a type of micro-kernal doesn’t particularly limit what your tasks and interrupts can do, it only provides rules for how tasks and interrupts need to interact with FreeRTOS, if they want to interract with it. This means that it isn’t very hard to convert a bare-metal application and make it a simple task, and then over time, if desired, clean up parts to make things more like a ‘normal’ task in an incremental fashion.

Integrating bare-metal code with RTOS task

Thanks for the feedback .

Integrating bare-metal code with RTOS task

Thanks for the feedback .