Skip to main content
YEnom.1
Visitor II
February 11, 2022
Question

STM32L4R9_How to not erase NOR memory at program start

  • February 11, 2022
  • 2 replies
  • 823 views

Based on the sample software of FMC_NOR, I am creating a program to store the data received by UART in NOR memory.

Operation content:

(1) Data reception via UART

(2) Write the received data to NOR memory

(3) Use the reset switch to switch to the reception standby state again and erase the NOR memory.

I want to erase the NOR memory only in (3), but the NOR memory is also erased when the program is executed.

How can I branch between program execution and the reset switch?

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
February 11, 2022

What do you mean by "reset switch"?

A common practice is to use a communication protocol over USART, which enables to erase an attached memory upon command from PC.

JW

Tesla DeLorean
Guru
February 11, 2022

This is a logic problem with code you're not showing.

The STM32L4​ isn't going to erase external NOR flash, or internal flash, without some explicit coding to do so on your part. Show the code that determines an erase should be done.

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