problems in implementing serial bootloader in Kinetis K50 MCU

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

problems in implementing serial bootloader in Kinetis K50 MCU

593 Views
yinni
Contributor III

I have been trying to implement the bootloader in Kinetis K50 MCU with AN2295 without success (I searched NXP community first and modified the bootloader files according to other developers’ notes/suggestions, could not even establish the serial communication between the bootloader and PC software hc08sprg).

The following is a brief description of my system, the approach I followed, and the problems I encountered when I turned to AN2295. I would appreciate it very much if anyone can give me any suggestion.

Our MCU system:

  • MCU --- MK50DN512CLL10,
  • Serial interface for bootloader --- UART4 (connects a USB to UART Bridge, Silicon Labs CP210x)
  • IDE for user application development --- MCUXpresso

My Approach

I landed on MCUBOOT: MCU Bootloader for NXP Microcontrollers page, clicked on DOWNLOAD tab:

  • First tried to download K50 SDK with middleware that has MCU Boot (MCU Bootloader source code), and failed because MCU Boot is not in K50 SDK.
  • Secondly downloaded NXP_Kinetis_Bootloader_2.0.0 package but could not figure out how to use it. Also, I could not find a match for K50 under the target folder.

Then I turned to AN2295 which at least implies that K50 is supported.

My understanding about implementing a bootloader (please correct me if I am wrong)

  • Program the MCU with bootloader source file in IAR
  • Use hc08sprg to connect the MCU, making sure bootloader is successfully programed
  • Transmit the user application S19 generated in MCUXpresso to MCU from computer and reprogram the flash memory area assigned to user code

Problems in trying to make AN2295 serial bootloader work

My initial attempt of downloading the bootloader to MCU was not successfully because the default setting of debugger was simulator; after this was corrected, I believe the bootloader is programmed.

yinni_0-1625545460651.png

There was some warning but seems not to matter

yinni_1-1625545460673.png

However, when I tried to connect our MCU with computer in hc08sprg, nothing is received by the computer.

yinni_2-1625545460740.png

The following shows the modifications I made with the original bootloader

  1. To suit our case only AN2295_TWR_K60_cfg.h is included

yinni_3-1625545460810.png

 

  1. In AN2295_TWR_K60_cfg.h, UART settings are modified to suit our case, BOOTLOADER_FLASH_PROTECTION is set to 1 (according to NXP community posts)

yinni_4-1625545460903.png

 

  1. In AN2295_LinkerFile.icf, only ICFEDIT_region_ROM_end is changed to 0x3FFF. (I am quite confused about how to modify AN2295_LinkerFile.icf, the modification I venture to make comes from NXP community post).

yinni_5-1625545461020.png

With all these efforts, I could not connect the MCU from my computer and I am seeking help

0 Kudos
2 Replies

573 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Yinni,

I am assuming that you set K60_100MHz correct? Please note that AN2295 is an old software tool that is not recommended, we recommend using latest MCU boot software. You are correct that specific bootloader projects are not included in the K50 SDK, however, you can check chapter 10 of the MCU Bootloader v2.5.0 Reference Manual for porting guide. https://www.nxp.com/docs/en/reference-manual/MCUBOOTRM.pdf

You can see an example of this in this link for TWR-K60D100: https://community.nxp.com/t5/Kinetis-Microcontrollers/Port-MCUBoot2-0-0-to-TWR-K60D100/ta-p/1117267

Best regards,

Felip

0 Kudos

558 Views
mjbcswitzerland
Specialist V

Hi

Note that AN2295, Kboot and a number of loaders (like SD card, memory stick, Ethernet, USB-MSD) for the K5x (and almost any other Kinetis part) are available as out-of-the-box builds for most IDEs in the open source uTasker Kinetis project on GITHub

https://www.utasker.com/kinetis/TWR-K53N512.html

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or rapid product development requirements

For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/iMX/RT1064.html

0 Kudos