cancel
Showing results for 
Search instead for 
Did you mean: 

Why does function FLASH_Program_DoubleWord causes a hardfault when executing __ISB()?

MSchr.1
Associate II

Controller is STM32G4CETx , Flash is configured to use dual bank mode.

I have checked the errate sheet issue 2.2.2 about problems with the data cache in this situation, but it is still not clear to me, why stepping over the __ISB instruction causes a hardfault.

3 REPLIES 3

Perhaps there is an alignment issue, or the debugger complicates the bus transaction.​

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

The problem also occurs when the debugger is not attached.

If it is related to an alignment issue, wouldn't the hardfault occur when the access is performed, instead of the ISB command that should delay until running transfers in the pipeline have been completed?

I have tried to fill in a dozen NOP commands prior to the ISB. While a breakpoint on the first NOP is always hit, a breakpoint on the last NOP is not reached any more, in those cases, when the hardfault occurs. So it seems, the ISB itself is not the reason.

But how can I find the cause of the hardfault? I have a few DMA transfers running, but these are byte wide, so alignment should not be a problem. I have also disabled all interrupts in the situation when the fault occurs. Do you have any ideas?

banana-sun
Associate

Have you solved it yet? I encountered the same problem when using stm32g0. Did you use any method?