using txm_module_manager_memory_load to load Module in ThreadX

Viewed 29

I am trying to load 2 modules differently:
Module_1 using txm_module_manager_memory_load
Module_2 using txm_module_manager_in_place_load

Results: Just after loading them and starting Module_1, it throws a UsageFault error (Module 2 didn't start yet), both modules share the same byte_pool created from txm_module_manager_initialize.
I could not catch the error since all APIs return TX_SUCCESS

Referring to the x-cube-azrtos-h7 TX-MPU example, what would change to app_threadX to load Module_1 properly?
Or is it about something to specify in link file STM32H7xx_FLASH.ld?

EDIT: the following is the latest threads status and "_txm_module_manager_memory_fault_info" value :

enter image description here enter image description here

1 Answers

ThreadX will allocate some memory from the byte pool created in txm_module_manager_initialize and copy Module_1 from wherever it is located into that allocated memory. I assume txm_module_manager_memory_load returns TX_SUCCESS, as does txm_module_manager_start when you start Module_1. Can you step through the scheduler and when it schedules a thread from Module_1 (the first thread it will schedule is the "Module Start Thread" that gets created in txm_module_manager_start), how far into the module execution does the usage fault occur?

Related