USB Mass Storage Device Programming

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

USB Mass Storage Device Programming

701 Views
mtuxpe
Contributor III

Hi all,

I am trying to develop a new app for Rapid IoT.

According page 108 of User's Guide I need to transfer my bin file to Rapid IoT USB storage.

After moving min bin to storage nothing happens( green LED is blinking).

It seems that bootloader ignores my bin file.My program was tested on KW41Z kit.

On page 110 of User's  Guide:

"Bootloader will automatically identify the MCU target to reprogram thanks to the binary file signature."

Maybe I need to sign my bin file.Where I can find details of binary signature? 

Best regards,

Marcio Montenegro

Labels (1)
1 Reply

515 Views
frq05186
NXP Employee
NXP Employee

Hello,

The boot loader is looking at the position of the reset vector to distinguish between 2 binaries targets.

On K64f it is around 0x14Fxxx and in KW41 it is around 0X4xxx

You can check it from the kboot code: (usb_device_msc.c; around line 550)

 

                                        if(lbaData.buffer[6]==0x01 && lbaData.buffer[7]==0x00 && tval==0x40)

                                        {

                                               if(AppProgMode==MODE_MSD_FACT || AppProgMode==MODE_FACT_USER)

                                                      MSD_Cur_Img_Type = FICA_IMG_TYPE_K64F_FACT;

                                               else

                                                      MSD_Cur_Img_Type = FICA_IMG_TYPE_K64F_USER;

                                               BadBinaryFile = false;

                                               TransferStarted = true;

                                        }

                                        else if(lbaData.buffer[6]==0x00 && lbaData.buffer[7]==0x00 && tval==0x40)

                                        {

                                               if(AppProgMode==MODE_MSD_FACT || AppProgMode==MODE_FACT_USER)

                                                      MSD_Cur_Img_Type = FICA_IMG_TYPE_K41Z_FACT;

                                               else

                                                      MSD_Cur_Img_Type = FICA_IMG_TYPE_K41Z_USER;

                                               BadBinaryFile = false;

                                               TransferStarted = true;

                                        }

                                        else

                                        {

                                               BadBinaryFile = true;

                                        }

Be aware that if you write a program before address 0x14000 in the memory, you will overwrite the boot loader and consequently you loose this drag and drop functionality. This is a common error leading to 'blocking kits'