LPCXpresso546xx EXTSPI driver error

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

LPCXpresso546xx EXTSPI driver error

2,899 Views
junointegration
Contributor II

Hi,

I have the LPCXpresso546xx/540xx board - with the LPC54018J CPU. I have been testing the samples available using MCUExpresso v11.2.1 for weeks/months now. Was even able to connect some RS232/SPI breakout boards on it. 

However while testing the lpcxpresso54018_spifi_polling_transfer sample application, I can no longer debug and I'm getting this SPI flash error.

junointegration_1-1623893056242.png

Sometimes I get EXTSPI driver rc 88.

Troubleshooting steps I've done (none has fixed it):

- Restarting MCU Expresso; Restarting my OS; Repowering the EVAL Board; Using a different cable; 

- Pressing the ISP0 + Reset button 

- GUI Flash Tool for Programming (same result as above). But when I only Erase->Mass Erase, no error reported afterwards. But still the same error when I debug

-  Flash Magic also giving me an very odd error.

junointegration_2-1623894655171.png

It seems the External Flash cannot be overwritten anymore. 

Actually, a similar thing happened on the first Eval Board I had - that is still unusable at the moment. Am on my second Eval Board now.

If you can provided any tips on how to troubleshoot this further, then it will be very much appreciated. Cheers!

 

Jun

 

 

 

 

Labels (1)
0 Kudos
7 Replies

2,430 Views
mazen
Contributor II

I realize this is an old issue but I'm including this in case it may be helpful to someone else.

I was able to solve this problem by replacing LPC540xx_SPIFI_SFDP.cfx with LPC540xx_SPIFI_GENERIC.cfx.  These were both located in C:\nxp\MCUXpressoIDE_11.5.0_7232\ide\binaries\Flash.

1.  Go to project properties --> C/C++ Build -->  MCU Settings 

2. Under "Memory Details" select the LPC540xx_SPIFI_GENERIC.cfx driver.  You will have to first copy it to your Project or Workspace.

3. After building the project, generate a .bin file from the .axf file by right clicking the .axf file found in the Release folder of the Project then: Binary Utilities --> Create binary

4. In the GUI Flash Tool be sure to select the .bin file not the .axf file.

 

1,973 Views
p_mamatis
Contributor I
Thank You!
Worked fine for me. But attention there are two settings which can be changed related to the flashdriver inside the Memory details. The first one is called "Default LinkServer Flash Driver" and it did not worked for me. The Second one is in the table below. After switching this one to the GENERIC i was able to debug again.
I was also able to switch the flashdriver back to the SFDP for debuging afterwards.
0 Kudos

2,891 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,Jun,

I have tested the example code, no problem on my LPC54018-EVK board. As you know the project run in internal SRAM, so there is not problem to erase/program spifi flash.

Hope it can help you

BR

Xiangjun Rong

xiangjun_rong_0-1623983813140.png

 

0 Kudos

2,885 Views
junointegration
Contributor II

Thanks for your response @xiangjun_rong 

As noted above, everything was working OK for few weeks/months. I have modified and tested several sample sample apps already. And I was able to connect other breakout boards for RS232/SPI testing.

Unfortunately, it just stopped working yesterday with this EXTSPI driver error.

I actually have three of these boards: Board1, Board2, and Board3

Board1 - was working for few weeks then it had an EXTSPI error (I do not recall exact error). After going through some troubleshooting for few days, I decided to use Board2. Board1 is still unusable.

Board2 - was working for few months then it had EXTSPI error again. I decided to post this question in the forum.

Board3 - am using at the moment and is still working. But am a bit concern whether there is an issue on the hardware design on board or something else.

If you can provide any more troubleshooting tips for this EXTSPI driver error  (any commandline tool  that I can run to diagnose), then this will be very much appreciated. 

Thanks!

 

 

0 Kudos

2,886 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Jun,

I copy the readme.txt for the project, it tell you how to generate *.bin file, how to use J-Link to write the *.bin file to spifi flash and copy code from spifi flash to SRAMX and execute from SRAMX.

