leading flash page before main app - run & debug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

leading flash page before main app - run & debug

612 Views
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

Labels (2)
Tags (1)
0 Kudos
1 Reply

287 Views
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 Kudos