Skip to main content
Associate III
July 4, 2024
Question

SMT32F103 Nucleo Hardfault

  • July 4, 2024
  • 4 replies
  • 2286 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.

4 replies

JorgieAuthor
Associate III
July 5, 2024

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

 osDelay(100);

Why would this cause a HardFault?

Fish
Associate II
July 5, 2024

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

Andrew Neil
Super User
July 5, 2024
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
JorgieAuthor
Associate III
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);