Skip to main content
JCuna.1
Senior
April 29, 2022
Question

QSPI STRANGE BEHAVIOR WHEN AUTOPOLLING

  • April 29, 2022
  • 5 replies
  • 5770 views

I am trying to autopoll wip and wel bit from status register (0x05) in a flash memory when I perfrom a erase process.

The first autopolling operation is correctly, however, the second time that qspi try to autpoll the bits, this does not release CS, and the data is not readed correctly. I am using HAL_QSPI and inmediatlly after perfrom the aupolling hal line, it finish, but the peripheral continue polling the bits forever.

0693W00000LzPE5QAN.png0693W00000LzPF2QAN.png

This topic has been closed for replies.

5 replies

Tesla DeLorean
Guru
April 29, 2022

Make sure sCommand and sConfig are properly cleared, so they don't contain random/unpredictable junk.

 QSPI_CommandTypeDef   sCommand = {0};

 QSPI_AutoPollingTypeDef sConfig = {0};

Do you have a timeout?

Does it throw a timeout error? Does it throw a busy error, or some other failure/error code?

If the QSPI throws a timeout I'm pretty sure you need to use HAL_QSPI_Abort() to stop this, had at least one report, and my code walk scared me as none of the reference/demo code handles this.

Report hqspi.State and hqspi.ErrorCode

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
April 29, 2022
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
JCuna.1
JCuna.1Author
Senior
April 29, 2022

There is not error.

0693W00000LzPMrQAN.pngThe instruction elapse faster than the polling operation of qspi

0693W00000LzPNuQAN.pngpolling operation take 7.1seconds but reach printf take less than 1 sec. Timeout is 60sec (FLASH_EXT_TIME_OUT 1000).

And I still doubting about cs not released after the first polling operation. There is not information related to this behavior in datasheet.

Tesla DeLorean
Guru
April 29, 2022

The red marked section (first post) is it retrying, should be able to modulate that width via sConfig/Interval

Why it's not matching is another matter, and may relate to structure initialization. It looks like the code is trying to match something else, or there is some disagreement about modes or patterns.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
JCuna.1
JCuna.1Author
Senior
April 29, 2022

CLK period is 260ns, so interval is 16 cycles (0x10) which give 4.16us, and the logic analyzer match with this separation between lectures.

And also I initialize variables with zero, but the problem still occuring.

 QSPI_CommandTypeDef   sCommand = {0};

 QSPI_AutoPollingTypeDef sConfig = {0};

JCuna.1
JCuna.1Author
Senior
April 29, 2022

Now, hal_autoplling method wait correctly to the match value (7.1secs).

I change this two lines, from this:

sConfig.Match 	= 0x00;
sConfig.Mask 	= 0x01;
sConfig.StatusBytesSize = 1;

to this:

sConfig.Match 	= 0x0000;
sConfig.Mask 	= 0x0101;
sConfig.StatusBytesSize = 2;

Looks like, the minimum size for statusbytesize parameter is 2.

However, my logic analyzer still showing a CS not releasing after first polling.

Tesla DeLorean
Guru
April 29, 2022

Weird for sure... pretty sure it should work with 1, you'd use 2 for a dual configuration, where you do want both die to complete, and the erase/write are self-timed, so one device is usually done ahead of the other. Full erase of parts can take minutes, definitely hundreds of seconds.

@Imen DAHMEN​  @Amel NASRI​  @STOne-32​  please have someone on the QUADSPI / OCTOSPI validation team look this over, thanks..

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
JCuna.1
JCuna.1Author
Senior
April 29, 2022

W25Q32JV-DTR indicate:

0693W00000LzW7FQAV.png

JCuna.1
JCuna.1Author
Senior
May 4, 2022
Tesla DeLorean
Guru
June 15, 2022

@ChahinezC​ marking for review, I think this was the primary thread, although there may be additional ones within this immediate time period.

Thanks, -Clive

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..