cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sirius13
Visitor
Visitor
1,236 Views
Registered: ‎06-21-2018

Problems with QSPI (zynq, zedboard, S25FL256S)

Jump to solution

There is board with SoC Zynq-7000, i'm working with qspi flash memory S25FL256S. There is no problem when i program memory with bytecount 4, 8, 12 - amount multiple of 4. 

 

What have i do to program memory with 1, 2 or 3 byte? 

0 Kudos
Reply
1 Solution

Accepted Solutions
sirius13
Visitor
Visitor
1,277 Views
Registered: ‎06-21-2018

The problem was solved. You can not write 1,2,3 bytes in automatic CS management mode. You need to set manual CS, and make next sequence. For example, we use command PP=0x02 with 3 bytes address, and we want to write 1 byte 0xAB at address = 0x01

 

1. Set flash WriteEnable, after execution of WE-command CS must be at 1

2. Set CS to 0

3. XQspiPs_WriteReg(QSPI_BASEADDR, XQSPIPS_TXD_01_OFFSET, 0x02);

4. Execute ManualStart();

5. Wait for TX FIFO empty

6. XQspiPs_WriteReg(QSPI_BASEADDR, XQSPIPS_TXD_00_OFFSET, 0xAA010000);

7. Execute ManualStart();

8. Wait for TX FIFO empty

9. Set CS to 1

10. Life is good

 

Thank's everybody for help :)

View solution in original post

0 Kudos
Reply
3 Replies
smarell
Community Manager
Community Manager
1,205 Views
Registered: ‎07-23-2012
Can you tell me which command do you use for programming?
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
0 Kudos
Reply
sirius13
Visitor
Visitor
1,204 Views
Registered: ‎06-21-2018

Hello my dear. I'm using command with ID = 0x02, this is Page Program with 3 byte for address

 

 

P.S. Please clarify - why does command sequence 

 

XQspiPs_WriteReg(QSPI_BASEADDR, QSPI_TX1, 0x02);
XQspiPs_WriteReg(QSPI_BASEADDR, QSPI_TX1, 0x030000AA);

QSPI_ManualStart() //my own function, initiate start

 

causes programming flash with AA-byte at address=0x03? 

 

An this

 

XQspiPs_WriteReg(QSPI_BASEADDR, QSPI_TX1, 0x02);
XQspiPs_WriteReg(QSPI_BASEADDR, QSPI_TX2, 0x0300AAAA);

QSPI_ManualStart() 

 

causes programming flash with AAAA-bytes at address=0x03? 

0 Kudos
Reply
sirius13
Visitor
Visitor
1,278 Views
Registered: ‎06-21-2018

The problem was solved. You can not write 1,2,3 bytes in automatic CS management mode. You need to set manual CS, and make next sequence. For example, we use command PP=0x02 with 3 bytes address, and we want to write 1 byte 0xAB at address = 0x01

 

1. Set flash WriteEnable, after execution of WE-command CS must be at 1

2. Set CS to 0

3. XQspiPs_WriteReg(QSPI_BASEADDR, XQSPIPS_TXD_01_OFFSET, 0x02);

4. Execute ManualStart();

5. Wait for TX FIFO empty

6. XQspiPs_WriteReg(QSPI_BASEADDR, XQSPIPS_TXD_00_OFFSET, 0xAA010000);

7. Execute ManualStart();

8. Wait for TX FIFO empty

9. Set CS to 1

10. Life is good

 

Thank's everybody for help :)

View solution in original post

0 Kudos
Reply