S32K144 Bootloader example project not working

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

S32K144 Bootloader example project not working

1,469件の閲覧回数
emb02
Contributor V

Hello,

I want to create bootloader project for S32K144. I'm using below code for reference.

https://community.nxp.com/t5/S32K/S32K144-Bootloader-Example/td-p/1011855

But I'm not able to run the bootloader.

I'm getting warning as -> No source available for "WDOG_EWM_IRQHandler() at 0x10000048"

error.PNG

Memory configuration of Bootloader project:

mem err.PNG

Memory configuration of Application project:mem err app.PNG

I want to ask why m_text region starts at address 0x10000000 in Linker file of Bootloader project? It must be 0x00000410? Is this is an error? Please correct me if I'm wrong.

I'm attaching my project for your reference.

0 件の賞賛
返信
4 返答(返信)

1,412件の閲覧回数
emb02
Contributor V

Hello @lukaszadrapa

Thank you for your response.

I have mapped memory in linker as per below configuration.

Mem mapping.PNG

I can't share bootloader project as per company's policy. But I'm using below memory configuration in Linker.

Bootloader Memory mapping:

BL mem.PNG

Application Memory mapping:

APP mem.PNG

This is our code routine:

code.PNG

I am able to jump from bootloader to application using my code, but not able to jump from application to bootloader.

Please guide me with this.

0 件の賞賛
返信

1,382件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

What can you see in core registers when stepping over the jump instruction? I mean in asm, not in C. Is correct address loaded in the registers? Does it jump to the entry point? If yes, does it crash later in the application? Where?

Regards,

Lukas

0 件の賞賛
返信

1,320件の閲覧回数
emb02
Contributor V

Hello @lukaszadrapa 

Thank you for your response. I've checked core registers and now I'm able to jump to bootloader from firmware.

Now I want to use primary and secondary bootloader so I'm using 24 KB for Primary bootloader and 64 KB for secondary bootloader.

Flash configuration in Primary bootloader:

static const flash_user_config_t _xFlashFirmwareInitCfg =
{
.PFlashBase = 0x0U,
.PFlashSize = 0x16000U, // 24KB + 64KB = 88KB
.DFlashBase = 0x10000000U,
.EERAMBase = 0x14000000U,
.CallBack = NULL_CALLBACK
};

Flash configuration in Secondary bootloader:

static const flash_user_config_t _xFlashFirmwareInitCfg =
{
.PFlashBase = 0x6000U,
.PFlashSize = 0x7A000U, // 64KB + 424KB = 448KB
.DFlashBase = 0x10000000U,
.EERAMBase = 0x14000000U,
.CallBack = NULL_CALLBACK
};

With this configuration I'm not able write or erase flash memory at address 0x16000 in secondary bootloader project.

But if I'm using below configuration for secondary bootloader then I'm able to write/erase this memory.

static const flash_user_config_t _xFlashFirmwareInitCfg =
{
.PFlashBase = 0x0000U,
.PFlashSize = 0x80000U, // 24KB + 64KB + 424KB = 512KB
.DFlashBase = 0x10000000U,
.EERAMBase = 0x14000000U,
.CallBack = NULL_CALLBACK
};

I'm not able to understand Why configuration of base address and flash size of primary bootloader is also required to be configured in secondary bootloader ?

0 件の賞賛
返信

1,437件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @emb02 

This is not original bootloader from application note AN12218, so we won't support this. It's just some modified version from another community user, not from NXP.

I recommend to start with original AN12218:

https://www.nxp.com/docs/en/application-note/AN12218.pdf

https://www.nxp.com/docs/en/application-note-software/AN12218SW.zip

The document also says, why data flash memory is used for the bootloader:

lukaszadrapa_0-1726241861346.png

 

lukaszadrapa_1-1726241879490.png

Another reason is that Read-While-Write is supported between the data flash and program flash, so it makes the bootloader simpler because it's not necessary to run the code from RAM during programming. 

Regards,

Lukas

 

 

0 件の賞賛
返信