cancel
Showing results for 
Search instead for 
Did you mean: 

H7R3 External Memory Loader Issues - Macronix NOR Flash

UCAC
Associate

Hi!

I have a custom PCB with H7R3Z8T6 & MX25L12833F (16MB Marconix NOR-Flash) hooked up with XSPI1 (Quad SPI). I have been having a very difficult time programming the external memory with the External Loader in CubeIDE.

I have followed a forum post (https://community.st.com/t5/stm32-mcus/how-to-create-an-external-flash-loader-for-an-stm32h7rs/ta-p/742005) as a guide to getting started (also https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs/external_QSPI_loader.html). The only real difference between the guide and my project is I am powering the memory with 3.3V and therefore did not enable HSLV option byte.

My issue is that when I flash the Appli firmware, it fails to verify: (Data mismatch found at address 0x90000002 (byte = 0x00 instead of 0x01). When I read the 0x9... register in CubeProgrammer, it is all zeros until ~0x9003XXXX, after which 0xFFFFFFFF is read (see screenshot below). The extact register where 0xFFFFFF03 is read varies, it changes every time I re-read the memory.

My inital impression was that as long as I had chosen 'Macronix' in the XSPI settings, and configured the clk + other parameters correctly, the auto generated CubeMX external loader & NOR-SFDP would take care of the rest.

Has anyone else experinced anything similar?



3 REPLIES 3
KDJEM.1
ST Employee

Hello @UCAC and welcome to the community;

 

What is the frequency of xspi?
Can you specify which curves you are observing on the oscilloscope?

KDJEM1_0-1755247068338.png

I recommend you to refer to AN5050 precisely 7 OCTOSPI application examples and 8 XSPI application example configuration with STM32CubeMX sections.

Thank you.

Kaouthar

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.

Hi Kaouthar,

Thanks for your information!

The XSPI in this screenshot is running at 133MHz (max for the memory) but I had previously already tried running at lower speeds with little success.

I have taken a look at AN5050 and I'm struggling to differentiate the difference between the example code and the purpose of the External Memory Manager & External Loader middlewares.

UCAC_0-1755282700482.png

My understanding was that the external loader runtime context took care of the programming, and that NOR-SFDP handled the runtime XIP or load and run.

I must admit I am not a firmware guy (actually a mechanical engineer) and my understanding of drivers and HALs are 'vibe' based as they are calling it now.

I guess I asking if I should expect the external loader & manager middlewares to handle the memory programming protocol. Right now the Macronix SPI communication is a complete black box to me, however it seems the datasheet is quite detailed...

With my issue of seeing part 0x00... and 0xFF..., it seems to me I am missing some fundamental idea of erasing/programming it that the default external loader is not taking care of. In your experience, do the external loaders typically 'just work'?

KDJEM.1
ST Employee

Hello @UCAC ;

 

Have you checked the dummy cycle and chip select high time required based on frequency used?

-but I had previously already tried running at lower speeds with little success.

Is the HSLV enabled?

I recommend you to refer to table 74, table 75, table 76 and table 77 in the datasheet and check the maximum frequency allowed for low speeds "00".

 

Thank you.

Kaouthar

 

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.