ESP32P4 Odd Flash Issues

Sam1102E
Posts: 3
Joined: Mon Jul 14, 2025 10:39 pm

ESP32P4 Odd Flash Issues

Postby Sam1102E » 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.

Sam1102E
Posts: 3
Joined: Mon Jul 14, 2025 10:39 pm

Re: ESP32P4 Odd Flash Issues

Postby Sam1102E » Thu Jul 17, 2025 2:23 pm

Update on the matter.

I got pretty deep into the issue looking at how the boot ROM works, and it turned out to just be a silly mistake with the flash LDO input not being connected to LDO 1, the one I had reserved to power the flash chip.

I can now flash it successfully, but nothing happens when it boots, looks like it detects a valid firmware image, but it does not get far at all before hanging or resetting back to the bootloader. So wo we may not be home free with flash issues, or it could be a new issue.

I may not have time this week to look into it, but I wanted to provide the good news.

Sam1102E
Posts: 3
Joined: Mon Jul 14, 2025 10:39 pm

Re: ESP32P4 Odd Flash Issues

Postby Sam1102E » Thu Jul 24, 2025 3:23 pm

I have good news regarding the remaining issues.

I had ordered the wrong voltage regulators for the core power. I did not notice this issue during early sanity checks, since its works as long as its not under heavy load, and actually begins to overvoltage the ESP32P4 when under load creating a hard to catch fault.

The P4, also does not enable this supply until it really boots; it can actually get quite far without the 1.2V supply in general. Very interesting.

The new regulators are ordered, and powering the P4's 1.2V rail from my benchtop power supply allows it to boot and operate just as expected. Luckily, the P4 does a very good job of immediately disabling the power supply once the voltage gets too high, and was not damaged.

Hopefully, for anyone bringing up a P4 for the first time, this can help with diagnosing such issues, since they were all power-related.

Sprite
Espressif staff
Espressif staff
Posts: 10617
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32P4 Odd Flash Issues

Postby Sprite » Fri Jul 25, 2025 12:29 am

Thanks for posting what the error turned out to be. Since the ESP32P4 is so new, we haven't gotten any reports of people having issues with bringup before, so your info is pretty valuable for helping others in the future.

Who is online

Users browsing this forum: PetalBot, Qwantbot and 4 guests