I’m facing a crash (HardFault) into my project within pvPortMalloc/vPortFree functions.
heap_4 management, queues 16 in length, latest stable FreeRTOS Release.
Task#1 (Priority 2):
- addr = pvPortMalloc()
- Force ISR#1
- addr2 = pvPortMalloc()
- Force ISR#2
Task#2 (Priority 4):
- goto top
Some debug infos:
- No crash if code runs @ lower MCU speed (64MHz vs 180MHz, STM32F1 vs STM32F4)
- No crash removing vPortFree from Task#2
- No crash if vPortFree inside Task#2 is delayed after xQueueReceive (by printf, or by vTaskDelay, or other)
- configASSERT inside pvPortMalloc tells me that “blocks are NOT aligned to the required number of bytes”
- configASSERT inside vPortFree tells me that “block is NOT actually allocated”
- different priorities
- different ISR preemption priorities
What can I do? Any idea?