Programming LPC4370/W25Q80BV

Started by ray, November 17, 2016, 02:29:38 PM

Previous topic - Next topic

ray

We have designed a board based on the Link2.
It uses LPC4370 processor and external flash W25Q80BV.
We are developing code with LPCXPresso and are currently using it with a link2 board to program it using SWD.
We would like to use Flash Magic to program it, but I see no setting to do this.
It should be like programming a Link2 board using a second Link2 board to connect with SWD.
The main difference is that our board is not DFU bootable.
Is there some way to get Flash Magic to program it?

Andy Ayre

When Flash Magic communicates with the Link2 it first checks if the Flash Magic Link2 firmware is already running. So in theory it should be possible to manually program the Link2 with the firmware. You can find it inside the installation.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

ray

#2
Thank you for the reply. I don't quite understand what you mean.
I have the Link2 board connected to the PC with USB. Then I have the Link2 board connected with SWD to our custom board.
I have an intel hex file with the code I want to program.
What settings do I choose to be able to program the custom board ( LPC4370 processor and external flash W25Q80BV on SPIFI)?
I have been trying, but so far have been unsuccessful. And I do not see LPC4370 included in any of the settings.

Andy Ayre

#3
OK, this is fairly involved. Support for your external flash is possibly not available out of the box and you may need to customize one of the existing external flash bootloaders.

The first step is to get the Link2 working with Flash Magic. You should be able to read the part signature.

Assuming your Link2 is not DFU bootable: inside the Flash Magic installation you will find the file SWDLINK2.hex. Program this into your Link2. If you then cycle the power then the LED on the Link2 should be flashing.

Next in Flash Magic choose LPC4350 (for now this is close enough) and for the interface choose "SWD over Link 2".

Are you able to read the signature by going to ISP -> Read Device Signature... ?

We need to add the LPC4370 and we will work on that in the next couple of days.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Andy Ayre

Once you have that working you will need to customize one of the example external Flash bootloaders. Choose the closest one. They can be found inside the Flash Magic installation and are all Keil uVision projects.

The S25F129P LPC18550/LPC4350 Hitex is possibly the closest. This uses a generic SPIFI library written by NXP. I don't know if your external flash part is supported or not.

You will need to modify this external bootloader project. In FlashPrg.c change DESCRIPTOR_BOOTSTRAP_BOOTROM to DESCRIPTOR_BOOTSTRAP_SWDLINK2. This sets the method for how the secondary (external flash) bootloader gets onto your LPC4370.

Check all the other settings in FlashPrg.c to make sure they make sense. Also change the name and description fields.

Compile.

Place the hex file of this secondary bootloader into the Flash Magic installation inside the Bootloaders folder.

Restart Flash Magic and you can now choose to select your secondary bootloader from the External Flash selection of the device database.

Also you can hire us to do all of this, along with testing, if you don't want to get this involved.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

ray

Thank you. I will give it a try and let you know if I need help.