Strange problem when re-arrange flash blocks

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Strange problem when re-arrange flash blocks

895 次查看
ck_max
Contributor I

Hi,

 

I'm using 52255 for current project. It's working only with internal flash and SRAM, and works fine.

When I try to re-arrange flash blocks for putting something like bootloader in front of normal program, problem happened.

The original flash blocks like following

 

# original settings

## intflash    (RX): ORIGIN = 0x00000000, LENGTH = 0x00080000

## sram        (RW): ORIGIN = 0x20000000, LENGTH = 0x00010000

   vectorrom   (RX): ORIGIN = 0x00000000, LENGTH = 0x00000400

   cfmprotrom  (RX): ORIGIN = 0x00000400, LENGTH = 0x00000020

  rom         (RX): ORIGIN = 0x00000420, LENGTH = 0x0007FBE0  

   ram         (RW): ORIGIN = 0x20000000, LENGTH = 0x00010000

 

I put bootloader in first 64KB like this

 

## intflash    (RX): ORIGIN = 0x00000000, LENGTH = 0x00080000

## sram        (RW): ORIGIN = 0x20000000, LENGTH = 0x00010000

   bootloader  (RX): ORIGIN = 0x00000000, LENGTH = 0x00010000       # bootloader

   vectorrom   (RX): ORIGIN = 0x00010000, LENGTH = 0x00000400

   cfmprotrom  (RX): ORIGIN = 0x00010400, LENGTH = 0x00000020

   rom         (RX): ORIGIN = 0x00010430, LENGTH = 0x0006FBD0  # Code + Const data   

   ram         (RW): ORIGIN = 0x20000000, LENGTH = 0x00010000  # SRAM - RW data

I create another project for bootloader, but I just put an direct jump to normal program start for testing.
Program stopped in initializing PHY.
There is an loop for auto-negotiate with PHY in BSP of MQX.
Normally it works fine. But it stuck when I shift all program at 0x00010000.
Is that anything I missed when moving blocks?
Please help, I've try days for this, I cannot understand why the same code cause different results.
Thanks!
标签 (1)
0 项奖励
回复
1 回复

451 次查看
doublev724
Contributor I

Don't put bootloader in the begining of flash. Try to put it from 1000~1fff instead. It seems like we shouldn't modify address for these vector tables.

0 项奖励
回复