Skip to main content
Associate II
November 3, 2023
Solved

how to switch to other task's context

  • November 3, 2023
  • 3 replies
  • 1669 views

I am using STM32CubeIDE to develop a product with STM32H7 chip. I enabled freeRTOS in our software system. When I debug code, I can see freeRTOS tasks in "FreeRTOS Task list window" and I am in current task context. How can I switch to other task's context for debug?

    This topic has been closed for replies.
    Best answer by FBL

    Hello @HarryXia 

     

    Here is an introduction STM32Cube tools in practice - STM32CubeIDE - FreeRTOS aware debug - YouTube.
    In order to use debug feature for debug, it is necessary to activate few options within FreeRTOS configuration, configure a timer or use DWT to count ticks for CPU time usage by tasks.

     

    3 replies

    FBLBest answer
    ST Technical Moderator
    November 6, 2023

    Hello @HarryXia 

     

    Here is an introduction STM32Cube tools in practice - STM32CubeIDE - FreeRTOS aware debug - YouTube.
    In order to use debug feature for debug, it is necessary to activate few options within FreeRTOS configuration, configure a timer or use DWT to count ticks for CPU time usage by tasks.

     

    To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
    HarryXiaAuthor
    Associate II
    November 8, 2023

    Thanks @FBL 

    I watched the introduction link and found that I forgot to enable RTOS proxy. After I enable RTOS proxy, I can see all freeRTOS threads and can switch and see all threads context.

    Piranha
    Principal III
    November 7, 2023

    There is a secret revolutionary method - setting a breakpoint and running the code!