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.

There was some warning but seems not to matter

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

The following shows the modifications I made with the original bootloader
- To suit our case only AN2295_TWR_K60_cfg.h is included

- 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)

- 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).

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