cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32G4 Massive Flash Problems

TFasc.1
Associate II

I´m currently working on an Application using the "new" G431 µC. At first i had massive Problems getting it to not crash (Several Hardfaults occuring here) randomly after ~100 instructions (not timing related...). After a while my good friend the readout protection showed up again and tried to see how my problem solving skills developed since our last meeting. This time i had to surrender, ive tried almost any setting i can imagine off (using st link utility) but everything it says that there are some settings invalid but doesnt let me change them either. Maybe some off you can give me some hints whats going on here, if this struggle continues this way im forced to switch to an other mcu i can count at ;(

18 REPLIES 18
TDK
Guru

I can assure you there is nothing random about hardfaults in 99.9% of cases.

> After a while my good friend the readout protection showed up again

What exactly is the problem you're having?

> but everything it says that there are some settings invalid but doesnt let me change them either

What is it saying? What settings are you trying to change?

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

i know that hardfaults have a reason and maybe they are hidden by something different i dont know atm.

I try to set some option bits according to the windows that told me i cant erase the flash with current rdp settings but wont hit my the apply button without a new error

TDK
Guru

If you're in RDP level 2, you can't change it. Ever.

If you're in RDP level 1, set PCROP_RDP to 1 and apply before moving to level 0.

0693W000001pfs0QAA.png

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

Yes you are completely right, this is the way i proceeded the first time ive encountered this Problem. Now it says its in rdp Level 0 but doesnt let me modify the Flash nor its settings. The other Tab in the Utility says something different where the rdp is set for Flash Bank 1, setting the PCROP_RDP flag isnt Posible because its says that the rdp Level cant be reduced to Level 0

Perhaps leave the option bytes alone until you've nailed down the stability issues.

Check the wait states on the flash and any prefetch​ settings.

Instrument the Hard Fault Handler ​so you can better scope the failure.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Waitstates are checked and correct, prefetch settings and cache are Turned off for Debug purposes. The hard fault Handler sometimes occurs on branch Instructions sometimes on simple load Instructions, the thing is that they dont Do something illegal in all of the cases. Nonetheless atm i cant Program my device anymore because of the rdp settings so that has to be addressed first.

TFasc.1
Associate II

Do the guys out there have any idea how i can recover my device from this kind of soft brick. clive was right, the option bytes arent the real issue but i cant debug it without any access to the mcu.

TDK
Guru

> Now it says its in rdp Level 0 but doesnt let me modify the Flash nor its settings

> because its says that the rdp Level cant be reduced to Level 0

So it both says it's in level 0 and that it can't be reduced to level 0? Perhaps a better description of what's happening, or a screenshot of the configuration and errors you're getting.

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

0693W000001pocBQAQ.png0693W000001poc6QAA.png0693W000001poc1QAA.png

as you can see above i cant really change any of these settings without getting an error