cancel
Showing results for 
Search instead for 
Did you mean: 

I'm falling in a hardfault with the STM32F405VG during a ST routine "HAL_SPI_Transmit". Can you help me please ?

GLE B.1
Associate II

Hi everyone,

First, my program was running good since many weeks and last week I added some code and from this day, each run of my program, i'm falling in hardfault handler... all the time in "HAL_SPI_Transmit".

First thing i've done is to increase (some times very big size) the heap & stack size, unfortunately it doesn't work.. I still fall in hardfault at the same location in my program.

My code is using the ST routine "HAL_SPI_Transmit" many times but it always run down at the same location in this ST routine.. (picture 1 & 2) (btw each times the routine is used to access a flash memory 1 Mbit SPI Serial Flash SST25VF010A).

So, I've investigate on the issue and I found that was a "bus fault" "PRECISERR" and "FORCED" (picture 3, 4 & 5).

I do some research on internet to find out the response to my issue and in found some one talking about error in SPI ST files so i tried to copy the new files (they were different than mine) but it doesn't work..

Picture 1 :

0693W000003BaozQAC.png

Picture 2 :0693W000003Bau4QAC.png

Picture 3 :

0693W000003BavqQAC.png

Picture 4 :

0693W000003BawKQAS.png

Picture 5 :

0693W000003Bax3QAC.png

Picture 6 :

0693W000003BaxXQAS.png

Is this a known issue ?

Can you help me ? If you have some ask i'm here ?

Thanks,

GOULWEN LE BOZEC,

Regards.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Check that the hspi object you're passing is valid. Could be an overrun corrupting it.

> each times the routine is used to access a flash memory 1 Mbit SPI Serial Flash SST25VF010A

Can you access this memory outside of the HAL_SPI_Transmit function okay?

Show the code you're using to call HAL_SPI_Transmit.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

Check that the hspi object you're passing is valid. Could be an overrun corrupting it.

> each times the routine is used to access a flash memory 1 Mbit SPI Serial Flash SST25VF010A

Can you access this memory outside of the HAL_SPI_Transmit function okay?

Show the code you're using to call HAL_SPI_Transmit.

If you feel a post has answered your question, please click "Accept as Solution".
GLE B.1
Associate II

> Check that the hspi object you're passing is valid. Could be an overrun corrupting it.

I guess i found my issue !! you were right @TDK​ !

I was trying to put an array of 1000bytes (not always full but enough to corrupting it) in an array of 128bytes.

The @ of the hspi object was close to the little array so it corrupting it when there was an overflow!!

Thanks for you fast help @TDK​.