ESP32P4 Odd Flash Issues
Posted: Mon Jul 14, 2025 11:26 pm
Hello,
I am attempting to flash the W25Q128, a 16 MB Winbond flash through the ESP32 P4 on a custom board, but I get some flashing issues that appear to be connected to the /WP and /HOLD lines. I have tried a good few things to diagnose the issue but I am not sure what to try now.
So it first showed itself, as my attempt to flash it through the ESP IDF with the default settings and got "A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption."
After playing around with esptool I was happy to see I could read the status of the flash chip ok, and even read back a block of data. I would just get that error if I tried to write.
I suspected a possible issue with the write protect pin, so I confirmed on the oscope that all pins are indeed getting a signal. But just as a test I added a 10K pullup resistor to WP. This made it so I could write 1 block. Trying to write more and I would get a similar error. Reading back this block now showed my message though (I had just been writing 256 bytes of Hello World.)
So now, I added a pullup to the hold, and I could write a whole segment, but I would get held up by MD5 checksums not matching, and they appeared different each time too.
Removing the pullups, I had a bit of success doing this. For some reason, if you disable the stub, it will attempt to flash, get stuck, loose connection, retry, then succeed. Both qio and dio work too!
```
python3 -m esptool --no-stub --port COM5 write_flash --flash_mode qio 0x100000 hello.bin
```
On the oscilloscope, you can see when it gets stuck that the flash chip is constantly active with the chip select line toggling a lot. So its like it gets a little bit stuck on a command that never completes or something. I do not see any funny business with the power rails or anything resetting or dropping out though. Though I did try a bigger decoupling cap at the flash with no change in results. Lowering the flash frequency had no effect too.
Overall, I am not sure what to think of it. No where can I find does it say pull ups are needed, nor do they really fix it, but I am just very confused on what's actually going on here. Any recommendations on what may help fix this?
I will be looking into it more tomorrow, hopefully I think of some ideas though I have been stuck on this for a bit sadly.
I am attempting to flash the W25Q128, a 16 MB Winbond flash through the ESP32 P4 on a custom board, but I get some flashing issues that appear to be connected to the /WP and /HOLD lines. I have tried a good few things to diagnose the issue but I am not sure what to try now.
So it first showed itself, as my attempt to flash it through the ESP IDF with the default settings and got "A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption."
After playing around with esptool I was happy to see I could read the status of the flash chip ok, and even read back a block of data. I would just get that error if I tried to write.
I suspected a possible issue with the write protect pin, so I confirmed on the oscope that all pins are indeed getting a signal. But just as a test I added a 10K pullup resistor to WP. This made it so I could write 1 block. Trying to write more and I would get a similar error. Reading back this block now showed my message though (I had just been writing 256 bytes of Hello World.)
So now, I added a pullup to the hold, and I could write a whole segment, but I would get held up by MD5 checksums not matching, and they appeared different each time too.
Removing the pullups, I had a bit of success doing this. For some reason, if you disable the stub, it will attempt to flash, get stuck, loose connection, retry, then succeed. Both qio and dio work too!
```
python3 -m esptool --no-stub --port COM5 write_flash --flash_mode qio 0x100000 hello.bin
```
On the oscilloscope, you can see when it gets stuck that the flash chip is constantly active with the chip select line toggling a lot. So its like it gets a little bit stuck on a command that never completes or something. I do not see any funny business with the power rails or anything resetting or dropping out though. Though I did try a bigger decoupling cap at the flash with no change in results. Lowering the flash frequency had no effect too.
Overall, I am not sure what to think of it. No where can I find does it say pull ups are needed, nor do they really fix it, but I am just very confused on what's actually going on here. Any recommendations on what may help fix this?
I will be looking into it more tomorrow, hopefully I think of some ideas though I have been stuck on this for a bit sadly.