Skip to main content
Associate II
April 14, 2026
Question

STM32L496 NRST pin doesn't work after writing to flash memory

  • April 14, 2026
  • 2 replies
  • 152 views

Hello,

I came across the following problem: whenever firmware writes some data to flash memory, the NRST pin doesn't work. I mean, when low level is asserted on NRST pin the device starts to run software not at 0x0800... address but at 0x1FFF.... The same happens in the debugger: when I press "Reset the chip..." button. I get the message: "Break at address "0x1fff5236" with no debug information available, or outside of program code."

The data is written to flash memory page which is  not used by the running program code. Data is correctly written and no error is shown in the FLASH->SR register. I didn't change any option bytes. The device runs at 80 MHz, BOOT0 pin is grounded. What am I doing wrong ?

2 replies

TDK
Super User
April 14, 2026

It's booting into the bootloader. The NRST pin is working fine.

Reasons for it entering the bootloader can be found in AN2606. The most common mistake is the BOOT0 pin is floating, but if that's correct, either option bits are set up to boot into it or the main flash was empty when the chip was powered up.

TDK_0-1776175194629.png

If this is the first time you're programming the chip, you will need to power cycle it to reset the "main flash memory empty" flag. Not just reset, but power cycle.

"If you feel a post has answered your question, please click ""Accept as Solution""."
kekonAuthor
Associate II
April 15, 2026

The option bytes are set as follows:

 

kekon_0-1776235588987.png

 

SMSAD.1
ST Employee
April 16, 2026

Hello kekon

 

Refer to the errata sheet ES0318 STM32L431xx/432xx/433xx/442xx/443xx device errata for details.
Your problem is described in section 2.2.11: F
LASH_ECCR corrupted upon reset or power‑down occurring during flash memory program or erase operation :


Description
Reset or power-down occurring during a flash memory location program or erase operation, followed by a read of
the same memory location, may lead to a corruption of the FLASH_ECCR register content.
Workaround
Under such condition, erase the page(s) corresponding to the flash memory location.

 

Br,

SMSAD.1

kekonAuthor
Associate II
April 16, 2026

Hello SMSAD.1

I read the errata sheet. There is no reset or power down occuring during flash write operation. The FLASH_ECCR register has a value of 0 directly after page erase and page write. The BOOT0 pin is grounded. It seems that the problem is caused by something else but I'm still unable to solve it.