Skip to main content
Louie88
Senior
March 4, 2026
Question

How to backup/restore value of variables in STM32N6570-DK board

  • March 4, 2026
  • 1 reply
  • 268 views

Hello,

I have some setup variables in my app which should retained while the power is switched off. Normally I would use the dedicated Backup RAM, but the board does not have backup battery, battery socket, not a battery connector. The Backup RAM is not usable with STM32n6570-DK board.

The MCU does not have internal flash memory with backup area. (This worked with H747 and H723 MCUs) The board has an external 1Mbit flash memory controlled by OCTOSPI so I might store data in the external flash. I need max 512 bytes only. This 512-byte backup should be placed to the end of the external flash.

Can anybody advice how to do this?

Best regards,

Louis

 

1 reply

TDK
Super User
March 5, 2026

What are you looking for in particular? This is not a code writing service.

Erase the page of flash, write new values. Re-read it on startup. If power shuts off during writing, the data can be corrupted so sometimes two pages are used.

See the EEPROM emulation library for ST's solution for this. It's not set up for the N6 as it doesn't have internal flash, but it could be adapted.

How to use EEPROM emulation on STM32 MCUs - Application note

"If you feel a post has answered your question, please click ""Accept as Solution""."
Louie88
Louie88Author
Senior
March 5, 2026

Just for sure. I already solved flash based back/restore settings in H747I-DISCO, H723-Nucleo and U5-DK2 boards. All of these had internal flash memory. The N6 has external flash (128MB) only controlled via XSPI and I have never used Octo SPI, I do not know how to initialize it, even I am not sure whether it has Memory Mapped mode. I thought I ask it from the community. It was not a good decision.

Andrew Neil
Super User
March 5, 2026

So your real question is, "how to write to XSPI Flash?", then ?

 

PS:

Does this Knowledge Base article help: Overall FAQs for QUADSPI/OCTOSPI/HSPI/XSPI ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.