leading flash page before main app - run & debug

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

leading flash page before main app - run & debug

957 次查看
andreasschnitze
Contributor II

Hi,

Platform: LPC15 & LPCexpresso 8.2.2


a bootloader managed application will run from a start address 0x2100 (this works fine).

For transmitting a new image later, a leading page of 256 Bytes (or less) with information’s like Version Number etc. should be added.

To avoid to begin with own linker scripts I did the following:

pastedImage_1.png

In main.c:

  • Flash2 data only a test with a string for now
  • CRP-disabled

...

__attribute__ ((used, section(".rodata.$Flash2"))) static const char version[] = "Version01";

int main(void) {

               

       SCB->VTOR = 0x2100;    //needed to directly debug this app (mcu setting is start @0x2100)

      __enable_irq();                   //bootloader jump diabled isr

      volatile char* version_ = (volatile char*) version;            //__attribute__ ((used,...above is not working so this.

...

the generated binary looks like:

pastedImage_2.png

Adjusted the debugger cfg:

pastedImage_3.png

(tried also with std main)

The debugger failed to run this setup

(Unable to retrieve disassembly data from backend and other errors)

Any suggestions whats wrong or missing?

Thanks

Andreas

标签 (2)
标记 (1)
0 项奖励
回复
1 回复

632 次查看
soledad
NXP Employee
NXP Employee

Hello,

Please check the below threads and let me know if this helps.

Placing code/rodata into different FLASH blocks 

Placing data at an address 

https://community.nxp.com/thread/389100


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复