LPC5410xx secondary bootloader release optimisation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC5410xx secondary bootloader release optimisation

752件の閲覧回数
svensavic
Contributor III

I am trying to make secondary bootloader as small as possible. Therefore enabling code optimisation in the release configuration. 

Bootloader works fine in the debug and Level0 optimisation in the release, but as soon as I enable optimisation it doesnt work anymore. It seems like jumping is not really jumping on the right location. Or re-assigning of the vector is not working. Anyway I dont know how to debug this.

Verification of the flash memory proves that application is loaded correctly to the specified location. So, issue seems to be within the jump procedure.

   volatile static uint32_t USER_FLASH_START = 0x2000; 
   static void boot_jump (uint32_t address) {     
      asm (" LDR SP, [R0]");   //load new stack pointer address     
      asm (" LDR PC, [R0, #4]");//load new program counter address 
   } 
   void bootSystem (void) {     
      SCB->VTOR = USER_FLASH_START & 0x1FFFFF80;     
      boot_jump(USER_FLASH_START); 
   }

Any ideas ?

ラベル(1)
0 件の賞賛
2 返答(返信)

636件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Sven,

If the bootloader works fine if you do not use optimization, it is okay. Because the bootloader code is written manually, it is efficient, I do not suggest you optimize it.

BR

XiangJun Rong

0 件の賞賛

636件の閲覧回数
converse
Senior Contributor V

Are you sure that this is where the problem is?

Anyway, generate the assembler listing for both optimisation levels, and compare:

Creating Disassembly Listings with GNU Tools and Eclipse | MCU on Eclipse 

0 件の賞賛