How to decide the main application fixed address

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

How to decide the main application fixed address

ソリューションへジャンプ
848件の閲覧回数
fanziyu
Contributor IV

Hello everyone!
I have meet a problem when I read AN4723 for using bootloader,could you help me ?

MCU: S12ZVL64

Problem 1:In 4.1 "the application will jump to the main application. The main applicaiton must start at a fixed address configurable on the bootloader. " How to decide the main application fixed address?


//ROM = READ_ONLY 0xFF0000 TO 0xFFFDFF;//default
ROM = READ_ONLY 0xFF0200 TO 0xFFE5FF; //main application prm


if I configurate the prm file as shown above,then fixed address should be 0xFF0000 or 0xFF0200?  En, I think it is 0xFF0200,but i want to know the reason.

It is difficult for me to understand S12ZCPU_RM_V1 now, Would you please help to handle the case above ?thanks!

0 件の賞賛
返信
1 解決策
835件の閲覧回数
StanoA
NXP TechSupport
NXP TechSupport

Hello Fanziyu,

As described in AN4723 the ROM starts from top address 0xFFFFFF and goes down to 0xFF0000 for 64kB version. The RAM address starts on 0x001000 and goes up to 0x0013FF for 1k version (0x2000 for 4k version).

The Bootloader has two parts of code – one executed from FLASH and one executed from RAM (the code running during FLASH erase & write process). The last one takes one page (512 bytes). So it must be allocated in FLASH – segment SHADOW_ROM_S (512 b) and also in RAM segment SHADOW_RAM_S (512 b). The code is copied from FLASH to RAM and then executed. It is erase & write function.

This segment has to be in section:

SHADOW_ROM_S = READ_ONLY 0xFFFC00 TO 0xFFFDFF; // 512 bytes;

The Bootloader code executed from FLASH in in section:

ROM_BTLDR = READ_ONLY 0xFFF800 TO 0xFFFBFF;  // 1k bytes;

The rest of ROM is for user code section:

ROM = READ_ONLY 0xFF0000 TO 0xFFF7FF;  // 62k bytes;

For RAM the section for the Bootloader is:

SHADOW_RAM_S = READ_WRITE 0x001000 TO 0x0011FF;  // 512 bytes;

The rest of RAM is for user code:

RAM = READ_WRITE 0x001200 TO 0x0013FF;  // 512 bytes for smallest version;

After RESET the code starts from top FLASH – jump function to start address of Bootloader – this is fix address. The Bootloader code runs and waits 100msec for received data for FLASH program. If not received the time-out take place and program jump to top of FLASH section intended for user code. It is top of page beneath the Bootloader ROM section 0xFFF7FF. This configuration is independent of larger or smaller memory version device.

I hope it could help you to solve your task.

Best Regards,

Stano.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
836件の閲覧回数
StanoA
NXP TechSupport
NXP TechSupport

Hello Fanziyu,

As described in AN4723 the ROM starts from top address 0xFFFFFF and goes down to 0xFF0000 for 64kB version. The RAM address starts on 0x001000 and goes up to 0x0013FF for 1k version (0x2000 for 4k version).

The Bootloader has two parts of code – one executed from FLASH and one executed from RAM (the code running during FLASH erase & write process). The last one takes one page (512 bytes). So it must be allocated in FLASH – segment SHADOW_ROM_S (512 b) and also in RAM segment SHADOW_RAM_S (512 b). The code is copied from FLASH to RAM and then executed. It is erase & write function.

This segment has to be in section:

SHADOW_ROM_S = READ_ONLY 0xFFFC00 TO 0xFFFDFF; // 512 bytes;

The Bootloader code executed from FLASH in in section:

ROM_BTLDR = READ_ONLY 0xFFF800 TO 0xFFFBFF;  // 1k bytes;

The rest of ROM is for user code section:

ROM = READ_ONLY 0xFF0000 TO 0xFFF7FF;  // 62k bytes;

For RAM the section for the Bootloader is:

SHADOW_RAM_S = READ_WRITE 0x001000 TO 0x0011FF;  // 512 bytes;

The rest of RAM is for user code:

RAM = READ_WRITE 0x001200 TO 0x0013FF;  // 512 bytes for smallest version;

After RESET the code starts from top FLASH – jump function to start address of Bootloader – this is fix address. The Bootloader code runs and waits 100msec for received data for FLASH program. If not received the time-out take place and program jump to top of FLASH section intended for user code. It is top of page beneath the Bootloader ROM section 0xFFF7FF. This configuration is independent of larger or smaller memory version device.

I hope it could help you to solve your task.

Best Regards,

Stano.

0 件の賞賛
返信