Relocate the startup of an application Program @ 0x1000

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

Relocate the startup of an application Program @ 0x1000

1,273件の閲覧回数
heng
NXP Employee
NXP Employee

Hi

 

I am trying to offset the startup application program to 0x1000 for KL27 (64K flash) freedom board.

Using KDS and SDK V1.3 processor expert.


The application program work good and well when I use debugging mode in KDS.

However, after POR or reset the application program is not running.

I have checked the flash memory of 0x1000 onward and it is filled with the application program code.

The 16 bytes  of 0x400-0x40F are also correct.

The address at 0x140D = 0x3D data.

 

From the link below, I found out that CPU reset the Stack pointer is loaded from the address 0x0000_0000 and the Program Counter is loaded from the address 0x0000_0004.

Relocate memery on KDS3.0

 

 

How can i initialize the stack pointer and program counter in KDS using SDK V1.3 when i relocate the memory to start @ 0x1000 address?

 

Thanks.

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////

  1. ProcessorExpert.Id files

MEMORY {

m_interrupts          (RX)  : ORIGIN = 0x00001000, LENGTH = 0x00000200

  m_flash_config (RX)  : ORIGIN = 0x00001400, LENGTH = 0x00000010

  m_interrupts_ram (RW)  : ORIGIN = 0x1FFFF000, LENGTH = 0x00000200

m_text (RX)  : ORIGIN = 0x00001410, LENGTH = 0x0000EBF0

m_data (RW)  : ORIGIN = 0x1FFFF200, LENGTH = 0x00003E00

}

 

////////////////////////////////////////////////////////////////////////////////////////////////

Startup_MKL27Z644.S file.

 

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF3DFE

//////////////////////////////////////////////////////////////////////////////////////////////////////

Original Attachment has been moved to: Test.zip

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

904件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Boon,

This chip only can from the 0x000000 to start , on system reset,

the vector table is at address 0x00000000.

After start , you can change the VTOR to jump to other place .

Just like the bootlaoder David said .

Hope it helps

Alice

0 件の賞賛
返信

904件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Heng,

Why are you moving application to 0x1000? 

The Kinetis (ARM Cortex core) devices require the vector table be located at address 0x0000_0000.

The Flash Configuration Fields are at 0x400-0x410 and are read at boot-up.

Once an initial application boots-up (example would be a bootloader) it can change the location of the VTOR (vector table) to a new location and jump to the new application that could be at 0x1000.  The 0x1000 would be the starting address of the vector table for your application that has the SP and PC to point to starting address of your application code.

Regards,

David

0 件の賞賛
返信