Sample Code needed: rom USB Host, MSC, IAP for LPC54608

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

Sample Code needed: rom USB Host, MSC, IAP for LPC54608

1,793 Views
patrickhudson
Contributor III

We have a In Application Programming (IAP) requirement where the new firmware image is on a USB flash drive plugged into a USB Host Connector (usb 1) on our custom pcb.

We're using mcuxpresso and a LPC54608

Is there a code example for reading the USB Flash Drive via the drivers in rom?

We have the iap code executing out of RAM but need to read the USB.

Thanks,

Patrick

0 Kudos
5 Replies

1,147 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Patrick,

The MSC ROM code is for device and what you want is to implement this as a host. 

For what you want to do, you need a secondary bootloader, this way the bootloader will implement the USB Mass Storage Host and make the calls to the IAP function that are located in RAM. 

Regards,

Victor.

0 Kudos

1,147 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Patrick,

You want to make a bootloader with the USB, right? In the SDK for the LPC54608 you can find plenty of USB examples. And for the bootloader you can use the next application note for the LPC18xx as a guide. Application Note  

Hope it helps!

Victor.

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

0 Kudos

1,147 Views
patrickhudson
Contributor III

Hello,

There are no rom usb host examples in the SDK.  There is one rom usb device but we require host (to read from an attached usb flash drive)

The remaining usb examples in the sdk are for using the non-rom usb stack and drivers that is located in the application image (which is lost once the flash is erased).

Thanks,

Patrick

0 Kudos

1,147 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Patrick,

In the user manual of the LPC54608 (UM10912) in chapter 41 you can see that the ROM code only supports device classes:

  • Communication Device Class (CDC) device class.
  • Human Interface Device (HID) device class.
  • Mass Storage Device (MSC) class.
  • Device Firmware Upgrade (DFU) class.

Also in the application note attached before in section 3.1 you will find the next information:

Both the secondary USB Host bootloader and the user application reside in the flash. Therefore, for the secondary USB Host bootloader to flash the user application without modifying any of its own code, the user application should be flashed starting at the next available sector.

So the example of rom usb host example is not possible. The best wait to implement the bootloader as you want is to segregate the Flash memory to have in one segment your application an in another segment the bootloader.

Regards,

Victor.

 

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

0 Kudos

1,147 Views
patrickhudson
Contributor III

Victor,

As you've stated, 

In the user manual of the LPC54608 (UM10912) in chapter 41 you can see that the ROM code only supports device classes:

  • Communication Device Class (CDC) device class.
  • Human Interface Device (HID) device class.
  • Mass Storage Device (MSC) class.
  • Device Firmware Upgrade (DFU) class.

Therefore, since rom usb supports MSC, what we're proposing is possible.  We do not wish to implement the firmware upgade via a custom bootloader but instead wish to implement it in IAP.  We have the iap code running in ram and erasing the flash.  We need help in reading the usb flash drive via the rom in the iap code.

Thank You,

Patrick

0 Kudos