AnsweredAssumed Answered

AN2295 again! Now it stuck on downloading custom firmware

Question asked by Kai Liu on Aug 15, 2013
Latest reply on May 24, 2016 by Ganesh Ramachandran

Hello, here comes my questions regarding AN2295 again.



In my previous thread of Something wrong with AN2295 bootloader on FRDM-KL25Z for its reset behaviour . I finally managed to communication with FRDM-KL25Z on 57600bps with short TRIM option.



I have prepared my demo software, (a sample code from FSL with modified ICF) but it can not be downloaded into FRDM-KL25Z.



Since FSL MCU has no bootloader on MCU like other vendor do, AN2295 becomes very important. Other USB bootloader takes too much resources. However, in order to make it work, we have more to do: a good bootloader, a stable PC software, a custom demo software. If anyone can help me out, I will write a dedicated document regarding my experiences to share with you guys.


A: Programming failed.


After establishment of communication, I can run win_hc08sprg. Erase and BLANK check are all right. The PROGRAM fails on 0x00001080.



First of all, "Can't program block 0 at address 0x00001080", why 0x00001080 belongs to block 0, it should be in block 1 if block size is 128B.


The any following actions like ERASE/BLANK check prompt as "NOT ERASE" or "NOT BLANK CHECK". What is it? The client software refuses to erase or fails on erasing?


B: AN2295.pdf has not been updated for Kinetis/ColdFire.


The original bootloader was designed for HC08, which is an 8-bit micro with 2B address. But for 32-bit micro, it should be 4B, but that protocol parameters have not been updated in AN2295.pdf.


Additionally, the communication log is missing in this software, I have no idea what happens on serial communication.


C: It is tricky to debug flash programming on FRDM/OpenSDA.


The win_hc08sprg refuses to talk with AN2295 bootloader when it is in debug mode. Therefore I have to emulate it with legacy protocol described on FSL document.


I found something new to me:

a) After erasing flash, flash configuration byte array from 0x400 to 0x40F is:


b) The first page of user area (0x00001000~0x0000107F) has been programmed successfully, but it stops on 0x00001080, anyway. I added some LED indicator, which shows the programming is successful.

c) The write buffer is defined as 256B, while flash page (write block) size is 128B. I can not find any special functions to handle two halves.


Attachment my revision of AN2295 (Debug) project for IAR, which adds some LED as mini indicator.

Pflash_32KB_AN2295.icf: my linker ICF for a sample application, changed for AN2295.

DemoApp_4_FC_Bootloader_freedom.srec: my srec for a sample application, linked with modified ICF file.

Original Attachment has been moved to:

Original Attachment has been moved to:

Original Attachment has been moved to: