cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H562ZG: NMI Handler is called when FW is downloaded

MattiaB
Associate III

Hello everyone,

We are experiencing an issue with a product that integrates an STM32H562ZG microcontroller.

Our development environment consists of IAR Embedded Workbench 9.70.1, with the project configured using CMake.

Currently, we are observing unexpected behavior during debugging. Specifically, after downloading the firmware using IAR and ST-Link V2 and starting the debug session, the application immediately jumps to NMI_Handler().

Unfortunately, even after modifying the code, reflashing the microcontroller, and restarting the debug session, the firmware still ends up in NMI_Handler().

Performing a full chip erase and reprogramming with IAR resolves the issue,  it becomes inefficient and problematic for debugging because any time the code is modified a full chip erase is needed to make all work.

We have seen something related to ECC flash check but we don't know if can be a hint.

In our case ICACHE is not activeted (disable by default from CubeMX project). If you needs some other details, please do not hesitate to contact us.

Could someone please assist us in identifying the root cause or suggest a permanent solution?

Thank you in advance for your support.

2 REPLIES 2
gbm
Principal

This may happen if the Flash is incorrectly programmed. And incorrect programming may happen if the piece of software responsible for programming (the programming routine put in MCU's RAM by the programmer) has an error, like incorrect setting of Flash timing parameters. The result is: ECC error is detected during Flash read and NMI is invoked.

There is some mystery influencing H5 series Flash programming which I haven't solved yet - it is quite different from all STM32F, C, G and L series.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
MattiaB
Associate III

Thank you @gbm for the hint.

There is any way to avoid this problem?
Are we sure the problem depends on the ECC error?