S32K144 Bootloader Example

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

S32K144 Bootloader Example

13,046 Views
bidinhol
Contributor II

Hi all,

I want to share S32K144 bootloader example (based on AN12218SW : S32K148) using S32K144EVB

This example includes :

1. Bootloader interface : Tool to download User Application to S32K144 when running bootloader

2. Bootloader_b11 : Bootloader project

3. bootloader_app_b10 :  User Application project

How to use :

I) Step 1 : to flash Bootloader (BootLoader_b10.elf) to S32K144 (through USB micro connector)

pastedImage_7.png

II) Step 2 : Bootloader will wait in 10 seconds for you click "download" user application 'bootloader_app_b10.srec' file through Serial_Bootloader_Interface.jar tool (Select Baudrate = 19200). If not, Bootloader will run forever in for-loop (user application is not downloaded into S32K144)

pastedImage_8.png pastedImage_12.png pastedImage_14.png

 

Note1 : After User Application is downloaded into S32K144, Bootloader will automatically jump to user application (RED LED and GREEN LED blink alternately)

Note2 : If you re-build User Application in User Application project, you need to modify a little srec file (bootloader_app_b10\Debug\bootloader_app_b10.srec)

pastedImage_17.png

Good luck .. ^_^

Labels (1)
15 Replies

5,588 Views
Vivek_123
Contributor I

Hello sir,

                I need a source code for serial Bootloader interface (Application). 

0 Kudos

6,381 Views
Vivek_123
Contributor I

Connection from "127.0.0.1" via 127.0.0.1
Connection from "127.0.0.1" via 127.0.0.1
Searching for FreeRTOS Kernel Symbols...
pxCurrentTCB not found. FreeRTOS analysis not enabled.
Copyright 2017 P&E Microcomputer Systems,Inc.
Command Line :C:\NXP\S32DS_ARM_v2018.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_3.3.5.201801101746\win32\pegdbserver_console -device=NXP_S32K1xx_S32K144F512M15 -startserver -singlesession -serverport=7224 -gdbmiport=6224 -interface=OPENSDA -speed=5„

CMD>RE

Initializing.
Target has been RESET and is active.
CMD>CM C:\NXP\S32DS_ARM_v2018.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_3.3.5.201801101746\win32\gdi\P&E\supportFiles_ARM\NXP\S32K1xx\freescale_s32k144f512m15_pflash_dflash_eeprom.arp

Initializing.
Initialized.

;version 1.04, 11/30/2017, Copyright 2017 P&E Microcomputer Systems, Inc. All rights reserved. www.pemicro.com [s32k144f512m15_x_pflash_dflash_eeprom_rev2]

;device freescale, s32k144f512m15, pflash_dflash_eeprom

;begin_cs device=$00000000, length=$14001000, ram=$20000000

Loading programming algorithm ...

WARNING - Selected .ARP file has been modified. CRC16 = $4977
Done.
CMD>VC
Verifying object file CRC-16 to device ranges ...
block 00000000-0000040F ...
Ok.
block 10000000-10001353 ...
Calculated CRC-16 does not match block. (File = $4092, Device = $0000)

CMD>EM

Erasing.
Module has been erased.
Reloading programming algorithm ...
done.
CMD>PM

Programming.
Processing Object File Data ...


.
Programmed.
Error communicating to target processor - try a RESET.

CMD>VC
Error loading CRC-16 algorithm.
Error loading CRC-16 Algorithm.
Error verifying flash of device
Error occurred during Flash programming.

I am getting this error. How can i solve this?

0 Kudos

9,334 Views
rathi_tg
Contributor III

Hi @bidinhol  @enwei 

        I tried the code which you have provided and it works well. But is their a Possibility to Jump to boot section during run time based on certain condition. 

    Lets Consider I Want to Jump to Bootloader section when I receive data on CAN_ID 0x01 so can i use a something like 

      JumpToUserApplication(*((uint32_t*)0x00000000), *((uint32_t*)(0x00000000 + 4)));

 

Regards 

Gopal Rathi

0 Kudos

