SPIFI does not work with N25Q256

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

SPIFI does not work with N25Q256

890 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dpliu on Tue Jan 22 21:27:49 MST 2013
The init function seems work well, but the erase and program functions return 0x200003(timeout),
which means N25Q could possible be protected? But the flag register in N25Q shows the protection
has been removed.Why?
Thank a lot.
Labels (1)
0 Kudos
8 Replies

727 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jurrien on Wed Jun 24 00:59:19 MST 2015
About RTOS, I am using a uC with internal flash, but I am still afraid that RTOS will use to much of my RAM memory and or cpu time. Both are quite critical in my application and thus I fear the over head of task management and switching. Is there anyway that the functionality of avoiding 'wait_busy' and a manual check for whether the chip is busy is added to the library (either by someone at NXP, what would make my boss very happy, or by us)?

The flash chip reset and core reset sounds good, I'll look into resetting the flash device and core reset asap, thanks for the support.
0 Kudos

727 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Tue Jun 23 10:01:13 MST 2015
Hi Juririen,
Please see my comments.

Quote:
I am using now this library for a while but there are some issues that start to form a problem. First, if I perform a sector erase, the library is waiting until it is done. However, my device might need to do other things as well. Is there anyway that I might tell the library to not wait until done, but allow me to do other stuff while the flash chip does the erase?



You can use RTOS. Please relocate vector table and interrupt service routines in the RAM in case of Flashless LPC Microcontroller. If you are using LPC Microcontroller with internal flash you can have vector table and interrupt service routines in the internal flash.


Quote:
The second issue is more problematic; my device is capable of performing a firmware upgrade. After the upgrade it is supposed to restart, which I achieve with a software restart. However, after the restart, the communication towards the flash chip starts to fail. If I do a initialization call it returns a 0x200009 status (unrecognized manufacture code). Other calls to the library fail as well, but after a power cycle it works without any problem. Is there a way to 'restart' the API to avoid this behavior? Thanks for any support,



Please reset N25Q256 device before self resetting LPC device.(See link http://www.lpcware.com/content/project/nxp-peripherals/spifi-nxp-microcontrollers)

Also use core reset to reset device
*(volatile unsigned int *)0x40043100 = 0x10400000; //memmap with boot ROM address
*(volatile unsigned int *)0x40053100 =(1<<0); // Core reset
0 Kudos

727 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jurrien on Thu Jun 18 00:28:02 MST 2015
I am using now this library for a while but there are some issues that start to form a problem. First, if I perform a sector erase, the library is waiting until it is done. However, my device might need to do other things as well. Is there anyway that I might tell the library to not wait until done, but allow me to do other stuff while the flash chip does the erase?
The second issue is more problematic; my device is capable of performing a firmware upgrade. After the upgrade it is supposed to restart, which I achieve with a software restart. However, after the restart, the communication towards the flash chip starts to fail. If I do a initialization call it returns a 0x200009 status (unrecognized manufacture code). Other calls to the library fail as well, but after a power cycle it works without any problem. Is there a way to 'restart' the API to avoid this behavior? Thanks for any support,
Best regards,

Jurrien
0 Kudos

727 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jurrien on Fri Feb 20 06:30:13 MST 2015
Hello mc,

I just tried out your example and it works great :-). Thanks a lot!
Kind regards

Jurrien
0 Kudos

727 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Tue Feb 17 16:11:50 MST 2015
Hi jurrien,
The new SPIFI library currently( as of 02/17/2015)  available at http://www.lpcware.com/SPIFI does not support N25Qxx devices. You can add your own devices, please see
page 37/55 of http://www.lpcware.com/system/files/lpclibspifi_1.03_68.pdf

However the old SPIFI lib supports these devices. Please try attached example done using LPCxpresso.

I have also attached flash driver under zip file  LPC18_43_SPIFI_8MB_64KB-New.zip
0 Kudos

727 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jurrien on Tue Feb 17 07:39:38 MST 2015
I am also trying to get the N25Q256 flash chip working with a LPC1837 via the SPIFI. I have tried both the library snehoej pointed to and the LPCOpen libraries, but without any luck.

Please correct me if I am wrong, but when looking at the LPCOpen SPIFI examples, I don't see any support for the Numonyx family at all, which is supported in the library snehoej mentioned (at least according to NXP the smaller flash chip, N25Q128, is; http://www.lpcware.com/system/files/SPIFI_report%20v0.1.pdf). Using the example provided in the LPCOpen download my microcontroller just hangs after it fails to read the flash chip size (spifiGetHandleMemSize() returns 0). But if I look at the initialization function then support for 3 different flash chip families is loaded and non of them includes the N25Qxx chips.

When using the, I guess, older library I don't get the timeout error but a 'Device status error' (0x20005) while trying to erase or program. Initialization goes succeeds without any error. Also, after initialization, I am capable of reading for example the chip size. Does someone has any idea why this could be, and/or does anyone know how to make this work?

Any support would be really appreciated,
thanks in advance

Jurrien
0 Kudos

727 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rgledhill on Wed Apr 30 01:10:33 MST 2014
They've just released the source code of the new version too, on the LPCOpen page for LPC18xx/43xx.
0 Kudos

727 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by snehoej on Tue Apr 29 05:36:13 MST 2014
Old thread, but in case others run into this problem, here is what fixed it for me:

I was apparently using an outdated version of the SPIFI_drv_M3.lib, which I got from my IAR 6.60 install. This lib works fine with Spansion flashes, but exhibits this exact problem with Micron N25Qxx. Spifi_init returns success, but subsequent calls to spifi_program or spifi_erase yields a return 0x20003 (timeout).

I found a newer version of the SPIFI lib on github (https://github.com/openxc/nxp-cdl/blob/master/LPC18xxLib/lib/spifi_drv_M3.lib) which fixed the problem for me. Note that this is an M3 version, but I guess it applies to M4 as well.
0 Kudos