cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an example driver for the STM32MP157F-EV1 Quad SPI flash for the CM4 core?

DPade.1
Associate III

I am trying to read/write the QuadSPI flash on the EV1 from the CM4 controller. I am able to flash and boot from the QuadSPI memory using STM32CubeProgrammer, but when I try to use QuadSPI init code ported from another ST chip (STM32H750), it hangs during QSPI_EnterFourBytesAddress() -> QSPI_WriteEnable() while auto-polling for the write enable bits. All other commands appear successful under debug until this point (incl. HAL_QSP_DeInit, HAL_QSP_Init, QSPI_ResetMemory, QSPI_EnterQPI, QSPI_AutoPollingMemReady). The chip commands used in these functions appear compatible between the MX25L51245G (EV1) and the MT25TL01G (H750B-DK). There seems no good way to tap the QSPI signals on the EV1 to diagnose if there are any line problems, but I have triple-checked the GPIO init and it SHOULD be right, so I'm not sure how to proceed. Obviously the QuadSPI works since the BootROM can access it...maybe it is just clock tree issues (I am using very basic bare-metal firmware on the A7 to boot the M4).

1 REPLY 1
PatrickF
ST Employee

Hi,

Did you confirm the A7 is not using QUADSPI at same time than M4 ?

I understand the whole clock settings is done on M4 side. Maybe simpler to debug using development (aka engineering) mode (i.e. no boot from Flash).

As far as I know, the QSPI_DummyCyclesCfg() and QSPI_EnterFourBytesAddress() does not work and are not needed for Macronix device.

I think you could try commenting the related lines.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.