ESP32 Upload stops after 25KB transfer

Try erasing the chip again with esptool, then try some things from Flashing problem · Issue #33 · m5stack/M5Stack · GitHub.

Specifically a lower upload speed and normal flash frequency.

upload_speed = 115200
; this line removed or commented out
;board_build.f_flash = 80000000L

You might also want to try different flash modes (DIO, QIO, DOUT, QUOT) if that could be a problem.