ADC MQTT problem

I have 2 mains tasks:

  • ADCStoreData: I am using an ADC with DMA, with SCAN and CONTINOUS modes ENABLED. DMA continous requests is ENABLED also. I am saving 4 channels values in a buffer tmp[NBR_OF_CHANNELS][NBR_OF_SAMPLES].
  • MQTTSendData: I am getting the tmp buffer and then sending it to MQTT.

I got an hard_fault_IT()

I just got the first data of the first channel stored than the HARD_FAULT occurs.

This is MQTT send task, I am using a Semaphore.

Appreciate any help!

This the other images for the code

  1. Can you share the code that declares tmp, including the scope in which it is declared? If that buffer lives on a task’s stack, you might be experiencing stack overflow.

  2. Which signal handler is called right before the hardfault? There is more information available in the debugger about which interrupt occurred, but we cannot see it in the pictures. In fact, if you click on that entry in the call stack, , you might even see the point at which the hardfault occurred in the code window.

This page provides more information about debugging hard fault - Debugging and diagnosing hard faults on ARM Cortex-M CPUs.

Is it possible for you to share code as Jeff asked?