Hardfault when execute xTaskResumeAll in tmr svc

Hi @aggarg @RAc ,

Added some debug info,


xTaskRemoveFromEventList->listINSERT_END( &( xPendingReadyList ), &( pxUnblockedTCB->xEventListItem ) );
Don’t know why pxUnblockedTCB->xEventListItem.pvContainer is NULL after insert xEventListItem to pending list?

This looks like an ARM, so what you can do is set a DWT trace point to break into the debugger when the memory location of .pvContainer is set to 0.

To me it looks as if your ISR (startup) stack might be too small, please try increasing it in the linker command file.

Edit: The Lauterbach debugger should provide the functionality to define the DWT bp; if not and this is an M3,M4 or M7 core you can add the following code:

((unsigned long *)0xe0001050) = (unsigned long)&xxx; // location of the variable
((unsigned long *)0xe0001030) = 0x0; // value to cause the break
((unsigned long *)0xe0001038) = 0x3b06; // 32 bit write access linking to the comparator

anytime soon after the offending location is known.

Hi @RAc,

Okay, let me try to increase the main stack size. thanks.

Hi @RAc,

After increasing the stack from 0x400 to 0x800,
it also can be reproduced after 1 hours. Any suggestions?

Again, try to locate the point of time where your memory location is set to 0. The fault you see may occur much later after the root cause.

Since your fault occurrs without involvement of any application API calls, it can really only be a misconfiguration. What is your target MCU/ board/platform? Have you made any changes to the port?

  1. The MCU is cortex-M33.
  2. Not make any changes to the port.
  3. Maybe dma write the address(xEventListItem.pvContainer) to 0?

Can we see some real life code? How do you create the queue that your dma isr posts to?

There is no defined way in FreeRTOS to DMA “into” a Queue. The Queue is an opaque object that keeps track of its contents, and “user” code shouldn’t try to manipulate it, and isn’t given definitions to even do it in a reasonable manner. The best you can do is DMA into a defined buffer outside the queue and either copy that buffer into the queue with xQueueSendToBack-s or send the address of the buffer (and then use a different buffer if you need to start a second DMA before done processing).