2024-12-19 12:34 PM
Background: We have a board that uses Quad SPI on STM32H750 to interface with Macronix MX25L12833F Flash. We are using the flash to support a large firmware image (with XIP).
We are attempting to take this hardware and drop in STM32H733. Doing this will require using the OSPI interface in Quad SPI mode. Specifically OCTOSPI2, using Port 1 (Clk, IO[3:0], NCS).
I'm attempting to port the configuration/setup/driver (using HAL APIs). I've matched the clocking to the flash (133 MHz) from the H750 project. I've been able to read/write the configuration registers using single SPI commands, and I've also been able to read and verify the correct device ID. So I'm communicating with the flash on some level.
However, whenever I try to do quad writes and reads (non-memory mapped at this point), I'm not having any success. Similarly, even single SPI read/writes don't seem to work yet. I've reviewed the documentation, application notes, and examples provided by ST. I initially used the code generation feature of STM32CubeIDE to get a baseline before adding code based on our previous driver and ST code, AN, etc. I haven't been able to scope the hardware yet, that will be my next stop - but I'm looking for anyone that has had experience doing this. Is there a common issue I'm missing? Is there something specific I should be looking at?
Thanks in advance.
Solved! Go to Solution.
2024-12-19 12:46 PM
The OSPI/HSPI/XSPI models are very similar, ST added things to their structures, changed some names, but materially very similar. Make sure to clear local/auto variables, the compiler doesn't by default, and your left with random stack junk.
For the MX25L12833F to get it and the xSPI interface into the appropriate modes for 1,2 and 4-bit modes should be mechanically very similar.
I could make a demo if such thing had sufficient value..
2024-12-19 12:46 PM
The OSPI/HSPI/XSPI models are very similar, ST added things to their structures, changed some names, but materially very similar. Make sure to clear local/auto variables, the compiler doesn't by default, and your left with random stack junk.
For the MX25L12833F to get it and the xSPI interface into the appropriate modes for 1,2 and 4-bit modes should be mechanically very similar.
I could make a demo if such thing had sufficient value..
2024-12-20 12:55 PM
Random stack junk must have been the culprit. I was able to get things working after initializing the HAL structures. Thanks for the help.