If you change the *.ld file and run the code in spifi flash directly, I suppose there is problem, because when you run the code in spifi flash directly, you can NOT erase or program a sector for the spifi flash. The correct procedure is program the *.bin to flash and copy it to SRAMX and execute the code in SRAMX and erase/program spifi flash.

Hope it can help you

BR

Xiangjun Rong

 

 

Running the demo
================
This demo is showing SPIFI flash erasing and writing and this demo should only run in SRAMX:

1. Build the demo to generate a bin file.
Note: If need to generate bin file using MCUXpresso IDE, below steps need to be followed:
Set in example Properties->C/C++ Build->Settings->Build steps->Post-build steps->Edit
enbable arm-none-eabi-objcopy -v -O binary "&{BuildArtifactFileName}" "&{BuildArtifactFileBaseName}.bin"

This plainload example linked the vector table to 0x00000000, but program to external flash 0x10000000.

2. Program the bin file to external on board flash via SEGGER J-FLASH Lite(V6.22 or higher):

a. Open SEGGER J-FLASH Lite, select device LPC54S018.

b. Click the 'Erase Chip' to erase the extrenal flash.(if can not success, press SW4 button and reset the board, and try to erase again)

c. Select the bin data file, set the '.bin/Erase Start' address to 0x10000000, then click 'Program Device'
Note: Please use above way to program the binary file built by armgcc tool chain to external flash.
For IAR, KEIL, MCUXpresso IDE, you can use the IDE tool to program the external flash.
The log below shows example output of the spifi example in the terminal window:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SPIFI flash polling example started
All data written is correct!
SPIFI Polling example Finished!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Customization options
=====================

 

0 Kudos

2,861 Views
junointegration
Contributor II

Thanks @xiangjun_rong for the response. Tried it but still same .  More testing notes below.

Have decided to use another sample app (lwip_ping_bm_Samples). I have not modified it and just recompiled it. As noted, I have 3 Evaluations boards:

- 2 boards the OM13098 - both of these stopped working (was working before). The eval board is actually a variation of the OM13098 since it has the LPC54S018 not LPC54628


- 1 board the LPC54S018M-EVK - still working.

The following are the tests I've done using the SEGGER J-Flash-Lite and the Redlink tool.

Using SEGGER J-Flash-Lite with Non-working Board 1

SEGGER J-Flash-Lite reports NO errors if i Just 'Erase Chip'.
However, if I 'Program Device' using the bin file am getting an error. The error displayed is 'Could not Download file'

 

Using SEGGER J-Flash-Lite with Non-working Board 2

SEGGER J-Flash-Lite seems to hangup when I select 'Erase chip'
So did NOT bother testing with 'Program Device' anymore.

Since SEGGER J-Flash-Lite is failing, decided to use the Redlink flash tool crt_emu_cm_redlink flash packaged with MCU Expresso. Generated a batch file from MCU Expresso with the following command:

%MCUX_IDE_BIN%/crt_emu_cm_redlink --flash-load-exec "%MCUX_WORKSPACE_LOC%/lpcxpresso54018_lwip_ping_bm_Samples/Debug/lpcxpresso54018_lwip_ping_bm_Samples.bin" -p LPC54018 --load-base=0x10000000 --vc --flash-driver-reset SOFT --bootromstall 0x40000040 -x %MCUX_WORKSPACE_LOC%/lpcxpresso54018_lwip_ping_bm_Samples/Debug --flash-dir %MCUX_FLASH_DIR0% --flash-dir %MCUX_FLASH_DIR1% --flash-hashing --log FlashLPC.log --debug 4

 

Using crt_emu_cm_redlink On Non-working Board 1, I get this error

