UART based S32K144 MCU boot loader

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

UART based S32K144 MCU boot loader

1,609 Views
Ankit_Rana
Contributor II

Hello Geeks, 

I'm working on S32K144 boot loader I'm having trouble in finding normal bootloader example code that can simply jump to the application available on particular address. 
--> I'm not using any evaluation board So using provided example and RAppID  BL Tool is not help full. 

I'm looking for normal boot loader code in which it simply jump to application address. 
later I will add UART functionality in it in polling mode to start getting firmware packets from other entity and flashing to packets to flash memory.  

I'm following AN12323 AppNote and section 6.1.1 S32K144 Memory Map for A/B Swap, with single pflash block as my design. 
@lukaszadrapa @stanish @dianabatrlova @danielmartynek @Jiri @Daniel_Popa 

Thanks

0 Kudos
Reply
7 Replies

1,585 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ankit_Rana,

Please take a look into AN12218 S32K1xx Bootloader with its associated file (AN12218SW), it describes the architecture and usage of the S32K1xx bootloader in S32K1 MCUs. This bootloader supports UART as the communication interface.

Julin_AragnM_0-1710540072238.png

Best regards,
Julián

0 Kudos
Reply

1,562 Views
Ankit_Rana
Contributor II

Thanks for the quick response @Julián_AragónM . 

I have taken AN12218SW file. 
But it seems it is developed for S32k148 is there any easy way to migrate from s32k148 to s32k144.? 
Also, I'm not able to see any configuration done in tool for S32k148 project in (UART, CLOCK, PIN etc.)
it seems it is written without generating drivers from configuration tool. 
So, it's not easy to take configurations for s332k144 from provided code of s32k148. 
Please suggest me a way to make this code functional for S32k144 As soon as possible. 

Also, I need some guidance, I'm using Appnote An12323 section 6.1.1 S32K144 Memory Map for A/B Swap, with single pflash block. I have one question as below:

Where should I gather new firmware packets and write into flash? in application code itself OR we should gather in boot loader (UART based boot loader)? 

Scenario_1: New firmware packets gathering in APP code itself.
total program flash: 512 --> 247kB running firmware (firmware_1) + 247kB(firmware_2)
flex memory: 64kB --> 16kB bootloader (only A/B swap logic) + 48kB (EEPROM)

If I'm planning to get new firmware packets in application code (firmware_1, Running firmware) itself. Is it possible to flash/store new packets at firmware_2 location without any write/read problems?

(Note: As of now planning to write UART based bootloader as current code size: 278kB will not fit in
247 kB partition decided in appnote section An12323 section 6.1.1) 
below image attached from AN12323 page 12. 

Ankit_Rana_0-1710753257295.png

 


Thanks,
Ankit Rana 

0 Kudos
Reply

1,494 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ankit_Rana,

Unfortunately, there is no easy way to migrate from S32K148 to S32K144, the procedure is to create a new project, copy the code and drivers from one project into the new one. Also, since this is software based on an old version of S32DS, there are no Config Tools support.

You can instead take a look into this community post for guidance: S32K144 Bootloader Example - NXP Community 

As for the second question, new firmware packets gathering in APP code itself should be fine. As long as there was not a reset, you can update the active region.

Julin_AragnM_0-1711126857171.png

 

Just take into consideration S32K144 has one read partition on program flash, so it is not possible to update the application while the old application is still running.

For example, S32K146 has more read partitions on program flash, so old application can run during the update.

Best regards,
Julián

0 Kudos
Reply

1,462 Views
Ankit_Rana
Contributor II

Hi @Julián_AragónM

Just for confirmation can you please elaborate on below statement. 


Just take into consideration S32K144 has one read partition on program flash, so it is not possible to update the application while the old application is still running. 

Understanding: if new firmware(firmware_2) packets(1kb chunks) are receiving in running application code over UART(firmware_1), then while receiving new firmware packets it is not possible to perform WRITE/flashing operation to store new firmware packets at (firmware_2) location. 

please let me know if my understanding is correct or not. 
Thanks. 

Ankit_Rana_0-1710753257295.png

 

0 Kudos
Reply

1,448 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ankit_Rana,

Yes, your understanding is correct.

Best regards,
Julián

0 Kudos
Reply

1,432 Views
Ankit_Rana
Contributor II

Thanks @Julián_AragónM 
for quick response. 

I'm planning to receive new firmware packets in boot loader code. 

  1. I want to place boot loader in flex memory, can you show me/guide me if there is any example code for flash partition. 

  2. Also please let me know which drivers can be used for erasing/writing to MCU flash.

I'm new to NXP MCU and bootloader development. any guidance/help appreciated. 

Thanks, 

0 Kudos
Reply

1,410 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ankit_Rana,

There is no specific example for a bootloader inside the FlexMemory, but you can look into AN12003: Using S32K148 FlexNVM Memory for the use cases. Also, AN11983: Using the S32K1xx EEPROM Functionality may prove useful as well.

There is an example "flash_partitioning_s32k1xx" in S32DS. The purpose of this demo application is to show you the usage of the Flash Driver with the S32 SDK API.

Julin_AragnM_0-1711569886179.png

Best regards,
Julián

0 Kudos
Reply