Skip to main content
Visitor II
April 27, 2024
Solved

'Nucleo-F401fb + stm32CubeMX + iar ewarm' can not run azure RTOS

  • April 27, 2024
  • 1 reply
  • 844 views

"I successfully ran a simple Azure RTOS task using nucleo-f429zi, stm32cubemx, and iar ewarm 9.30. However, when I apply the same method to nucleo-f401re, it gets stuck in the tx_thread_sleep function. It seems that the OS Tick interrupt might not be occurring properly. Therefore, I have the following questions:

  1. Why is it possible to use Azure RTOS easily with stm32CubeMX on Nucleo-F429ZI, but not on Nucleo-F401RE?
  2. What could be the cause of this issue, and how can it be resolved?"

Thanks in advance.

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

    Hi, Kaouthar

    I've resolved the issue. The problem was due to the NVIC's "Priority Group" being set to "0 bits for pre-emption priority, 4 bits for sub priority". After changing the setting to "4 bits for pre-emption priority, 0 bits for sub priority", everything started working properly.

    On Nucleo-F429ZI, when adding Azure RTOS, CubeMX correctly sets it to "4 bits for pre-emption priority, 0 bits for sub priority". However, on Nucleo-F401RE, when Azure RTOS is added, it defaults to "0 bits for pre-emption priority, 4 bits for sub priority", and I'm not sure why.

     

    Thank you for your willingness to help.

    zoro

    1 reply

    Technical Moderator
    May 8, 2024

    Hello @zoro and welcome to the community :),

    Could you please precise which STM32CubeMx version are you using?

    You can use X-CUBE-AZRTOS-F4 using STM32CubeMX 6.11.1 and Nucleo-F401RE as shown in the below figure.

    KDJEM1_0-1715183987630.png

    Could you please take a look at this FAQ may help you How to export a project configuration to a compati... - STMicroelectronics Community

     

    Thank you.

    Kaouthar

    zoroAuthorAnswer
    Visitor II
    May 9, 2024

    Hi, Kaouthar

    I've resolved the issue. The problem was due to the NVIC's "Priority Group" being set to "0 bits for pre-emption priority, 4 bits for sub priority". After changing the setting to "4 bits for pre-emption priority, 0 bits for sub priority", everything started working properly.

    On Nucleo-F429ZI, when adding Azure RTOS, CubeMX correctly sets it to "4 bits for pre-emption priority, 0 bits for sub priority". However, on Nucleo-F401RE, when Azure RTOS is added, it defaults to "0 bits for pre-emption priority, 4 bits for sub priority", and I'm not sure why.

     

    Thank you for your willingness to help.

    zoro