Support device with off chip ROM? (LPC1830 with SPIFI)

Started by chuckp, September 09, 2012, 07:53:23 AM

Previous topic - Next topic

chuckp

We've used FlashMagic on the LPC17xx in the past.  These devices have on chip ROM.  We now have an LPC1830 system with off chip SPIFI ROM.  I see the the LPC1850 is in the supported list.  It has on chip ROM.  Is there any way to use FlashMagic with off chip ROM on a device like this?  I assume I will have to build code in to my image, and I don't expect it to work until the device is initially programmed with appropriate code.  But is it reasonable to make FlashMagic work in this sort of system?  If not, I'll be writing something from scratch.

Andy Ayre

The current version of Flash Magic comes with an example external flash bootloader for the Hitex LPC1850 board using the S25FL129P connected via SPIFI.

You will need to adapt the flash programming routines in the example to your specific hardware and it should then work. If you have Keil uVision then it already comes with a library of code for programming external flash which can be trivially reused. Details can be found in the external flash section of the Flash Magic manual.

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

chuckp

Thank you, this sounds promising.
I use the IAR tools, so I will look into adapting things.  I know that NXP releases a SPIFI library with which  I have experimented.

chuckp

Your example downloads over the serial port.  I see that you support Ethernet download on the LPC17xx.  I'd like to bring up something similar on my LPC18xx system.  I have Ethernet support in my program.  If I create this loader, how do I tell FlashMagic that the download should be by Ethernet, not by serial port?  Is there information somewhere about adding support for a device/method?  I don't see it in the user manual, and I did not find a file listing the characteristics of various devices...

Cusko

I have HITEX LPC1850 and I have successfuly uploaded hex file for SPIFI bootloader (from example). But from here on, I don't know what to do. If I want to start bootloader It says : Operation Failed (... no '.' echoed). How can I proceed from there to upload my hex file in to the SPIFI memory  ???
Thanks!

Bostjan

Andy Ayre

You don't manually send the bootloader hexfile - Flash Magic does that for you.

Choose the External Flash / "S25FL129P LPC1850 Hitex" device in Flash Magic.

Follow the instructions shown to connect SV5 and SV1 and set the BOOTn pins.

Then in the main window choose the hex file for your firmware and click on "Start".
Embedded Systems Academy, Inc.
support at esacademy dot com

Cusko

Great. Thank you. This works now. I totally missed this.
But another question. How can I add my own bootloader into this menu?

Andy Ayre

Take one of the examples, copy it and rename it.

Edit the Descriptor structure in FlashPrg.c. You must use a unique name.

Edit FlashPrg.c to support your desired memory devices.

Build and copy the hex file into C:\Program Files (x86)\Flash Magic\Bootloaders

Restart Flash Magic.

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

Cusko

OK, thx. I tried and it worked. I changed from USART3 to USART0. But I had to use ISP button to load the bootloader and then I had to click the start button again to load the rest of the program??? I will now try on my board with LPC1857.
Thanks again.

Cusko

I tried now with LPC1857 and UART0 but it doesn't work. It always writes: failed to autoband. Is problem maybe in bootloader? LPC1850 has v11.1 and LPC1857 has v12.1.
Maybe program loads to RAM but then resets? Can you help me?
If I use Ulink debugger to run bootloader ESAFLASHOS from RAM, I can then load program to spifi using FlashMagic. But this isn't final solution obviously. 

Andy Ayre

In your December 6th posting above you had it working. I presume that is the bootloader that we supply. Now you have modified it and it doesn't work, correct?

Can you program any hex file into the RAM of the device? Autobauding is only for the initial stage of loading the bootloader into RAM. After that autobauding is not required as the external flash bootloader uses a fixed 115200 baud.

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

Cusko

I changed your program before from UART3 to UART0 and it worked for LPC1850 on Hitex board but only if you click start twice. Look in my December 7th posting.
Now I tried with the LPC1857 and UART0. Naturally a program starts from an internal flash if you don't Reset with the ISP pin. If you Reset with the ISP pin a processor go to a bootlaoder mode (I checked with a terminal where I send '?' and I get 'Synchronized');
I can program this processor flash if I select 'LPC1857'.

Maybe I must change some ID numbers or something in your supplied bootloader?
Is it maybe possible to watch data between a processor and the Flash Magic?

Andy Ayre

Embedded Systems Academy, Inc.
support at esacademy dot com

Cusko

I attached the debug file.
But I also looked with serial port monitor what is happening and I think I found the problem.
On my board I have DTR line for reset and RTS line for ISP. And with normal operation the Flash Magic controls this lines to Synchronize.
But when I select an external memory bootloader the 'Hardware Config' option is empty. So I manually Reset with ISP pin high.
Then I clicked Start and device restarted. And in the Serial Monitor I saw the problem. The Flash Magic sets RTS and DTR and then clear first RTS and then DTR. Which is the wrong sequence. So the question is how to set the right sequence?

Cusko

...new tests:
I disable the RTS and DTR lines on my board and I manually RESET with ISP pin high. Then I start the procedure again. The Flash M. sent '?', processor reply 'Synchronized..' then FM raise error for autoband.
I attached the debug log.