LPC5460x firmware ISP DFU - host example

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

LPC5460x firmware ISP DFU - host example

Jump to solution
1,939 Views
cybaluke
Contributor III

Hi, I'm working on LPC54608 or LPC54606, the firmware is made with two binary files (a secondary bootloader and a main application) in internal Flash memory and a third part of the code is stored in the external SPIFI flash memory (MX25L128).

I have to develop an application with MS VisualStudio for the firmware upgrade (for our customers and for the production too) to program via UART DFU mode the three .bin files on internal flash and in the spifi external flash, so I have some questions:

  1. is there an application example or a code example (in C++) for the DFU routines to manage the ISP protocol for LPC5460x?
  2. the DFU routines for the ISP could works also via USB (UM10912 on Table5.ISP modes display a USB DFU mode but I can't find other references)?  Is there any example about the ISP protocol for LPC5460x via USB (for a PC host application C++ coding)?
  3. Now I'm working with the secondary bootloader after its first program to manage the spifi write, but are there any other fastest programming modes for the internal flash and spifi external flash programming?

thanks

Labels (3)
0 Kudos
1 Solution
1,432 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cybaluke,

   Thank you for your updated information, and sorry for my later reply because of Chinese Mid-Autumn Festival.

  1. Is this correct? is it changed from previous LPC devices?

    Yes, it is correct, it is using the plain binary format. Not the UU-encoded format which in the old LPC UART ISP.

  2. program the internal flash have problems.

   Because you do the write RAM and copy RAM to flash, do you do the UART ISP initialization at first?

  pastedImage_1.png

Actually, we have an application note about how to process the UART ISP function:

https://www.nxp.com/docs/en/application-note/AN11229.pdf 

Although it is not for LPC5460X, but you still can refer to it. Just note, the code format is plain binary format.

I recommend you can refer to the application note, also use the UART terminal to test it directly, instead of your own PC software.

If you still have problems, just give me the according terminal information, then I will check it and test it on my side.


Have a great day,
Kerry

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

View solution in original post

0 Kudos
3 Replies
1,432 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cybaluke,

      Unfortunately, until now, we still don't have the directly LPC5460X secondary bootloader for your reference.

   1.  But about the UART secondary bootloader, you can refer to the AN10995 flow:

    https://www.nxp.com/docs/en/application-note/AN10995.zip 

     This application is using the XMODEM-1K protocol to download the app firmware.

    2.  About the USB secondary bootloader, you can refer AN10866:

     https://www.nxp.com/docs/en/application-note/AN10866.zip 

   3. About the programming modes for the internal flash

     Except the IAP mode, maybe the external debugger or programmer download is more faster, but your secondary bootloader must to use the IAP to program the internal flash.

Wish it helps you!


Have a great day,
Kerry

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

1,432 Views
cybaluke
Contributor III

Thanks Kerry for the answer,

but I still have some urgent problems on UART ISP protocol for the LPC5460x:

Following the UM10912 manual:

5.4.4 USART ISP data format
   The data stream is in plain binary format.

Is this correct? is it changed from previous LPC devices?

I'm trying to program the internal flash of the LPC5460x in ISP mode from my Host app via UART but I have some problems writing bin data in internal RAM.

Is this the right  command sequence to write for example 256bytes of .bin data in RAM @20000200 (and after in internal FLASH)? :

step 1 send     -> W 536871424 256\r\n                   //Send Write in RAM command @0x20000200

step 2 wait for -> W 536871424 256\r\n0\r\n            //Echo + CMD_SUCCES

step 3 send     -> 256 row binary data (not converted in ASCII or UUencoded)   (should I receive a echo also for every byte?)

step 4 wait for ->  wait the answer: which is the right format of OK answer for a W command should I expect?

step 5 send     -> P 0 0 \r\n                            //Prepare sector 0

step 6 wait for -> P 0 0\r\n0\r\n                      //Echo + CMD_SUCCES

step 7 send     -> C 0 536871424  256\r\n     //write 256 bytes starting from RAM 0x20000200 to internal FLASH 0x00000000

step 8 wait for -> C 0 536871424  256\r\n0\r\n          //Echo + CMD_SUCCES

Moreover, is there an error on example of  UM10912-Table20 (shold be inverted destination and souce addresses)?

Example

"C 536903680 196608 512 <CR><LF>" This example copies 512 bytes from the RAM starting at address
0x2000 8000 to flash starting at address 0x0003 0000.

The above sequence crash after step 3 I can't understand how to transfer the raw bin data...

0 Kudos
1,433 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cybaluke,

   Thank you for your updated information, and sorry for my later reply because of Chinese Mid-Autumn Festival.

  1. Is this correct? is it changed from previous LPC devices?

    Yes, it is correct, it is using the plain binary format. Not the UU-encoded format which in the old LPC UART ISP.

  2. program the internal flash have problems.

   Because you do the write RAM and copy RAM to flash, do you do the UART ISP initialization at first?

  pastedImage_1.png

Actually, we have an application note about how to process the UART ISP function:

https://www.nxp.com/docs/en/application-note/AN11229.pdf 

Although it is not for LPC5460X, but you still can refer to it. Just note, the code format is plain binary format.

I recommend you can refer to the application note, also use the UART terminal to test it directly, instead of your own PC software.

If you still have problems, just give me the according terminal information, then I will check it and test it on my side.


Have a great day,
Kerry

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

0 Kudos