Dear LPC Tech Support,
Can you/your team help verify whether this demo code SPIFILIb_tst on LPCOpen package works out of the box on the LPC-4330 Xploer board with LPC-link2?
lpcopen_2_20_lpcxpresso_ngx_xplorer_4330
LPXpresso 8.2
Spifilib_tst
I have one bad 4330 board so I couldn’t debug the board.
My customer claims that the debugger locked up when running the spifiInit(...) function
Regards,
hy
Hi Hy Mai,
I'm afraid we don't have the LPC4330XPLORER board at hand neither.
You can apply for one from the inventory.
Hi Eric,
I have a LPC4330-XPLORER board. I tried the same LPCOpen example project and I'm getting the same behavior, the application can't execute past the spifiInit(...) function. I believe this has something to do with the SPIFI.1 Errata for the Rev. A devices, but shouldn't the 60-second boot time-out fix this if running standalone?
Thanks in advance for your response!
Best Regards,
Carlos Mendoza
Hi Carlos,
Thanks for your support.
From your email, i saw the customer uses Rev C part.
Could you help debug this issue on your board, and give some detailed descriptions on this?
So we can give advices accordingly.
Also you can find the open souce code of the SPIFILIB from the NXP web site.
Make sure you use the latest lib.
Hello Eric,
Thanks for your response.
I have one question, which SPIFILIB release should I use? Is it the one that comes in the latest LPCOpen package 2.20?
Or the standalone releases of the library?
I have tried using the lpcspifilib example that comes with the latest LPCOpen package 2.20 for the NGX Explorer board, the problem occurs on the LPCSPIFILIB library initialization, the MCU hangs on that instruction forever:
This is the information I get on the terminal, the SPIFI clock seems to be correctly setup to run around 1MHz:
Thanks in advance for your response.
Best regards!
Carlos Mendoza
Hi Carlos,
Seems the spifilib used in lpcopen_2_20_lpcxpresso_ngx_xplorer_4330 is V0.05.
It's too old.
You can replace the lib file with the file in the lpcopen_2_20_keil_iar_ngx_xplorer_4330 package, which is supposed to be V1.01.
If it's still doesn't work, then use the latest V1.03 in the web site and try to debug with the source file instead of lib.
Hello Eric,
Thanks for your response.
I have tried using the lpcspifilib example that comes with the latest LPCOpen package 2.20 for the NGX Explorer board and the standalone spifilib 1.03, the problem occurs on the LPCSPIFILIB library initialization, the MCU hangs on the SPIFI controller reset :
This is the information I get on the terminal:
Thanks in advance for your response.
Best regards!
Carlos Mendoza
Hi Carlos,
I can't say for sure why it's hanging there since i don't have a NGX board here.
But I tried the LPCOpen 2.20 spifilib_tst project on the LPC4357 MCB board.
Both the V0.05 and V1.03 spifilib initialization works fine.
So i don't think this is the spifilib's issue.
Hello Eric and Hy,
Thanks for your response.
After reviewing the LPCSPIFILIB documentation I saw the following statement:
If you are using a SPIFI FLASH device as a execute-in-place memory for your LPC device, you can’t use the SPIFI library if it’s located in SPIFI FLASH. To use the library in this case, the library needs to be relocated to another memory (like IRAM) and the functions executed from there.
So as a quick test I edited the MCU settings in the project properties and removed the SPIFI Flash region so the code will run from RAM:
Clicked on Apply then OK:
And rebuild the project, after this the project was able to run successfully:
Hope this helps!
Best regards,
Carlos Mendoza
Hi Carlos,
your solution works fine, but I can't use it. My program resides in external flash (spifi connected) and the code runs directly from there. One sector of the flash is reserved to store configuration data, so I have the need to write it while the program is still running from the memory itself. The solution would be to copy in ram the spifi library code that is responsible to write data in flash and then execute it from ram. Is the spifi library able to do this ? or is this situation not implemented in the spifi library ?
Thanks in advance.
Hi Maurizio,
This situation was not implemented in the library so you will have to implement this workaround on your project, relocate the library to another memory (like IRAM) and execute the functions from there.
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer
Thank you Carlos. I was hoping that the library was already doing it...but ok, I'll manage it.
Thanks carlosmendoza for the update