6,398 Views
Vivek_123
Contributor I

Error in final launch sequence
Failed to execute MI command:
tbreak main
Error message from debugger back end:
Cannot access memory at address 0x100000a2
Cannot access memory at address 0x100000a2

I tried but i get this error . how can i solve this ?

0 Kudos

11,349 Views
Kaarthi
Contributor II

Hi,

I have tried working with the bootloader code you shared. I am able to load the bootloader and the application software also working when the bootloader is in debugging mode. If i run it in normal mode, I am not able jump to application mode. I have attached the linker file of application and SREC file of app.

Regards,

kaarthi. 

0 Kudos

11,312 Views
Narudol-T
Contributor III

Hi @enwei 

 

it is very interesting project for flashing S32K via CAN Bus.

 

Because  I am not fluent in  chinese.

i have a question regarding the work process.

 

If i connect several boards (same bootloader) into single can bus.

 

and then I use GY8507 flashing *.S19 file into this can bus.

 

what would be the outcome? should all hardwares get same update of *.S19 or Error ?

 

 

looking forwards to your reply.

 

Best Regards,

Narudol T.

0 Kudos

11,287 Views
enwei
NXP Employee
NXP Employee

@Narudol-T Hi Narudol,

This CAN bus based bootloader is designed for automotive applications, on a car, each ECU has its own dedicated function with a pre-dfined CAN message ID for it bootloader link-up, so it is impossible to connect several boards (same bootloader) into single can bus at the same time.

So I'd like to know how is your use case? 

For your question, if connecting mulptiple boards with the same bootloader configuration to a single CAN bus, for my project, it should work as normal(all the boards will response with the same beat). While in a actual bootloader, a randon number will be sent by the ECU to secure communicate with the bootloader host, so they will not work as expected with bus conflict.

Best regard,

Enwei Hu.

0 Kudos

11,273 Views
Narudol-T
Contributor III

Hi @enwei 

 

The application is Electric Vehicle.

Since normal operation will be 112SxP NMC Li-ion, it requires at least x8pcs of MC33771B board.

So, when when want to update the Battery Cell Controller (BCC) from outside though CAN Bus.

This bootloader will come very handy.

 

And, the Firmware of each BCC is basically same, only CAN ID shall be different.

In such above practice, what should be the best practice to handle it ?

Should we need to modify the Bootloader specificly to each BCC board or commonly used ?

 

 

Looking forward to your reply.

 

Thank you,

Narudol T.

 

 

0 Kudos

11,266 Views
enwei
NXP Employee
NXP Employee

Hi @Narudol-T ,

 

It's up to your product requirements on balance system performance vs. reliability.

 

Best regard,

Enwei Hu.

0 Kudos

11,239 Views
Narudol-T
Contributor III

Hi @enwei 

 

Thank you very much.

 

BTW, if there is any other flashing tool you may recommend besides GY8507?

For example, I have VECTOR, KVASER, and PCAN usb.

Could it being used for flashing *.S19 with any specific suggestion software ?

 

Looking forward to your reply.

 

Thank you,

Narudol T.

0 Kudos

11,620 Views
chaitanya_kalyani
Contributor III

Hello @enwei ,

 

I am not able to open your link. I am getting the below message

chaitanya_kalya_0-1609435426580.png

Can you provide another link?

 

 

0 Kudos

11,892 Views
liangxinyu86
Contributor I

hi ,can  you help me  ,I do this  ,but  the  app cannot  be loader .  I  donot konw  How to  edit  the  srec file ?    can you   share  youre  e-mail ?

0 Kudos

11,991 Views
abderrahimjamao
Contributor III

Hello, thank you for sharing your code. I have some questions, please.
1. Is  Your bootloader capable of updating the user application via a UART interface for example or not.
2. How can I make my change your application (bootloader 10) by my own application?

regards,

0 Kudos

11,991 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi,

Thank you for sharing.

I would like to add the note. It is better to use some tools for SREC alignment for huge application projects.
The srec_cat tool can be used for this purpose:

Best regards,

Diana