Skip to main content
Graduate II
July 4, 2024
Question

SMT32F103 Nucleo Hardfault

  • July 4, 2024
  • 2 replies
  • 1263 views

I'm running a GPS application based on @Tesla DeLorean application that he kindly shared here:

https://github.com/cturvey/RandomNinjaChef/blob/main/f746g_disco_gps.c 

I'm now encountering a HardFault 

Screenshot 2024-07-05 083757.jpg

When I step into the function to load the register value I get the following:

Screenshot 2024-07-05 083924.jpg

It appears to be a problem adding an entry to a queue.

My initial thought is that when I'm processing the NEMA sentences one of more of the entries in the string are NULL.

 

 

int size = sprintf(&Buffer,"{\"src_addr\":\"%s\",\"PDOP\":%5.2f,\"HDOP\":%5.2f,\"VDOP\":%.2f,\"Volts\":%.2f}\n","Node1", pdop, hdop, vdop,Volts);

 

 

I've spent a fair bit of time looking for an easy way to understand what is going on but so far nothing useful.

    This topic has been closed for replies.

    2 replies

    JorgieAuthor
    Graduate II
    July 5, 2024

    The problem would appear to be related to a call to:

     osDelay(100);

    Why would this cause a HardFault?

    Visitor II
    July 5, 2024

    it seems to be rack of thread stack size. increase the thread stack size more. then test it

    Super User
    July 5, 2024
    JorgieAuthor
    Graduate II
    July 6, 2024

    Thanks Andrew, very much appreciated I will use that next time I get a hardfault.

    I believe that i may have solved my issue by changing osDelay to Hal_Delay

     osDelay(100);

    to

     HAL_Delay(50);