LPC18xx SPIFI Drivers

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

LPC18xx SPIFI Drivers

Jump to solution
11,305 Views
Anonymous-III
Contributor III

Hi All,

I am using LPC18xx on our custom board. We have connection done properly and code is well developed to communicate with SPI device W25Q16CL (8-pin) using SPIFI.

Now we need connected W25Q256FV (16-pin), but the spifi_init function of SPIFI library gives error and we are unable to Initialize the flash. It shows error (0x02).

Flashing with JTAG to W25Q16CL works properly, but with W25Q256FV gives error as attached below.

Flash W25Q256FV  is listed to support SPIFI drivers, is there any specific change needed to make it work?

Can any one help me make it work?

Thanks

 

  

Labels (2)
0 Kudos
Reply
1 Solution
10,973 Views
Anonymous-III
Contributor III

Hi Felipe,

Thanks a lot for support we were able to solve our problem.

Thanks

View solution in original post

8 Replies
10,974 Views
Anonymous-III
Contributor III

Hi Felipe,

Thanks a lot for support we were able to solve our problem.

Thanks

11,183 Views
Anonymous-III
Contributor III

Hi Felipe, 

Try 1. Using LPCScrypt

As per your suggestion we connected our custom board as below

PC  ----  LPC Link2 {with JP2 connected} ---- custom board {having LPC1833,  P2_7 = low,  P2_9, P2_8, P1_2, P1_1 = low}

but the script is unable to find LPC1833. It showed Nothing to boot. Please find attached Image for same.

Please guide me how to check using LPCScrypt commands.

 

Try 2. Using MCU Expresso

To load Images in LPC1833/external flash we are using MCUexpresso GUI. Please find attached Image GUI to load Image.

 

Try 3. Tried to access IC with program as below

I also tried some basic functions of SPIFI for spifi_init we are getting return value (0x20002). Could you please help me out why such error return code is shown?  

Ideally it should return 0. 

Note:- Try 2, Try 3 are working perfectly with W25Q16CL but not with W25Q256FV.

Thanks

 

0 Kudos
Reply
11,170 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Jigar,

Please check chapter 5 of the LPCScrypt User Guide. There is an example of how to program applications to SPIFI flash. Also you mentioned you pull all the ISP pins low. This is not correct as you will be booting from UART and you need to boot from USB0 as it is required by LPCScrypt.

FelipeGarcia_1-1630538604275.png

Best regards,

Felipe

0 Kudos
Reply
11,156 Views
Anonymous-III
Contributor III

Hi Felipe,

Thanks for your response.

Now we don't need to use  LPCScrypt, as by changing source code of LPC18_43_SPIFI_GENERIC.cfx we generated new .cfx file, using new file we were able to load image in W25Q256FV using JTAG.

Now to access W25Q256FV from our code we need to change SPIFI library.
We are currently using very old SPIFI library in our code which has support to spifi_init functions, but the latest library does not have such functions so only replacing library file (.a/.lib) would not work. Do you know how can we use old library function to support new library what specific change is required?

Thanks

0 Kudos
Reply
11,129 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Jigar,

Unfortunately, such thing is not possible. You will need to use new library completely.

0 Kudos
Reply
11,274 Views
Anonymous-III
Contributor III

Hi Felipe,

Thanks for your response.

I am unable to measure timing due to limitation.

Can you please help me to get out of this issue.

Also one think to note is we have connected W25Q16CL but in logs it shows 

Nc: flash variant 'S25FL016K' detected (2MB = 32*64K at 0x14000000)

and still is working fine. We cannot initiate W25Q256FV with build in library function.

Thanks

How can we change setting of library so that it works as normal SPI rather than quad SPI. Where i need to change to make SPIFI library work according to our requirement.

0 Kudos
Reply
11,263 Views
FelipeGarcia
NXP Employee
NXP Employee

Could you please try using LPCScrypt commands and see if it works or what is the output?

Regards,

Felipe

0 Kudos
Reply
11,286 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Jigar,

I would recommend to check the timing sequence measure the waves of SPI line and compare it with datasheet content of the memory.

Additionally, please note that since LPCScrypt version 2.0 we have migrated away from the use of LPC SPIFI library for the identification and low level programming of QSPI flash devices. LPCScrypt version 2.0 now provides self configuring support for QSPI devices via their SFDP data.You can find more information in the document below.

https://www.nxp.com/docs/en/user-guide/LPCScrypt_User_Guide.pdf

Best regards,

Felipe

0 Kudos
Reply