cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 external loader

PFlor.2
Senior

I went through the ST External QSPI Loader how to and have verified my quadspi.c/h driver is good with the Winbond W25Q64 flash part we are using.  However after I create the .stldr and load it into the STM32 Programmer it will not read from the flash...get Error:data read failed.  I've attached the project if someone could help me out with what could be wrong?

13 REPLIES 13

the Loader_Src.c Init() is only called in the entry and resets and initializes the quadspi so I wouldn't think it would need QSPI Abort in there.  The loader does call QSPI Abort before write, erase is done.  Maybe I'm missing something in what you are suggesting.

PFlor2_0-1708048006797.png

 

Since the programmer successfully reads the flash when it initially connects, what does the programmer do when the READ button is pressed that it would fail?  I would think the loader is still in memory mapped mode since the HAL_QSPI_Abort() is only called at the beginning of the Write and Erase functions of the loader.

The loader example I'm using only enables memory mapped mode in the Init and Verify functions, should this be done somewhere else for the READ to work or does the READ just call the Init() of the loader?

PFlor.2
Senior

Found a resolution for this issue...

Apparently the enabling interrupts in the Init() function of the Loader_Src.c provided in the ST repository for the H7 external loader was hanging after it entered this function the first time.  Made the modifications below per ST suggestion...

PFlor2_0-1710859554743.png 

Once this was done however the HAL_Delay() in my QuadSPI drivers would hang (made sense since interrupts are disabled I guess) so I also had to include a local HAL_Delay() function that used NOP instead of ticks.

I added this in my quadspi.c file...

PFlor2_1-1710859743199.png

ST support is still looking into whey the enabling of interrupts is hanging in this case.

 

They need to move to a model that doesn't use interrupts.

If the board is running at 64 MHz, you can enable TIM2 / TIM5, with PSC=64000-1, ARR=0xFFFFFFFF, and you can pull the millisecond count from TIM->CNT

Using HAL_Delay() will make things slow. The HAL_GetTick() should be used to provide a bounding timeout, but functions should return as soon as the device is ready / finished.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..