2023-08-29 01:06 AM
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).
2023-08-29 01:07 AM
2023-08-29 06:16 PM
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
2023-08-30 01:01 AM
The function OctalWriteEnable makes use of the 0x35 command. So i use it.
2023-08-30 03:55 AM
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.
2023-08-30 04:35 AM
"One could potentially spend hours picking this apart." Yes, indeed you right. What do you mean with "instrumentation"?
2023-08-30 05:48 AM
>>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.
2023-08-31 05:45 AM
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.