S32K341 QuadSPI

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

S32K341 QuadSPI

Jump to solution
2,226 Views
Mateusz_K
Contributor II

I want to use external flash with S32K341. I am trying to read id of the external flash memory. When I try to do using IP command, I get stuck waiting for SR[BUSY] flag to become 0. Data, cs, and clk lines quiet. Data lines are in a high state, clk is low. I want to use internal FIRC. 

What steps duirng the initialization am i missing? 

1. QuadSPI clock enable in MC_ME

2. Pin setup, copied from the example in RTD package, considering S32K342 quad spi.

3. Enable QuadSPI by MCR module

4. Unlocking LUT, writing sequence (cmd(0x9F), read, stop) on 0 index, locking LUT

5. Starting by writing address 0x00 to SFAR and 0 to IPCR[SEQID], 4 to  IDATSZ

 

Why are the no signal on data lines? 

0 Kudos
Reply
1 Solution
2,203 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Why you are not using NXP drivers?

A driver is a part of RTD FLS drivers pack (real-time time flash driver, supporting internal flash as well as QuadSPI):
https://www.nxp.com/design/software/automotive-software-and-tools/real-time-drivers-rtd:AUTOMOTIVE-R...

Otherwise there is an appnote dealing with QuadSPI:

https://www.nxp.com/docs/en/application-note/AN12193.pdf

QuadSPI is highly configurable module because it uses look-up tables for SPI commands what should theoretically allow user to adapt the code to any SPI memory.

View solution in original post

0 Kudos
Reply
2 Replies
2,204 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Why you are not using NXP drivers?

A driver is a part of RTD FLS drivers pack (real-time time flash driver, supporting internal flash as well as QuadSPI):
https://www.nxp.com/design/software/automotive-software-and-tools/real-time-drivers-rtd:AUTOMOTIVE-R...

Otherwise there is an appnote dealing with QuadSPI:

https://www.nxp.com/docs/en/application-note/AN12193.pdf

QuadSPI is highly configurable module because it uses look-up tables for SPI commands what should theoretically allow user to adapt the code to any SPI memory.

0 Kudos
Reply
2,193 Views
Mateusz_K
Contributor II

Thank you for the answer. I am communicating with the device with through ARM DAP. I am relaying on the drivers but not using them. 

I managed to properly initialize the device. Now I want to read the ID of the Ext flash. I am sending proper command, and getting right answer. RBSR register shows that new data appeared in the buffer. But when I read the RDBR register there is no data in them. 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1865456%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K341%20QuadSPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1865456%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20want%20to%20use%20external%20flash%20with%20S32K341.%20I%20am%20trying%20to%20read%20id%20of%20the%20external%20flash%20memory.%20When%20I%20try%20to%20do%20using%20IP%20command%2C%20I%20get%20stuck%20waiting%20for%20SR%5BBUSY%5D%20flag%20to%20become%200.%20Data%2C%20cs%2C%20and%20clk%20lines%20quiet.%20Data%20lines%20are%20in%20a%20high%20state%2C%20clk%20is%20low.%20I%20want%20to%20use%20internal%20FIRC.%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20steps%20duirng%20the%20initialization%20am%20i%20missing%3F%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20QuadSPI%20clock%20enable%20in%26nbsp%3BMC_ME%3C%2FP%3E%3CP%3E2.%20Pin%20setup%2C%20copied%20from%20the%20example%20in%20RTD%20package%2C%20considering%20S32K342%20quad%20spi.%3C%2FP%3E%3CP%3E3.%20Enable%20QuadSPI%20by%20MCR%20module%3C%2FP%3E%3CP%3E4.%20Unlocking%20LUT%2C%20writing%20sequence%20(cmd(0x9F)%2C%20read%2C%20stop)%20on%200%20index%2C%20locking%20LUT%3C%2FP%3E%3CP%3E5.%20Starting%20by%20writing%20address%200x00%20to%20SFAR%20and%200%20to%20IPCR%5BSEQID%5D%2C%204%20to%26nbsp%3B%20IDATSZ%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EWhy%20are%20the%20no%20signal%20on%20data%20lines%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1867156%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K341%20QuadSPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1867156%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20for%20the%20answer.%20I%20am%20communicating%20with%20the%20device%20with%20through%20ARM%20DAP.%20I%20am%20relaying%20on%20the%20drivers%20but%20not%20using%20them.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20managed%20to%20properly%20initialize%20the%20device.%20Now%20I%20want%20to%20read%20the%20ID%20of%20the%20Ext%20flash.%20I%20am%20sending%20proper%20command%2C%20and%20getting%20right%20answer.%20RBSR%20register%20shows%20that%20new%20data%20appeared%20in%20the%20buffer.%20But%20when%20I%20read%20the%20RDBR%20register%20there%20is%20no%20data%20in%20them.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1866312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K341%20QuadSPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1866312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhy%20you%20are%20not%20using%20NXP%20drivers%3F%3C%2FP%3E%0A%3CP%3EA%20driver%20is%20a%20part%20of%20RTD%20FLS%20drivers%20pack%20(real-time%20time%20flash%20driver%2C%20supporting%20internal%20flash%20as%20well%20as%20QuadSPI)%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fsoftware%2Fautomotive-software-and-tools%2Freal-time-drivers-rtd%3AAUTOMOTIVE-RTD%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdesign%2Fsoftware%2Fautomotive-software-and-tools%2Freal-time-drivers-rtd%3AAUTOMOTIVE-RTD%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EOtherwise%20there%20is%20an%20appnote%20dealing%20with%20%3CSPAN%3EQuadSPI%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12193.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12193.pdf%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EQuadSPI%20is%20highly%20configurable%20module%20because%20it%20uses%20look-up%20tables%20for%20SPI%20commands%20what%20should%20theoretically%20allow%20user%20to%20adapt%20the%20code%20to%20any%20SPI%20memory.%3C%2FP%3E%3C%2FLINGO-BODY%3E