I'm using EVB LPCXpresso54628 and I'm experimenting DFU for in-field firmware upgrade through USB and a host PC.
When I reset the target MCU with ISP0 and ISP2 pushbuttons pressed, the bootloader starts in USB0 DFU mode and I can read/write FLASH thorugh standard dfu-util.exe tool.
dfu-util-static.exe -a FLASH -D firmware.bin --reset
In my final application I will have a SPI Flash connected to SPIFI peripheral and I need to write to this SPI Flash (and to internal FLASH) during firmware upgrade.
ROM Bootloader supports only FLASH and RAM, but I need a third section SPIFLASH. I don't think it's possible to configure ROM Bootloader with SPIFLASH section.
What is the best solution to this?
Starbucks Menu Australia
Hi,
The LPC546xx has on-chip flash which can save code and data and you can run code in on-chip flash directly, I do not know why you need to connect spi flash to save code.
Anyway, I agree with you that you can not use on-chip ROM bootloader if you want to connect external SPI flash and save the code in external spi flash. In bootloader mode, FC3 is configured as spi slave mode, so that external host spi in master mode can write image to on-chip flash of LPC546xx.
FC3_SCK PIO0_0
FC3_SSELO PIO0_1
FC3_MISO PIO0_2
FC3_MOSI PIO0_3
If you do want to connect external spi flash, you can develop a second bootloader, after Reset, the second bootloader is run, in the bootloader, you can set the spi in master mode, read code and data from the spi flash to internal SRAM, and run in internal RAM.
Hope it can help you
BR
Xiangjun Rong
I do not know why you need to connect spi flash to save code.
Because internal Flash is not big enough for my data. I don't save code, but constant big data on external Flash (short audio streams, bitmaps, fonts and so on).
If you do want to connect external spi flash, you can develop a second bootloader, after Reset, the second bootloader is run, in the bootloader, you can set the spi in master mode, read code and data from the spi flash to internal SRAM, and run in internal RAM.
Is it possible to develop a second bootloader that uses DFU over USB0 as an upgrade mechanism? Is it possible to create a custom memory space (SPIFLASH) over DFU? Do you have example?
Hi,
I have checked the USB example, the SDK does not have DFU class example code, you have to develop it yourself.
BR
XiangJun Rong