cancel
Showing results for 
Search instead for 
Did you mean: 

Does STM32H56xx 1MB device has extra memory for high-cycle data?

Snaku
Associate III

Hi,

I have this question because the reference manual states:
When flash high-cycle data area on Bank1 is enabled, the code memory map is not continuous from Bank1 to Bank2 on 2M- and 512K-byte devices.


So, does this mean that enabling high-cycle data sectors as EDATA on a 1MB device does not affect the code memory space, while on 2MB and 512KB devices, some sectors are reassigned for EDATA usage? If that’s the case, it seems like the 1MB device effectively has an extra 96KB of high-cycle data memory.

Snaku

1 ACCEPTED SOLUTION

Accepted Solutions
mƎALLEm
ST Employee

Hello,

Enabling EDATA on 1MB, 2MB, and 512KB devices always reduces the available code memory, as the high-cycle data area is mapped to the last sectors of the flash.
The 1MB device does not gain "extra" high-cycle data memory; the 96KB is part of the existing flash, not additional.

When you enable the high-cycle data area (EDATA) on a 1MB STM32 device, the code memory map becomes non-continuous between Bank1 and Bank2. The high-cycle data area is mapped to the last sectors of Bank1 and Bank2, which reduces the available code memory. The 96KB high-cycle data memory is not an "extra", it is part of the existing flash memory that is repurposed for high-cycle data storage when EDATA is enabled. This behavior is consistent with 2MB and 512KB devices.

From the RM0481:

mALLEm_1-1761053715292.png

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
mƎALLEm
ST Employee

Hello,

Enabling EDATA on 1MB, 2MB, and 512KB devices always reduces the available code memory, as the high-cycle data area is mapped to the last sectors of the flash.
The 1MB device does not gain "extra" high-cycle data memory; the 96KB is part of the existing flash, not additional.

When you enable the high-cycle data area (EDATA) on a 1MB STM32 device, the code memory map becomes non-continuous between Bank1 and Bank2. The high-cycle data area is mapped to the last sectors of Bank1 and Bank2, which reduces the available code memory. The 96KB high-cycle data memory is not an "extra", it is part of the existing flash memory that is repurposed for high-cycle data storage when EDATA is enabled. This behavior is consistent with 2MB and 512KB devices.

From the RM0481:

mALLEm_1-1761053715292.png

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi mƎALLEm,

Thanks for your reply.
Base on your description, if I set the EDATA1_EN = 1, and DEATA1_START = 0 on a 1MB device, then the sector 63 will be map to sector 127, so the code memory space become discontinue because the sector 63 is not avaiable. Is my understanding correct?

 

Snaku_0-1761095880938.png

 

Hello @mƎALLEm , 

I do currently use a 1 MB variant of the STM32H563 for a project with the EDATA enabled on both banks (8 sectors, 96 KB). I was trying to establish a memory map of what was used and got the same question as @Snaku . 

I did some testing and it really seams like the EDATA is using flash memory that is not part of the 1 MB user flash. 

Normally, I would assume that my EDATA configuration would use sectors 56 to 63 on both banks. 

Here are some tests I did and the results:

  • Enabled EDATA, wrote some data, erased sectors 56 to 63 -> Data is still there when I read back
  • Wrote some data in EDATA, deactivated EDATA, read back the whole user flash -> Can't see my data in any flash sector. 
  • Wrote some data in EDATA, erased sectors 120 to 127 (that shouldn't exist on this chip) -> Data has been erased.
  • Forced the linker to put constants in sectors 56 to 63 that I should not have access while the EDATA is active -> Constants are successfully programmed

It almost looks like there is actually 2 MB of flash in the chip but only 1 MB can actually be used as user flash and the EDATA is the only thing that can access the sectors 120-127.

Maybe there is something that I don't get. Could you confirm this? I believe we still have 1 MB of user flash still available either the EDATA is active or not but the documentation is unclear about this.