Skip to main content
KKIM.6
Senior
November 1, 2022
Solved

How can I program the microcontroller for multi-thread?

  • November 1, 2022
  • 3 replies
  • 2528 views

I want to disassemble the ADC function and BLE data transmission asynchronously.

So, I want to program the microcontroller using multi-thread.

When I coded BLE, It look already used multi-thread but I couldn't understand it exactly.

Is there any example of this?

    This topic has been closed for replies.
    Best answer by Ronan GABOU

    Hello,

    There is a MOOC for FreeRTOS on ST Youtube : https://www.youtube.com/playlist?list=PLnMKNibPkDnExrAsDpjjF1PsvtoAIBquX

    3 replies

    iSaeed62
    Associate
    November 1, 2022

    Hi @KKIM.6​ 

    Firstly, You need to implement an RTOS, then, for example, you can add your threads in the main.c file. Inside each thread, you can call a function. Each function should have a while(1) loop inside.

    Ronan GABOU
    ST Employee
    November 2, 2022

    Hello,

    You can use STM32CubeMX and select RTOS.

    For example for STM32 L4 you can select FreeRTOS and then you can add tasks thanks to CubeMX GUI and generate the project.

    KKIM.6
    KKIM.6Author
    Senior
    November 2, 2022

    Is there any official Youtube video to follow?

    Ronan GABOU
    Ronan GABOUBest answer
    ST Employee
    November 2, 2022

    Hello,

    There is a MOOC for FreeRTOS on ST Youtube : https://www.youtube.com/playlist?list=PLnMKNibPkDnExrAsDpjjF1PsvtoAIBquX

    KKIM.6
    KKIM.6Author
    Senior
    November 10, 2022

    Thanks for your reply. I'll check the videos!