2023-12-27 02:59 AM
Hi everyone,
I'm using System Workbench for STM32 with STM32CubeMX because the project is a little bit old, and I can't migrate to STM32CubeIDE. I have a problem with Stack Overflow, so I decided to turn on an option in RTOS:
- GENERATE_RUN_TIME_STATUS
- USE_TRACE_FACILITY
- USE_STATES_FORMATTING_FUNCTIONS
When I turn on this option, I can check the status of my devices, task memory, and WaterMark. However, the devices only work for about 1 minute and then freeze. When I turn off this option, the devices work fine for a longer time.
I found that the problem lies in allocating memory to new Mail between tasks.
I have an overflow in this struct:
typedef struct os_pool_cb {
void *pool;
uint8_t *markers;
uint32_t pool_sz;
uint32_t item_sz;
uint32_t currentIndex;
} os_pool_cb_t;
Do you have any idea how to find the problem? I've increased the heap size and the stack size, but the problem still persists. Currently,
I have 20KB of free available memory.
I'm using CMISS-RTOS 1.02,