MKL17Z256 Bootloader questions

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

MKL17Z256 Bootloader questions

1,488 Views
samc
Contributor III

Hello,

I need help about bootloader on Kinetis MKL17Z256VFM4. I already used MC9S08 and Coldfire MCU, but it's the first time that I use Kinetis MCU.

Moreover, it's the first time that I will work with bootloader. So certainly I will ask very simply questions or questions with logical answers but as I'm beginner in bootloader, even if I think to know the answer, I need certainties on this subject to avoid errors.

1) In a first time, I want to implement a bootloader via UART :

     1.1) Is it possible to use an "UART to USB" component between the UART of the MCU and the PC in the aim to have an USB bootloader ? I suppose baudrate on USB will be limited by the max      baudrate of the UART ?*

     1.2) I read that KL17 have a bootloader in ROM. So in fact, with this, I just to point on the adress of the bootloader to launch it when I want in my program as it said here : Call ROM Bootloader from customer application with FRDM-KL43Z board   (the last section)  ?

     1.3) Not about the bootloader : I don't really understand the difference between UART and LPUART, what's the criterias to use one or the other ?

2) In a second time, I will implement the bootloader via a BLE connected to UART.

For this I think it's mandatory to store previously the datas in an external flash (by the application) and after launch the bootloader so that it goes to read the external flash and reprogramming MCU flash.

          2.1) I suppose the external flash size have to be equal than the MCU flash to program (256kB in my case)

          2.2) MKL17 already have a ROM bootloader. Have I to erase this bootloader with my own bootloader ? Or can I write a "second" bootloader and pointed to it when needed ?

    

3)

For the point 2), I'm not sur how to manage bootloading by BLE, all ideas are welcome!

Thank you,

Sam

0 Kudos
4 Replies

677 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Sam,

Some peripherals interfaces likes UART, I2C,SPI, LPUART and USB all support to upgrade the application code, and your assumption about the UART is right.

Call ROM Bootloader from customer application with FRDM-KL43Z board provide the way to jump the ROM bootloader from the application.

About the difference between the UART and LPUART, I'd highly recommend you to find out in the reference whose link is as follow.

http://cache.nxp.com/files/32bit/doc/ref_manual/KL27P64M48SF2RM.pdf?fpsp=1&WT_TYPE=Reference%20Manua...

Next, to build your own bootloader, it's not necessary to erase the ROM bootloader and it can't be erased actually.

You can set the MCU boot from the flash, not from the ROM bootloader, then the ROM bootloader has none of effect on the your own bootloader operation.

In my opinion, the BLE just provide the another way to transfer the data to the MCU's UART module, so you need to build an BLE-to-UART transfer satation to make it.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

677 Views
samc
Contributor III

Hello,

Thank you for the answer.

So, about the bootloader through BLE, I thinked too that BLE to UART is identical as USB to UART, so finally it's just a bootloading through UART.

But my anxiety is if the BLE connexion is lost during file transfer :

First the bootloader will have erase the flash before reprogramming BUT if the reprogramming fails during transfer, the new program will not be implemented into the MCU flash, so what will it happen ?

- MCU bugs ?

- MCU remains in bootloader mode until he have a valid application ? (Is it the functionning chart p162 of the reference manual ?)

Many thanks,


Sam

0 Kudos

677 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Samuel,

There are good questions.

To avoid the transferring error, it needs a protocol to find out something wrong.

I've attached the application node which can give you some hints, please refer to for details.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

677 Views
samc
Contributor III

Hi,

I already read this AN, thank you.

Best Regards,

0 Kudos