Skip to main content
MEdgerton
Associate III
July 28, 2021
Question

H7xx H743 EEPROM Emulation and load to SRAM on boot by linker

  • July 28, 2021
  • 2 replies
  • 2247 views

Is there example code for EEPROM Emulation of the H7 series? I can only find it for older STM32 devices and it states that other devices should use different code.

If not can anyone confirm the smallest sector of the internal Flash that can be used? Is it 128K, so if I adapt the old examples I would need 256K as it uses 2 sectors/pages.

Any pointers welcome!

Also is there a way in the linker to have this loaded into RAM at boot, as some things like this can be if setup correctly. Thanks!

This topic has been closed for replies.

2 replies

Pavel A.
Super User
July 28, 2021

> smallest sector of the internal Flash that can be used? Is it 128K

Yes, 128 K. And granularity of writes is 32 bytes.

> Also is there a way in the linker to have this loaded into RAM at boot

To have loaded what? code or data?

Note that H7 series has 4K of battery backed RAM which can store stuff if you have a battery. And the RTC user registers (32*4 bytes).

-- pa

MEdgerton
MEdgertonAuthor
Associate III
July 28, 2021

@Pavel A.​ Thank you for that info. I assume then the minimum being 32bytes means the examples by ST for the F series wont work?

The SRAM is useful but I need FLASH as its more permament.

Do you know of any example code?

Pavel A.
Super User
July 28, 2021

>  I assume then the minimum being 32bytes means the examples by ST for the F series wont work?

Correct. F series examples need adjustment.

> Do you know of any example code?

I did something of this sort but updating the whole blob of my data, not by separate variables, as in their "eeprom" examples.

It's better to get a real EEPROM or EERAM chip. Less PITA, less software complexity, more focus on your own product.

--pa

MEdgerton
MEdgertonAuthor
Associate III
July 28, 2021

@Pavel A.​  Thanks. I think writing as a whole blob at the end will be the best solution.

The problem was storing information such as checksums about the program for a bootloader to check. I want it permantently stored at a set place when it is written so it can be checked at startup.

Perhaps thats where I should have started as a question, but if there was a ready to go library or easily changed one that would have been the already tested and best route.

As you said the SRAM has an area which is backed up - I intend to use this to move some settings to and from the bootloader and main app but only at startup.

I noticed this battery backed up SRAM 4K does not show by default in the linker of STM32CubeIDE generated code for the H743 - or have I missed something?

Off topic to my original question but maybe relivant as it is semi-non-volatile, or at least persistant memory.

Other than that the RAM mapping of the H743 is somewhat fragmented so allocating another area for this other requirement needs careful checking whcih I may have to use if the 4K is not enough - the main app also needs a lot of it. If there is a recommended area to share that is best or you have found to be prefered it would help save time, and be greatly appriciated.

Otherwise I will configure the ethernet, MPU ICache, DCache and see the best area left - it has to work for both the main app and bootloader so a lot of cross-checking.

And thank you for making this a very useful community. I do try and search posts first, but sometimes it is a matter of finding the right keywords.