AnsweredAssumed Answered

k60 AN4368 bootloader port to k20, "ERROR......Unknown file type" problem?

Question asked by Robert Hana on Aug 14, 2014
Latest reply on Aug 15, 2014 by Robert Hana



    I am porting the k60 bootloader code to the k20, based on AN4368. The code compiles. Most of the bootloader is working except the most important part; when it reads an image file from a USB stick (so USB is working, the flash drivers appear to be working, the bootloader code appears to be working.) The flash driver just starts to parse the file when it gives up.

The error we are getting in Hyper Terminal is  "ERROR......Unknown file type." The s-record file we are using is from another project for the k20 which has been renamed to image.s19 according to AN4368. But it appears the file is not being recognized as an s-record file from the debug message.


So it seems

1)  the s19 file is not the correct file type from what the debug messages are telling me

2) the flash driver for the "MK60N512VMD100" doesn't work with the k20 (I have been told it does.)




[I am using CodeWarrior 10.6, windows XP, and TWR-K20D72M]


------------------- Investigating further -------------------------

in Loader.c, forcing through the following code...(basically adding "filetype = S19_RECORD;" to force it into this file type, just adding that into the else statement)



#ifdef __DEBUG__

            printf("\n\r\t\tERROR......\n\rUnknown file type");


#if (!defined _MK_xxx_H_)



        } /* EndIf */


we arrive in the FlashLineS19() function. It appears to go through "formulate address" then "adjust word alignment" and finally concludes with "this is not a valid s-record file" here:



       /* not a valid S19 file */

        printf("\n not a valid S19 file d.\n");//RH

       BootloaderStatus = BootloaderS19Error;

        return FLASH_IMAGE_ERROR;