USB DFU on the LPCXpresso54018 eval board

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

USB DFU on the LPCXpresso54018 eval board

2,716 Views
mitchkapa
Contributor III

Hello, I am trying to get USB DFU working using the LPCXpresso54018 evaluation board (in order to check out possible firmware update options for an upcoming custom board design) and I am having no success.  This output is I believe the closest I have come to connecting after powering the board with SW4 (ISP0) and SW2 (ISP2) pressed down:

C:\Dev\nxp\LPCScrypt\scripts>boot_lpcscrypt
Booting LPCScrypt target with "LPCScrypt_158.bin.hdr"
LPCScrypt target boot failed:
No DFU capable USB device found

Which is when I am connected to the J3 Full Speed USB port.  On the J2 High Speed port (after moving the jumper JP9) I can only ever get the message "Nothing to boot".  The same "Nothing to boot" message I get on either port if I power the board without having ISP0 and ISP2 LOW.

Any guidance is greatly appreciated.

12 Replies

2,686 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi mitchkapa 

From my understanding, you want to update LPC54018 firmware from on chip USB DFU boot. 

If so, please follow the steps of this article

https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/LPC54XXX-How-To-Use-USB-Port-To-Update-F...

2.1 Use DFU for application upgrade

 

Hope this helps,

Jun Zhang

0 Kudos
Reply

2,680 Views
mitchkapa
Contributor III

Thank you for your reply.  From that linked page I am attempting to do Method 1.  I have made more progress than I previously had but I am getting this error in my attempt.  Do you have information on what this error means?

C:\Dev\nxp\LPCScrypt\bin>dfu-util -l
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Found DFU: [1fc9:001f] devnum=0, cfg=1, intf=0, alt=0, name="RAM"

C:\Dev\nxp\LPCScrypt\bin>dfu-util -D lpcxpresso54s018_lvgl_demo_widgets.bin -a 0
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device... ID 1fc9:001f
Run-time device DFU version 0110
Found DFU: [1fc9:001f] devnum=0, cfg=1, intf=0, alt=0, name="RAM"
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 512
No valid DFU suffix signature
Warning: File has no DFU suffix
bytes_per_hash=5591
Copying data from PC to DFU device
Starting download: [###################################dfu_download: libusb_control_transfer returned -7
Error during download

 

0 Kudos
Reply

2,673 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

Can you please go to 

http://dfu-util.sourceforge.net/

to download the latest DFU tool

DFU update application Steps:

Take LPC54628 as an example, ISP is configured as DUF mode, and USB1 is used to upgrade the application.

  • Modify the relevant code in Figure 3, as follows:

isp_mode[0] = 0xAA; isp_mode[1] = SL_USBHS;

Build and download the application to the MCU, power on again, and connect USB1 to the computer. Here

  • Enter the dfu-util tool directory and copy the .bin file to the current directory.

Use the command: ./dfu-util -l   Find the DFU devices.

Use the command: ./dfu-util -D .\lpcxpresso54628_gpio_led_output.bin -a 0

Download the lpcxpresso54628_gpio_led_output.bin file to the device with alt number 0. Alt0 is "FLASH", alt1 is "RAM", and the specific operations are as follows:

 

My test result:

3.PNG

 

Hope this helps.

Jun Zhang

0 Kudos
Reply

2,666 Views
mitchkapa
Contributor III

Please see the screenshot below.  With the latest version of dfu-util I have output that looks more like yours. But I still have errors.  I have highlighted in the image where things appear to diverge between your output and mine.  Do you have an LPCXpresso54018 eval board where you can attempt this procedure?  I would like to make sure that my different processor is not the cause of the problem.  

Can you also step through the procedure for making the proper binary file for usage with DFU?  How dfu-prefix and dfu-suffix should be used?  And my initial binary I am creating from a .axf file using the IDE Binary Utilities tools.  Is that the correct procedure? dfu-util_output.png

0 Kudos
Reply

2,661 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi 

I test it with LPCXpresso54S018 board, there is no issue

ZhangJennie_1-1656989537824.png

 

Please note, as LPC54(s)018 doesn't have on chip flash, DFU can only download it to SRAM

ZhangJennie_2-1656989711782.png

 

Jun Zhang

 

 

0 Kudos
Reply

2,659 Views
mitchkapa
Contributor III

Thank you very much for confirming the function on the LPC54018.  Can you let me know what steps (if any) need to be taken to prepare the binary file for DFU?

0 Kudos
Reply

2,656 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi 

bin file doesn't include address info. we can just generate bin file inside IDE, right click on the generated axf file to generate bin as below:

ZhangJennie_0-1656999076554.png

Thanks,

Jun Zhang

0 Kudos
Reply

2,651 Views
mitchkapa
Contributor III

Thank you very much for your help.  I was finally able to have some success uploading code via DFU.  But I also think I finally understand that for this processor DFU will not be useful for my intended purpose.  I thought DFU would write "through" the SRAM and program the external flash.  But that is not the case?  For the LPC54018 DFU can only be used to load a binary for a single use instance and on the next reboot it will revert back to the original code in external flash.  Do I have that correct?

0 Kudos
Reply

2,633 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Yes, your understanding is correct.

If you want to program external spifi Flash, you need to program flashloader to sram via DFU then program spifi flash by flashloader. 

I suggest you following this article to implement it.

https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/Use-blhost-to-program-erase-LPC540xxM-LP...

 

0 Kudos
Reply

2,627 Views
mitchkapa
Contributor III

Thank you very much.  I just have one last question.  Is it possible to implement this flashloader/blhost method with a single USB port?  As long as the board/MCU stays powered throughout?  Or it will only work using both USB0 (for DFU) and USB1 (for blhost)?

2,504 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Yes, you can.

1,649 Views
FFOXZ
Contributor III

Hello @ZhangJennie !

I have two questions about this topic.
1) Is the flashloader's default code configured as USB0 to use DFU and USB1 for BLHOST?
2) Would it be possible for you to guide me on how to change the flashloader code to ensure that DFU and BLHOST are performed via the USB0 port? Because I don't have USB1 possible on my custom board.

0 Kudos
Reply