LPC1857 SPIFI flash loader for Micron N25Q256A

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1857 SPIFI flash loader for Micron N25Q256A

3,090 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brightcloud on Thu Apr 03 01:39:22 MST 2014
Hi NXP supporters,

Because of the PCBA space limitation, we have to use 32MB QSPI flash N25Q256A.
It's listed in the LPX18xx user manual that N25Q256 could be supported by SPIFI.

I'm using IAR6.40.x, there needs to setup flash loader for loading SW into QSPI flash.
Using the FlashLPC18xx_SPIFI.out generated from FlashLPC18xx_SPIFI project from IAR installer src folder.
I got following error:
[color=#f03]Thu Apr 03, 2014 10:51:08: Flash loader: Failed to setup call to 'FlashInit'[/color]

Using the FlashLPC18xx_43xx_SPIFI.out from lpcOpen V2.09, IAR just reported flash loader error without anymore information.
I also used FlashLPC18xx_43xx_SPIFI.board/flash/mac file according my HW.

As the SPIFI driver supplied .lib file only, it's really quite difficult to find the problem.
Does there have any problem in the flash loader project file?
Or does there have any hints to solve the problem?


标签 (1)
0 项奖励
回复
8 回复数

2,845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Wed May 14 11:03:53 MST 2014
Hi All,
Please make sure that you are using library version V103. You can use api call  spifi_get_version() to know the version number of the old SPIFI library. I have also attached the header.
0 项奖励
回复

2,845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by snehoej on Tue Apr 29 05:40:41 MST 2014
FYI I had this exact problem with the Micron N25Q flash on LPC1857. It turns out it was caused by me (and the IAR 6.60 flashloader) using an old version of SPIFI_drv_M3.lib.

The IAR flash loader fails because spifi_erase returns 0x20003 (timeout) with Micron flashes. It works fine with Spansion. I have attached the SPIFI lib version which fixed this error for me. Recompile the IAR flash loader with this lib instead, and the error should be fixed.

0 项奖励
回复

2,845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brightcloud on Sun Apr 20 21:00:08 MST 2014
Hi Mc,

Using the flash loader FlashLPC18xx_43xx_SPIFI.out supplied by bavarian, i could download FW into FL256SAIF00 using J-LINK but not on N25Qxx.
Because of our project time reason, we decided to go FL256SAIF00.

I still got some small problem using FL256SAIF00.
I got Warning: Stack pointer is setup to incorrect alignment. Stack addr = 0xAAAAAAAA.
The SW executing is still correct. But It seems that there have read protection.

Some more debug details in attchment Debug_Log_LPCware.txt.

Another problem is that i used IAR6.40 generated the flash loader .out file by myself. But it could not work.
The SPIFI spifi_drv_M3.lib 'm using is from lpcopen_2_04.
My code are in the attachment. Maybe you could help me point out the problem.

Thanks a lot of your help.

0 项奖励
回复

2,845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Fri Apr 18 07:10:00 MST 2014
Hi brightcloud,
LPC1857 supports N25Qxx devices. The only problem is when you reset LPC18xx microcontroller while executing from QSPI flash.LPC18xx microcontroller may not boot first time. This is because LPC18xx microcontroller and QSPI flash are out of sync. LPC18xx/LPC43xx boot ROM does not support unique reset sequence of this QSPI flash deivce.

LPC18xx/LPC43xx always boot when QSPI flash and LPC18xx/LPC43xx are coming from reset.

Please post the code used by you,I make it work.
0 项奖励
回复

2,845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brightcloud on Fri Apr 18 00:04:49 MST 2014
I could make 32MB SPIFI work using Spansion FL256SAIF00.
Micron n25a256a could not work anyway, maybe LPC1857 could not support it at all.

I got a warning during loading FW via J-LINK:
Fri Apr 18, 2014 11:07:16: Warning: Stack pointer is setup to incorrect alignment. Stack addr = 0xAAAAAAAA
0 项奖励
回复

2,845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Fri Apr 04 02:35:00 MST 2014
I checked the example again and found some nasty behaviour.

All files for flash programming provided in the "Debugger" settings point to this directory:

.\LPC1850 SPIFI\LPC1850-SPIFI-Example\LPC1850-SPIFI-Example\LPC18xx\Tools\Flash Utility\IAR

[list]
  [*]  FlashLPC18xx_43xx_SPIFI.board
  [*]  FlashLPC18xx_43xx_SPIFI.flash
  [*]  FlashLPC18xx_43xx_SPIFI.mac
  [*]  FlashLPC18xx_43xx_SPIFI.out
[/list]

But when you then dive a little bit deeper in the GUI settings, you see that the settings in the files get somehow overruled:

[img]C:\Users\dep00717\Desktop\Picture1.png[/img]

The path goes to the toolkit directory and not as specified in the board file to the local flash file.
This is then also visible in the log. The mac file and the out file from the toolkit dir is loaded, instead of the files specified in the local config files.



Fri Apr 04, 2014 12:11:03: Loaded macro file: C:\Users\dep00717\Programs\IAR Systems\EWARM-6.7\arm\config\flashloader\NXP\FlashLPC18xx_SPIFI.mac 
Fri Apr 04, 2014 12:11:04: JLINK command: ProjectFile = C:\MCU_SW\Reference-Projects\LPC18xx-43xx\LPC1850 SPIFI\LPC1850-SPIFI-Example\LPC1850-SPIFI-Example\LPC18xx\Examples\GPIO\Gpio_LedBlinky\EWARM\settings\Gpio_LedBlinky_SPIFI 64MB Debug.jlink, return = 0 
Fri Apr 04, 2014 12:11:04: Device "LPC1850" selected (65536 KB flash, 96 KB RAM). 
Fri Apr 04, 2014 12:11:04: DLL version: V4.80g, compiled Feb 13 2014 20:50:02 
Fri Apr 04, 2014 12:11:04: Firmware: J-Link LPC-Link 2 compiled May 31 2013 17:31:46 
Fri Apr 04, 2014 12:11:04: JTAG speed is initially set to: 32 kHz 
Fri Apr 04, 2014 12:11:04: TotalIRLen = 4, IRPrint = 0x01 
Fri Apr 04, 2014 12:11:04: Found Cortex-M3 r2p1, Little endian. 
Fri Apr 04, 2014 12:11:04: FPUnit: 6 code (BP) slots and 2 literal slots 
Fri Apr 04, 2014 12:11:04: TPIU fitted. 
Fri Apr 04, 2014 12:11:04: ETM fitted. 
Fri Apr 04, 2014 12:11:04: ETB present. 
Fri Apr 04, 2014 12:11:05: Hardware reset with strategy 1 was performed 
Fri Apr 04, 2014 12:11:05: Initial reset was performed 
Fri Apr 04, 2014 12:11:05: Found 1 JTAG device, Total IRLen = 4: 
Fri Apr 04, 2014 12:11:05:  #0 Id: 0x4BA00477, IRLen:  4, IRPrint: 0x1 CoreSight JTAG-DP 
Fri Apr 04, 2014 12:11:05: ----- execUserFlashInit 
Fri Apr 04, 2014 12:11:06: 10112 bytes downloaded and verified (45.09 Kbytes/sec) 
Fri Apr 04, 2014 12:11:06: Loaded debugee: C:\Programs\IAR Systems\EWARM-6.7\arm\config\flashloader\NXP\FlashLPC18xx_SPIFI.out 
Fri Apr 04, 2014 12:11:06: Target reset 
Fri Apr 04, 2014 12:11:06: Downloaded C:\MCU_SW\Reference-Projects\LPC18xx-43xx\LPC1850 SPIFI\LPC1850-SPIFI-Example\LPC1850-SPIFI-Example\LPC18xx\Examples\GPIO\Gpio_LedBlinky\EWARM\SPIFI 64MB Debug\Exe\Gpio_LedBlinky.out to flash memory. 



However, in my environment the configuration is somehow consistent and works fine in the context of this example.

The board file you are refering to in this directory

    .\LPC1850 SPIFI\LPC1850-SPIFI-Example\LPC1850-SPIFI-Example\LPC18xx\Examples\GPIO\Gpio_LedBlinky\EWARM

is there, you found it and looked into it, but in fact it is not used.

You should not need to take any sources for the flash loader application from this directory:

    .\LPC18xx-43xx\LPC1850 SPIFI\LPC1850-SPIFI-Example\LPC1850-SPIFI-Example\LPC18xx\Tools\Flash Utility\IAR\FlashLPC18xx_43xx_SPIFI

The existing out file is doing the job here in my environment and should do it in yours as well.
Any compilation of the source project adds further uncertanties to the problem.

I attached the required files from my 6.70 config directory, you can put them into your environment and give it a try.

Here is a description of the IAR flash loader application, maybe it helps to understand where the problem is:

http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/FlashLoaderGuide.pdf

What I can't fully exclude is the difference in the EWARM version, but I'm rather sure that my example is from the times where I used version 6.40, so it worked with this version the same way as it works today with the 6.70 (even if the settings are a little bit confusing).

Regards,
NXP Support Team
0 项奖励
回复

2,845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brightcloud on Thu Apr 03 23:56:35 MST 2014
Thanks for the answer.

In your example, LPC18xx_SPIFI_0x14.board point to $TOOLKIT_DIR$\config\flashloader\NXP\FlashLPC18xx_SPIFI.flash.
I got following error message:
Fri Apr 04, 2014 14:42:00: ----- execUserFlashInit
Fri Apr 04, 2014 14:42:00: 10240 bytes downloaded and verified (40.16 Kbytes/sec)
Fri Apr 04, 2014 14:42:00: Loaded debugee: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.4\arm\config\flashloader\NXP\FlashLPC18xx_SPIFI.out
Fri Apr 04, 2014 14:42:00: Target reset
Fri Apr 04, 2014 14:42:00: Flash loader: Failed to setup call to 'FlashInit'"

I checked the IAR6.40 FlashLPC18xx_SPIFI project, found that the .icf file is not correct.
It would cause Failed to setup call to 'FlashInit' problem.

Then i changed .board file using flash file $PROJ_DIR$\..\..\..\..\Tools\Flash Utility\IAR\FlashLPC18xx_43xx_SPIFI.flash
I got following error, without more detail
Fri Apr 04, 2014 14:50:53: Loaded debugee: C:\work\Studying\NXP\SPIFI\LPC1850-SPIFI-Example\LPC18xx\Examples\GPIO\Gpio_LedBlinky\EWARM\..\..\..\..\Tools\Flash Utility\IAR\FlashLPC18xx_43xx_SPIFI.out
Fri Apr 04, 2014 14:50:53: Target reset
Fri Apr 04, 2014 14:50:53: The flash loader program reported an error.


0 项奖励
回复

2,845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Thu Apr 03 06:46:20 MST 2014
I can't reproduce things with EWARM 6.40 anymore, my license is active for a newer version.
But I found a project from this time which still works fine on my 6.70, so I expect that it works as well under 6.40.
It programs a Blinky project into the qSPI devices used on the Hitex and the Keil board
Check it out if it works for you, I assume that it is just a setup problem in EWARM

Regards,
NXP Support Team
0 项奖励
回复