cancel
Showing results for 
Search instead for 
Did you mean: 

Octo-SPI external Flash - when i write to memory, when read after writing i get 0xFF

FLuba.1
Associate III

Hi, i have some issues with writing to external flash memory. Read status register etc works wel. Just writing to external memory gives me unexpected result.

I use the following MCU:  STM32L4P5ZGT6P, I use the following external flash memory: Macronix MX25L12833FMI-10G. Instead of using the complet octo-SPI, i use quad-spi,since my external flash only supports quad-spi and Single SPI. i SDR mode.

See attachement for the code(i have extrated the code from my program, all the necessary can be seen in the attachement).

7 REPLIES 7
FLuba.1
Associate III

My code in a .txt format.

Tried to skim the code, bit overly cluttered

Setting SR.QE (0x40) enables the 4-pin physical operation, not the command / address.

I think you need to use 0x35 to switch into 4-bit command mode,or you can use the move verbose forms ie 1-1-4 or 1-4-4

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

The function OctalWriteEnable makes use of the 0x35 command. So i use it. 

One could potentially spend hours picking this apart. Would suggest adding instrumentation to catalogue the command and data level interactions. Would be easier and faster than attaching a logic analyzer and wading through the traces.

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

"One could potentially spend hours picking this apart." Yes, indeed you right. What do you mean with "instrumentation"? 

>>instrumentation?

Output information about what's happening internally, so you can understand what's happening without a debugger, and without single-stepping everything.

You can add whatever level of detail you need to understand they dynamic interactions, ie dump the command, addressing details, the responses, the time it takes for the device to come ready, etc.

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

Hello @FLuba.1,

Could you please provide more context. Did you succeed to start the erasing sequence?

 

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.