Cannot get OCTOSPI example for STM32U575ZI MCU to work
Hello everyone,
I am currently trying to connect a APS51208N PSRAM to a STM32U575ZIT6 using the OCTOSPI interface. I followed the steps for the first example in application note AN5050 (chapter 5.2.5, number 1). However when I step through the program, it goes into hard fault the second it has to read from the OCTOSPI2 memory bank at 0x70000000 (tried the OCTOSPI1 bank at 0x90000000 too, same result). The debugger shows an error when trying to access this memory too.
Additionally, there is a sporadic error when stepping over the EnableMemoryMapped function too, which says "Target is not responding, retrying..." and the debugger becomes non-reponsive. To be more precise, this is the line where the problem occurs (in HAL_OSPI_MemoryMapped):
MODIFY_REG(hospi->Instance->CR, (OCTOSPI_CR_TCEN | OCTOSPI_CR_FMODE),
(cfg->TimeOutActivation | OSPI_FUNCTIONAL_MODE_MEMORY_MAPPED));
I have tested the code on two identical boards with identical results, so I think a faulty MCU can be ruled out.
I have added the project I set up as an attachment. Any hints or solutions would be greatly appreciated.