-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HAL XSPI DTR read 1 byte #16
Comments
Hello @jakubhecko, Thank you for the report. Regarding the issue, could you share your IOC file in order to reproduce the issue. Meanwhile, I have some comments on what you mentioned above:
With regards, |
Hello @KRASTM, see the replies below:
Yes, I had some issues with using DQS for setting up the 1B or 2B registers, so I use DQS only for the longer data transfers, not the memory register access.
I understand that in DTR mode the data is sampled on both edges of the clock line, that is likely why the periph returns 2B when trying to read just one. See the IOC attached, please note, the clock tree might not be up-to-date. |
Hello @jakubhecko, I shared your issue with our team, and they confirmed that an enhancement will be made. Additionally, after reviewing RM0456 on page 1069, Thank you again. |
ST Internal Reference: 196918 |
Fixed in : 007ba83 |
Describe the set-up
Hello,
using custom board with STM32U5F9 MCU, building with Clang/LLVM: 18.1.8.
Connected to a Macronix memory (MX25UM25645GXDI00) connected to the HSPI interface in 8line configuration with DTR+DQS.
Describe the bug (skip if none)
The issue is when using HAL_XSPI_Receive() function when HSPI configured to DTR mode, reading 1 byte leaves a HSPI periph. in a state (the second byte still in the DR register) effectively locking out any future HAL_XSPI read/write operations.
How to reproduce the bug (skip if none)
The unchecked read code is here:
https://github.com/STMicroelectronics/stm32u5xx-hal-driver/blob/e41e0c51f612cd27641e90e3c4f5a7e9388130ff/Src/stm32u5xx_hal_xspi.c#L1401C1-L1414C39
Additional context
I propose putting at the end of the appropriate receive function a check for non-empty FLEVEL and reading out any extra (unwanted) data.
EDIT
Same patch may apply to the HAL_OSPI file as well - functions HAL_OSPI_Receive() and HAL_OSPI_IRQHandler().
Code used for reading 1B
The text was updated successfully, but these errors were encountered: