cancel
Showing results for 
Search instead for 
Did you mean: 

Big packed BIN image if some code execute in ITCM.

tercelcn
Associate II

I complie STM32F769I-Discovery 2_Images. the final SBSFU_UserApp image's size is 532kb, It's size will increase to 131,669 kb if ITCM used. I add below code to UserApp.sct

  ;ITCM 16k
  ITCMRAM_region 0x00000200 0x00004000
  {
    fw_update_app.o (+RO-CODE)
  }

COMPILE:MDK 5.32,

SBSFU:2.6.1.

project:STM32F769I-Discovery 2_Images

4 REPLIES 4
KnarfB
Principal III

A .bin file is a 1:1 dump of a linear memory region. So if some code is in ITCM RAM starting at address 0x0000 0000 and "normal" code is in Flash memory on AXIM interface starting at address 0x0800 0000, the resulting .bin will be at least 0x800 0000 == 134.217.728 bytes.

See memory map in Reference manual RM0410.

Better use a format that can handle more than one memory segment like .hex or .elf

hth

KnarfB

I mean the original bin image size is 19kb even if some code is in ITCM RAM, the image which KeysAndImages tool packed is big.

RAM isn't persistent memory, there shouldn't be any code in the .bin file at a RAM address. Code&data are usually copied from Flash to RAM at startup. Maybe an error in your linker script or wrong function attributes?

hth

KnarfB

What you need to do is just try to complie thre project ( SBSFU\Projects\STM32F769I-Discovery\Applications\2_Images\2_Images_UserApp\MDK-ARM ), insert code below to UserApp.sct. then function in fw_update_app.c will execute in the ITCM which load from FLASH.

  ;ITCM 16k
  ITCMRAM_region 0x00000200 0x00004000
  {
    fw_update_app.o (+RO-CODE)
  }