cancel
Showing results for 
Search instead for 
Did you mean: 

QSPI STRANGE BEHAVIOR WHEN AUTOPOLLING

JCuna.1
Senior

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

16 REPLIES 16

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 Venmo
Up vote any posts that you find helpful, it shows what's working..
JCuna.1
Senior

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.

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 Venmo
Up vote any posts that you find helpful, it shows what's working..

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};

The peripheral make a correct polling and stop when the value match after 7sec, however, in fw code this does not wait the 7 sec. I suppose this is a hal bug. I am using Cube IDE 1.9.0 and Cube H7 1.10.0

The logic analyzer plots look very odd for sure, not sure I have a good explanation yet, but pondering..​

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

I made many attempts repeating the capture of data with my logics analyzer, because I though maybe CS wire is not attached well, But in all my captures of data, the result is the same graphic (CS not releasing).

JCuna.1
Senior

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.

Cross-linking other thread to find later https://community.st.com/s/question/0D53W00001WJOrnSAH/hal-qspi-autopolling-support-4lines

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