Skip to main content
Associate
September 16, 2026
Question

Steps for Using EDATA as extended flash in STM32-C562RE

  • September 16, 2026
  • 1 reply
  • 48 views

How to use EDATA as extended flash in STM32-C562RE?
I disabled the EDATA_EN
Verified CubeProgrammer can read 0x08400000
Created a project from MX2
Added EDATA_CODE (rx) in stm32c562xe_flash.ld in memory block as EDATA_CODE (rx)  : org = 0x08400000, len = 0x10000
Added the following section:
           .edata_code :
            {
                    . = ALIGN(16);
                    KEEP(*(.edata_code))
                   KEEP(*(.edata_code.*))
                    . = ALIGN(16);
            } > EDATA_CODE
Added the simple EDATA_Add() function in main:
__attribute__((section(".edata_code")))
            __attribute__((noinline))
            uint32_t EDATA_Add(uint32_t a, uint32_t b)
            {
                    return a + b;
            }
Called it once from main()
Build it and build was successfull

Before flashing, check the .map lines containing .edata_code and EDATA_Add and foundsomething similar to:
            .edata_code    0x08400000 ...
                                 0x08400000 EDATA_Add

Now, when I am going to flash through cubeprogrammer or cbeIDE, it is not writing to the address 0x08400000 and cubeprogrammer is giving an error 

1 reply

Amine_Jridi
ST Technical Moderator
September 22, 2026

Hello ​@Vishalpandey,

I was able to reproduce the issue on my side. A ticket has been logged to the development team for further investigation. (Internal Ticket number: CDM0065943).

As a workaround if you want to use the EDATA section you can enable the EDATA_EN option byte and link it to 0x09000000 instead of 0x08400000: 

> EDATA_CODE (rx)  : org = 0x09000000, len = 0x10000

 

Thanks,

Amine.

In order 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.