cancel
Showing results for 
Search instead for 
Did you mean: 

I generate a flm file, but failed when use this flm to download external flash.

sheng yang
Senior

I made  a project on keil with generate flm file to download to external flash with my board. My board has a stm32h7b0zbt6 chip with ospi interface with a spi nor flash W25Q128. the interface releate is:

 

 

PF6 ------> OCTOSPIM_P1_IO3
PF7 ------> OCTOSPIM_P1_IO2
PF9 ------> OCTOSPIM_P1_IO1
PB2 ------> OCTOSPIM_P1_CLK
PD11 ------> OCTOSPIM_P1_IO0
PC11 ------> OCTOSPIM_P1_NCS

 

 

and I append the project , is there anyone can help me to check the project ? 

When I try to use this flm file to download code on keil, I get errors like below:

shengyang_0-1734621698216.png

 

1 ACCEPTED SOLUTION
5 REPLIES 5

thanks for your help , after I check this flm file, I found all data get 0XAA , I do not know why cause this ?

2024-12-20 20 38 50.png2024-12-20 20 39 09.png

After I enable flash map , then I check the external flash data is right ,very thanks for your help .

2024-12-20 21 04 27.png

Yes, as a general rule I don't use Memory Mapping in the loaders, and either have a .INI for the debugger, or bring up external memory in SystemInit() so run-to-main has it visible prior to hitting the break-point in main()

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I modified the .sct file, made some code to ext flash like:

; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x08000000 0x00020000  {    ; load region size_region
  ER_IROM1 0x08000000 0x00020000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
   .ANY (+XO)
  }
  RW_IRAM1 0x20000000 0x00020000  {
   .ANY (+RW +ZI)
  }
  RW_IRAM2 0x24000000 0x00100000  {
   .ANY (+RW +ZI)
  }
  ;RW_EXRAM2 0xC0000000 0x2000000  {
  ; .ANY (+RW +ZI)
  ;}
}

LR_ROM1 0x90000000 0x00100000  {
  ER_ROM1 0x90000000 0x00100000  {  ; load address = execution address
   uicode.o (+RO)
   * (.init_array)
  }
}

And then I made some code change, modified ext flash in function SystemInit. I can lanuch the whole project run with Jlink in swd mode.

But If I repowered the board, I found the code do not run.

And if I just scan the chip in keil Debug->settings, the the app will run. Besides I use pemicro multilink to download code previous, but the multilink is hard to download to external flash in keil ,so I changed Jlink.