Solved
We have been using an STM32 U585 with additional external FLASH connected to OSPI1 and external PSRAM connected to OSPI2. This is not on a dev kit, it is our own hardware. The PSRAM is memory-mapped and is using the HyperBus protocol. We have noticed that every once in awhile the PSRAM will skip two bytes while reading from the memory. As this is a memory mapped peripheral, we are reading it via memcpy, and we don't see HAL_OSPI_ErrorCallback or HAL_OSPI_AbortCpltCallback hit. It appears to always skip 2 bytes after the first 8 bytes of the memcpy, and it still transfers the full number of bytes, walking 2 bytes past the end of the desired read. Even stranger, if we immediately issue the same memcpy after detecting this issue, it works correctly on the second attempt.
I have walked through the errata and the datasheets and cannot find a rhyme or reason as to why we would be deterministically dropping bytes like this. It is always the same 2 bytes from the same 20 byte memcpy. It is always corrected on a second read, and there is no indication from the HAL or the hardware that anything has gone wrong.
Does anyone have any insight into what could cause something like that? Any ideas on debugging efforts I could try to further test this, or OSPI settings that might be worth manipulating?
This topic has been closed for replies.
I think we have resolved it, but it's tough to say definitively. If you look in the Errata (STM32U575xx and STM32U585xx device errata - Errata sheet), issue 2.6.7 seems like a possible culprit. (Read data corruption after a few bytes are skipped when crossing a four-byte boundary). One of the recommended fixes for this is to enable the DCACHE, which we have done, and we haven't seen the issue since doing that. Be careful if you do that and you're using STOP2/STOP3, as there is an additional errata item regarding the use of DCACHE when going in and out of stop modes.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
