How to transform a project without RTOS into a project with Azure RTOS?
Hi all,
thank you very much for the valuable advices.
I am writing to you because I would like to understand how I can convert an existing program without Azure RTOS ThreadX with a program in which I use Azure RTOS ThreadX.
For example I would like to add Azure RTOS ThreadX on an existing program that reads a series of values with GPIO, ADC, or by communicating with external components with SPI and I2C and sets digital signals with PWM and GPIO. It also communicates via the serial port with another board.
What should I do with CubeMX?
Do I take the existing project and add ThreadX in the "Middleware" section and change the timebase source for "SYS" from SysTick to TIM6 in the "System Core" section?
Do I need to make further changes in CubeMX?
At the code level I will have to use Threads, but how can I structure the program?
Currently the commands arrive on the serial port through the interrupt and I insert them into the relevant buffer which is read by a function present in the while(1) of the main. The readings of some digital and analog signals are made every few milliseconds and to do this I use interrupts. I would like to understand how I can structure the program. How can I organize at file level, today almost all the code is in the main.c file and I would like to understand with what logic I create the threads and assign them to the various activities (GPI readings, ADC readings, reading from external components with SPI and I2C, management of the serial buffer and related responses, writes to memory, etc.).
Let me know what rules I should follow to structure the code well.
Thank you very much for the support.
