cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX AzRtos Startup code Issue

matt-crc
Associate II

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

0 REPLIES 0