Nc: DAP stride is 4096 bytes (1024 words)
Nc: Inspected v.2 External Flash Device on SPI LPC540xx_SPIFI_SFDP.cfx
Nc: Image 'LPC540xx_JEDEC_SFDP Sep 25 2020 10:47:14'
Nc: Opening flash driver LPC540xx_SPIFI_SFDP.cfx
Nc: Using SOFT reset to run the flash driver
Wc: Boot ROM stall address was not accessed (entry caused by Breakpoint - not a Watchpoint) - read watch #1 address 0x40000040
Nc: Flash variant 'JEDEC_SFDP_EF7018' detected (16MB = 256*64K at 0x10000000)
Nc: Closing flash driver LPC540xx_SPIFI_SFDP.cfx
Nt: Connected: was_reset=false. was_stopped=false
Nt: Loading 'lpcxpresso54018_lwip_ping_bm_Samples.bin' Binary 0x10000000 len 0x138F8
Nc: Opening flash driver LPC540xx_SPIFI_SFDP.cfx (already resident)
Nc: Using SOFT reset to run the flash driver
Nc: Flash variant 'JEDEC_SFDP_EF7018' detected (16MB = 256*64K at 0x10000000)
Ec: op ProgramPage (0x10000000, 0x22B8, 0x4000) status 0x1 - driver reported driver error - EXTSPI driver rc 32 (0x20)

Nc: Sectors written: 2, unchanged: 0, total: 2
Nc: Closing flash driver LPC540xx_SPIFI_SFDP.cfx


Using crt_emu_cm_redlink On Non-working Board 2, I get this error

Nc: NXP: LPC54018
Nc: DAP stride is 4096 bytes (1024 words)
Nc: Inspected v.2 External Flash Device on SPI LPC540xx_SPIFI_SFDP.cfx
Nc: Image 'LPC540xx_JEDEC_SFDP Sep 25 2020 10:47:14'
Nc: Opening flash driver LPC540xx_SPIFI_SFDP.cfx
Nc: Using SOFT reset to run the flash driver
Wc: Boot ROM stall address was not accessed (entry caused by Breakpoint - not a Watchpoint) - read watch #1 address 0x40000040
Nc: Flash variant 'JEDEC_SFDP_EF7018' detected (16MB = 256*64K at 0x10000000)
Nc: Closing flash driver LPC540xx_SPIFI_SFDP.cfx
Nt: Connected: was_reset=false. was_stopped=false
Nt: Loading 'lpcxpresso54018_lwip_ping_bm_Samples.bin' Binary 0x10000000 len 0x138F8
Nc: Opening flash driver LPC540xx_SPIFI_SFDP.cfx (already resident)
Nc: Using SOFT reset to run the flash driver
Nc: Flash variant 'JEDEC_SFDP_EF7018' detected (16MB = 256*64K at 0x10000000)
Ec: op ProgramPage (0x10000000, 0x22B8, 0x4000) status 0x1 - driver reported driver error - EXTSPI driver rc 112 (0x70)

Nc: Sectors written: 2, unchanged: 0, total: 2
Nc: Closing flash driver LPC540xx_SPIFI_SFDP.cfx
Ed:05: File 'lpcxpresso54018_lwip_ping_bm_Samples.bin' load failure: Ef(49): Flash driver operation gave error.

On the 3rd board, everything is working OK. The jumpers on the Eval boards are all the same.

Below are some more questions that I hope you can give me some advice on:

1. Can I confirm that these Eval boards are now faulty? If yes, do you have any idea what is the specific component on the Eval board that has become faulty. (Actually - these Eval boards was just working OK not being handled - and it just stopped working)

2. Is there any other way to fix the board or get it working? 

3. Is this a known issue with the Eval boards? Or is this an issue with the LPC54S018 CPU (unlikely - but just asking)?

Thanks again.

0 Kudos

2,856 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Jun,

I suppose that the non-working board has broken down because of SPIFI flash failure. As I said that if you run code in SPIFI flash directly, you can NOT erase/program spifi flash, which may lead to the flash failure. so running the "lpcxpresso54018_spifi_polling_transfer" is not appropriate in SPIFI flash directly, because it erase/program flash sector.

 

Hope it can help you

BR

Xiangjun Rong

0 Kudos