2020-05-28 07:26 PM
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 ;(
2020-05-28 07:32 PM
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?
2020-05-28 07:43 PM
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
2020-05-28 07:52 PM
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.
2020-05-28 08:04 PM
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
2020-05-28 08:07 PM
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.
2020-05-28 08:14 PM
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.
2020-05-29 06:45 PM
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.
2020-05-29 07:58 PM
> 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.
2020-06-01 01:10 PM
as you can see above i cant really change any of these settings without getting an error