LPC1820 with Macronix SPI flash

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

LPC1820 with Macronix SPI flash

2,866 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vdelabouere on Thu Sep 04 13:40:45 MST 2014
Hi all,
I have a prototype with a LPC1820 (144 pins package) and a Macronix (Dual mode only) MX25L8006E.

I'm not able to program this flash using the Keil Ulink Pro debugger.
I have tried to modified an existing flash algorithm with the Macronix specs but for now no success.

Is there anyone of has succeeded in programming this flash through the SPIFI interface with a Keil debugger ?

Thanks a lot for your help.
Vincent
Labels (1)
0 Kudos
17 Replies

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vdelabouere on Tue Sep 09 10:55:22 MST 2014
No this algorithm doesn't work for me.

Is it possible that there is a more up-to-date version of this algorithm ?
Thanks

Vincent
0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Tue Sep 09 09:22:00 MST 2014
Hi Vincent,
Did you also check flash driver LPC18xx43xx_S25FL032.FLM algorithm under c:\Keil\ARM\Flash folder?
It should also work.
0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vdelabouere on Tue Sep 09 08:52:56 MST 2014
OK,
I have it working now.

The WP pin on the flash was always active.

With the new algorithm you sent me, everything is working now.

Thanks again for your help.

Vincent
0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vdelabouere on Tue Sep 09 08:36:24 MST 2014
OK,
This time I do see the activity on the SPIFI signals :-)

I can properly erase the flash but when I try to program the flash, I have the following error message :

Flash timeout - Reset the target and try again.

Please see the settings I put inside Keil settings.

Thanks
Vincent
0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DF9DQ on Tue Sep 09 08:17:53 MST 2014
Can you give the attached Keil flash driver a try?

Unzip it to C:\Keil\ARM\Flash  (or C:\Keil_v5\...), then select it as the flash driver for your SPIFI flash in the Project/Options/Utilities tab. ("LPC18xx/43xx SPIFI Basic")

It uses 2-wire communication, and should support the Macronix flash that you have on your board (as well as the Spansion flash on the Keil boards).
0 Kudos

2,460 Views
joeyweng_future
Contributor I

Hi:

I downloaded this file and found it contains .FLM file only. Could you please share the source code? This FLM file uses 2-wire SPI but we need QSPI interface. I guess it could be modified via source code?

Thank you.

0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vdelabouere on Tue Sep 09 06:54:46 MST 2014
No I don't see any activity when using the jtag interface.

So it is either a JTAG hardware issue or a flash algorithm that cannot work properly with the Macronix flash I have...
Thanks

Vincent
0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon Sep 08 13:04:01 MST 2014

Hi Vincent,
Do you see activity on SPIFI data and clock pins when you start programming?
0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vdelabouere on Mon Sep 08 11:08:23 MST 2014
Yes,
I have a 10K to VCC for DBGEN. The debugger is able to properly read the IDCODE of the LPC1820.
It is just the SPIFI flash access that is not working.

Find attached the setting I have for the kei debugger.

Thanks
Vincent

0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon Sep 08 10:11:00 MST 2014
Hi Vincent,
DBGEN pIn should be high to enter in ARM debug mode. I do not see this pin in the part of the schematics you shared with us.
If it is low, controlller will enter in JTAG boundary scan mode.
0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vdelabouere on Fri Sep 05 15:21:03 MST 2014
OK,
I have made some progress.
I have tried to boot in USB DFU mode and use the DFUsec application to program the SPIFI flash on my prototype.
Everything is working fine using this method !

So my SPIFI flash seems to work fine.

So the problem seems to be on the 10 pins-SW Arm debug interface I'm using...
I have attached my debug interface schematic.

Do you see any problem there ?
Thanks



0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Fri Sep 05 13:08:00 MST 2014
Hi Vincent,
Yes, that algorithm supports many devices. Also, if you are booting from QSPI flash you should see activity on CLK and data pins of Serial flash device. For this you do not need to program serial flash device.


Quote:
The Macronix flash I'm using doesn't support quad mode so I wonder if it is the problem.



LPC1820 can boot in QSPI/DSPI or standard SPI mode depending on serial flash device capability.


Hope this helps.
0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vdelabouere on Fri Sep 05 12:39:26 MST 2014
So you mean that I can use the same algorithm for a Macronix flash (MX25L8006E) and a Spansion flash (S25FL032) ?


0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Thu Sep 04 15:05:00 MST 2014
Hi Vincent,
It has nothing to do with quad support. Please check connections between serial flash and LPC1820. You can probe clock/data lines at serial flash pins.
Clock and data lines should change states during programming/erasing.
0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vdelabouere on Thu Sep 04 14:47:48 MST 2014
Hi,
It doesn't work with this algorithm on my side.
The Macronix flash I'm using doesn't support quad mode so I wonder if it is the problem.

The message I see under Keil is :
Error: Flash Download failed  -  "Cortex-M3"

Thanks
Vincent

0 Kudos

2,460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Thu Sep 04 14:35:00 MST 2014
Hi Vicent,
LPC18xx43xx_S25FL032.FLM algorithm under c:\Keil\ARM\Flash folder works. This is Keil default installation path. I have just tested it with LPC1850.

What message do you see?
0 Kudos

1,794 Views
MengadeSantosh
Contributor I

Hi,

I am facing same problem.

on my board, LPC1850 is interfaced with S25FL256 over SPIFI. I want to debug my code in S25FL256 using debugger. I am using ULINK2 debugger.

When I try to program the external flash (S25FL256) using debugger, I have the following error message :

Flash timeout - Reset the target and try again.

Error: Flash download failed - "Cortex M3"

Please check screenshot of my settings in keil attached here. 

I created new flash algorithm for S25FL256 by modifying source code on path c:\Keil\ARM\Flash\LPC18xx43xx_S25FL032.

I added following code in FlashDev.c file and created .FLM file.

struct FlashDevice const FlashDevice =
{
FLASH_DRV_VERS,                                // Driver Version, do not modify!
"LPC18xx/43xx S25FL256 SPIFI",           // Device Name
EXTSPI,                                                   // Device Type
0x14000000,                                            // Device Start Address
0x02000000,                                            // Device Size is 32MB
256,                                                          // Programming Page Size
0,                                                              // Reserved, must be 0
0xFF,                                                        // Initial Content of Erased Memory
500,                                                         // Program Page Timeout 100 mSec
5000,                                                       // Erase Sector Timeout 3000 mSec

// Specify Size and Address of Sectors
0x001000, 0,                                            // sector size 4 KB (32 sectors)
0x010000,0x20000,                                 // sector size 64 KB (510 sectors)
SECTOR_END
};

I dont understand what is wrong. Can you help me to fix this issue??

 

Thanks,

Santosh Mengade  

 

 

0 Kudos