Skip to main content
Associate III
July 22, 2026
Question

is there any way to find somewhere in memory address information about how many bytes I have written to FLASH memory on STM32H55

  • July 22, 2026
  • 2 replies
  • 16 views

Hello ST community,


Is there a way to find information about how many bytes I've written to the flash memory of a certain memory area at some memory address (not starting at 0x0800000, but at 0x0802000)?

When I first power up, the byte counter is initialized to 0, and as I write bytes from address 0x0802000, I count the number of bytes, and at that point, I get the information about the number of bytes written.

But my goal is to know how many bytes I've previously written when I power cycle the STM32H7 MCU. Is there an option that counts the number of bytes written to the flash memory and automatically stores that information somewhere in the memory?

If so, which memory and at what address?

Thanks to anyone who can help me.
Regards

2 replies

Andrew Neil
Super User
July 22, 2026

Is there an option that counts the number of bytes written to the flash memory and automatically stores that information somewhere in the memory?

No - you would have to implement that yourself.

To survive a power cycle, you would need to store it in Flash (or some other non-volatile store).

 

Have you looked at X-CUBE-EEPROM ? It doesn’t seem to directly support H7, but you may be able to inspire from it…

 

PS:

As ​@mƎALLEm pointed out that the title says H5 - that is supported by X-CUBE-EEPROM.

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.
Domy_STAuthor
Associate III
July 22, 2026

hello ​@Andrew Neil,

ok thanks

mƎALLEm
ST Technical Moderator
July 22, 2026

Hello,

1- In the title you mentioned “STM32H55” no part number in ST MCU portfolio with this reference.

2- For power cycle you need to store that in either:

  • Back-up SRAM or Buck-up registers. In that case you need to add a battery on VBAT pin.
  • Or to store the value in non-volatile memory. In that case the internal flash or external EEPROM/FRAM (if you have one already).
To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.