Skip to main content
Associate III
Jul 4, 2024 11:16 PM UTC
Question

SMT32F103 Nucleo Hardfault

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
Jul 5, 2024 12:14 AM UTC

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

 osDelay(100);

Why would this cause a HardFault?

Fish
Associate II
Jul 5, 2024 2:51 AM UTC

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

Andrew Neil
Super User
Jul 5, 2024 8:20 AM UTC
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
Jul 6, 2024 11:22 PM UTC

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);