K60 MSD boot loader not switching to user flash

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

K60 MSD boot loader not switching to user flash

1,612 Views
pramodk_g_
Contributor III

Hi All,

I tried AN4379 Boot loader example for TWR K60 board in CW 10.5, MQX 4.0 using the "Freescale USB Mass Storage Device Bootloader" document.


But when i copy the ".afx.s19" image to the the Bootloader Drive the Drive disappears and appears again showing "SUCCESS.TXT" file which is expected as per document. But the code never switch to user application area, again when i restarts the board it goes to the boot loader. I tried with the images given in the zip file but no use. So i created a MQX hello world program by changing the .lcf file as the following

MEMORY

{

  vectorrom  (RX): ORIGIN = 0x0000C000, LENGTH = 0x00000400

  cfmprotrom  (R): ORIGIN = 0x0000C400, LENGTH = 0x00000020

  rom        (RX): ORIGIN = 0x0000C420, LENGTH = 0x00077BE0  # Code + Const data

  ram        (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00020000  # SRAM - RW data

  # kernel space starts after RAM variables (Location of MQX Kernel data + MQX heap)

  end_of_kd  (RW): ORIGIN = 0x2000FFF0, LENGTH = 0x00000000

  # Boot stack reused by MQX Kernel data

  bstack      (RW): ORIGIN = 0x2000FA00, LENGTH = 0x00000200  # Boot stack

  end_bstack  (RW): ORIGIN = 0x2000FC00, LENGTH = 0x00000000

}

but the same issue it always goes into bootloader code and i am not sure if it is writing the user code to its flash location.

The serial port shows the following log before copying the .afx.s19 file,

CodeWarrior binary file found

FLASHING....

Please do not remove your device

########################

Erasing flash memory...

#######################################################################################################################################################################################################################################

ERASE complete!

        Open Image File

                ERROR......

Unknown file type#

Erasing flash memory...

#######################################################################################################################################################################################################################################

ERASE complete!

        Open Image File

Erasing flash memory...

#######################################################################################################################################################################################################################################

ERASE complete!

        Open Image File

And here is the log when i copy paste the .afx.s19 file to the drive,

"

Flash image file complete!

Press RESET button to enter application mode.

Erasing flash memory...

#######################################################################################################################################################################################################################################

ERASE complete!

        Open Image File

Erasing flash memory...

#######################################################################################################################################################################################################################################

ERASE complete!

        Open Image File

Erasing flash memory...

#######################################################################################################################################################################################################################################

ERASE complete!

        Open Image File

Erasing flash memory...

#######################################################################################################################################################################################################################################

ERASE complete!

        Open Image File

"

Then the drive reappears and shows SUCCESS.TXT file.

Please let me know in which step i went wrong.

Thanks

Pramod

Labels (1)
0 Kudos
5 Replies

1,033 Views
pramodk_g_
Contributor III

Hi All,

Just now i figured out that this issue is only in Windows 8. In windows 8/8.1 when we try to copy and paste the .S19 file it is showing error because as soon as we paste or drag and drop into the drive, the drive disappears and windows shows error in copying. So i assume the image file is not loaded into the flash.

In windows 7, only after the completion of paste operation the drive disappears and the flashing is working. In this case the code is jumping to user application area.

Please let me know what is the issue in Windows 8. Will the provided code work on windows 8 or is it meant for only windows 7 etc?

Also we found that MAC PC is not even recognizing this device as Mass Storage.

Please let us know if there is any version of K70 boot loader code that will work for MAC, Windows 8 and Windows 7.

Thanks

Pramod

0 Kudos

1,033 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi  Pramod,

As I know , there is some problem to get MSD boot loader work with Win 8.1 because Windows 8.1 tries to write some data to the data sector every time it is connected, and boot loader treats it as part of s19 file. please kindly refer to Re: AN3927 USB MSD Bootloader - does it work on Windows 8 or 8.1? for more details.


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,034 Views
pramodk_g_
Contributor III

Hi Kan,

Thanks a lot for your valuable response.

Please let me know if MSD Device boot loader work on MAC PC. When i tried to connect to a MAC PC it is not even recognizing as a mass storage device.

Thanks

Pramod

0 Kudos

1,034 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Pramod,

I am sorry, but I don't have a Mac PC to test that, but per AN , the boot loader  acts as a Pseudo-FAT file system, maybe Mac OS could not recognize it.

Hi dereksnell

would you please help to comment on this issue?


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,033 Views
dereksnell
NXP Employee
NXP Employee

Hi Kan and Pramod,

Sorry, the bootloader example in AN4379 was only tested with Windows. I suspect the USB device enumerates correctly as a mass-storage device, but it’s likely an issue with the Pseudo-FAT as Kan already suggested. One option to get around this is to use a USB sniffer running in the Mac OS, and enumerate a USB flash drive with the same file name as the bootloader. Then enumerate the bootloader, and compare the activity from the sniffer. The Pseudo-FAT could then be updated to clone the USB flash drive.

Thanks

0 Kudos