Skip to main content
Ayoub Cheggari
Senior
October 19, 2021
Question

[STM32H750BX DK][QSPI] Issue with MT25QL512 Flash Driver

  • October 19, 2021
  • 3 replies
  • 2557 views

Hello All,

I am facing an issue with the Driver for MT25QL512 Flash Memory within the STM32H750DK. I followed the MOOC provided by ST and did the same things but it still times out in the CSP_QSPI_Erase_Chip() during the QSPI_AutoPollingMemReady() call. Sometimes it works but nothing is written in the Memory.

Thanks for your help in advance.

Ayoub

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
October 19, 2021

Depending on the state of the array, and the use/wear a bulk erase can take between 3 and 8 minutes, the timeouts and spin loops need to be accommodating of that.

Also won't work in memory-mapped mode.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Ayoub Cheggari
Senior
October 19, 2021

I was thinking about the same thing so I moved to deal with 1 sector only, but it gives the same result. It is very strange because the other commands work fine but the erase doesn't and once it works (Sporadic Issue), the Readbuffer shows 136 values.

Tesla DeLorean
Guru
October 19, 2021

136 -> 0x88

The memories are little state machines, doing one thing at a time, until completion.

That is more indicative that the erase is still on going, and the only command that's going to work is reading the status register. Check the datasheet, but there's only going to be a very small subset of commands available whilst busy.

The spin loops polling the status register can't just give up and quit midway through. Check everything has appropriate timeouts specified, perhaps add diagnostics/telemetry to output these things so you have a narrative to follow when it fails.

Reseting the STM32 side QSPI peripheral doesn't typically change what the memory device is doing, most implementation you aren't wiring up an async reset pin to regain control. If the memory off doing an 8-minute task, it's going to keep doing that, and you should keep probing the status, or see if there is a suspend type command/operation.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
October 19, 2021

Similarly parts you do reset are apt to revert into default states, which might not be in QPI modes, or with D2/D3 enabled, etc.

A lot of code is set in fixed 1-bit or 4-bit modes, and one needs to be cognizant that both the memory and the MCU have the same idea about the mode each is in.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Ayoub Cheggari
Senior
October 22, 2021

Hello,

I have checked everything, timeouts, registers, preconditions but still doesn't work! what is strange is that I took the same code written by ST developers and shared in one of their MOOCs for the same memory I am using and it doesn't work!

I will keep investigating and update in case it is resolved.

Thanks,

Ayoub

AWęgl.1
Associate II
November 5, 2021

Hello,

I'm facing same problem, can you tell me if you've found a solution?

Ayoub Cheggari
Senior
January 13, 2022

Hello @Andrzej Węglowski​,

Sorry for my late response!

I found the solution. You need to configure the QSPI as dual bank as mentioned in the picture. 0693W00000HrVULQA3.pngIf you check the RM for the STM32H750DK you will find that it has 2 NOR Flashs of MT25QL512 so you need to configure it like that and it worked fine.

Ayoub