cancel
Showing results for 
Search instead for 
Did you mean: 

Disable external flash programming

Hello dear engineers,

How can I instruct the STM32cubeIDE to neglect programming of the exteranl flash parts?

This parts have been placed in an external ram memory which is to be read and programmed in runtime.

In Keil ide, it simply says since no flashing algorithm for the specified parts is available, I will not take these sections into account for programming.

The _flash.ld file has been changed as follows.

/* Memories definition */
MEMORY
{
 CCMRAM  (xrw)  : ORIGIN = 0x10000000,  LENGTH = 64K
 RAM  (xrw)  : ORIGIN = 0x20000000,  LENGTH = 192K
 FLASH  (rx)  : ORIGIN = 0x8000000,  LENGTH = 1024K
 ExtFlashSection (xrw)  : ORIGIN = 0xC00F0000,  LENGTH = 0x1f10000  
}

Any help would be appreciated.

14 REPLIES 14
Radosław
Senior II

Mark sections located in extflash as noload.

   .section (NOLOAD) :

   {

       .....

   } > ExtFlashSection AT > ExtFlashSection

Which file should I add that, to the RAM or the Flash?

And then, I have this post build script, they have conflict

arm-none-eabi-objcopy.exe --dump-section ExtFlashSection=images.bin tester.elf

Radosław
Senior II

i answered to your question, but now you need to specify much more, when you wanna have something loaded from flash to ram on start up, then

   .section (NOLOAD) :

   {

       .....

   } > RAM AT > FLASH, and in *.ld but also this requires modify startup file.

I sincerly appreciate your help. I have some image code from Touchgfx, I have supposed to load them from sd card to external RAM since the image size is larger than microcontroller built in flash memory. I want to have the data to be in one single file and the order of files has been managed by the IDE. The above post build script export the mentioned data from the specified sectoin. Now I have to tell the programmer (Jlink or stlink) to skip these parts. So they are neither implemented in internal ram nor internal flash.

Radosław
Senior II

--set-section-flags for this section, noload flag is what you wanna. in objcopy tool.

but you also can try if dum will work correcly for noload sections.

Dear @Rados?aw​ 

Thank you for your participation.

Now I have changed *.ld linker file as follows.

MEMORY
{
  CCMRAM    (xrw)    : ORIGIN = 0x10000000,   LENGTH = 64K
  RAM    (xrw)    : ORIGIN = 0x20000000,   LENGTH = 192K
  ExtRAM (xrw)    : ORIGIN = 0xC00F0000,   LENGTH = 0x1f10000    
  FLASH    (rx)    : ORIGIN = 0x8000000,   LENGTH = 1024K
}

And next part,

  ExtFlashSection (NOLOAD):
  {
    *(ExtFlashSection ExtFlashSection.*)
    . = ALIGN(0x4);  
  } >ExtRAM AT> ExtRAM

And the post build script as

arm-none-eabi-objcopy.exe --set-section-flags sectionpattern=noload --dump-section ExtFlashSection=images.bin tester.elf

But the massage I get is:

arm-none-eabi-objcopy.exe --set-section-flags sectionpattern=noload --dump-section ExtFlashSection=images.bin tester.elf
arm-none-eabi-objcopy.exe: tester.elf[ExtFlashSection]: can't dump section - it has no contents: file format not recognized

Radosław
Senior II

1few options to try:

  1. remove : (NOLOAD) from ld file,
  2. split obj operation first create flash image next set flag
  3. remove set flag but leave (NOLOAD).

I never do this, but maybe you remove some important flag for this sections.

@Rados?aw​ There should exist an automated method. Otherwise all these efforts for building compilers and linker script and ... for large embeded systems are useless. I said there is no problem with Keil.

Radosław
Senior II

I understand you, but still you want to do something unusual. Did you try this options? Later maybe i will find some time to test this.

About keil a can't say anything, i hate it.