Skip to main content
matt-crc
Senior III
February 23, 2025
Question

CubeMX AzRtos Startup code Issue

  • February 23, 2025
  • 3 replies
  • 719 views

Hello,

Is it possible for ST to re-order the startup code in ST's implementation of AzRtos (CubeMX)?.  I think it would make everyone's life a lot easier if all the AzRtos services (ThreadX, FileX, NetX, USBX) start before the user apps/threads.

Currently, in the file: app_azure_rtos.c, the process is:

  1. create TX memory pool
  2. Start User threads (app_threadx.c)
  3. create FX memory pool
  4. Start MX_FileX_Init()
  5. create NetX memory pool
  6. Start MX_NetXDuo_Init()
  7. create USBX memory pool
  8. Start MX_USBX_Host_Init()
  9. Start MX_USBX_Device Init()

The problem is that user threads are started before the necessary system services are available.

I think it was done this way to simplify how CubeMX generates the code (where the user threads are grouped with ThreadX).  In my opinion it makes more sense to move "step 2" after the USB services are up and running.  In my opinion it should be as follows:

  1. create TX memory pool
  2. create FX memory pool
  3. Start MX_FileX_Init()
  4. create NetX memory pool
  5. Start MX_NetXDuo_Init()
  6. create USBX memory pool
  7. Start MX_USBX_Host_Init()
  8. Start MX_USBX_Device Init()
  9. Start User threads (app_threadx.c)

Maybe I'm missing something, but how did ST engineers want end-users to start 5-6 user tasks that use all system resources? I can re-order the sequence myself, but then that means I get rid of CubeMX, or is there a better way?

thanks

Matthew

3 replies

User_bug13
Associate II
March 30, 2025

Can't answer you question as I am new to theadx. I am just curious what MCU do you use? I don't seem to have option to enable threadx for F4/F7/H7. 

 

https://community.st.com/t5/stm32cubemx-mcus/threadx-support-missing-for-f4-and-f7/td-p/788408

matt-crc
matt-crcAuthor
Senior III
March 30, 2025

H743

User_bug13
Associate II
March 30, 2025

Interesting, I don't have threadx option for H743...

User_bug13_0-1743377295416.png

 

matt-crc
matt-crcAuthor
Senior III
March 30, 2025

you have to install the software pack first by clicking on "Software packs"

mattcrc_0-1743378027067.png

the select the options you want under azrtos

mattcrc_1-1743378065780.png

 

 

User_bug13
Associate II
March 31, 2025

Ah, thanks a lot! You saved me a lot of time. Appreciated!