Relocating Program Flash

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

Relocating Program Flash

2,006 Views
jeremyanderson
Contributor III

We are using MCUXpresso and the SDK with the FRDM_K66 board and would like to install a custom bootloader at address 0x0 in Program Flash.  To do this we have to move program flash and that means we have to deal with the application vector table being in a new location. This was discussed in another thread  concerning relocating the vector table and I also wonder why the vector table is not found by default in relation to the base of Program Flash.  But more important for us right now is that we are unable to get the debugger to execute our application.

We have done the following:

1. Change program flash to start at 0x1000 and changed length to 0x1ff000

2. Add a statement at beginning of main() function SCB->VTOR = 0x1000;

 

The compile works fine, but execution ends with 'No source available for "__sys_appexit() at 0x69e0"'

Have we attempted something obviously wrong here or is more information needed?

Labels (1)
0 Kudos
3 Replies

1,059 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jeremy,

1. "main() function SCB->VTOR = 0X1000; ", does the main() from bootloader project or application ?

2. About  Relocating , you can have a look at Relocating Code and Data Using the MCUXpresso IDE 

3. Please pay attention , the project run from bootloader(0x0000), then jump to APP(0x10000) through SCB->VTOR = 0x1000;

If still have question about this, please share your project.

Hope it helps


Have a great day,
TIC

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

0 Kudos

1,059 Views
jeremyanderson
Contributor III

1. I put the SCB->VTOR = 0X1000; in the application main()

2. Yes, thank you.  This explains process very well.

3. So you are saying that to debug application with the flash moved to 0x1000 I will have to have a bootloader at 0x0000?

The project is just a demo project called frdmk66f_rtos_examples_freertos_uart that we got from the SDK.

Thanks for your help on this!

0 Kudos

1,059 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jeremy,

Yes, you need put the jump to application code (SCB->VTOR = 0X1000) into bootloader project .

The start address of kinetis is 0x0000, then jump to 0x1000.

About the bootloader and application , I recommend you have a look at this document under

https://community.nxp.com/docs/DOC-328365  

BR

Alice

0 Kudos