Programming AVR with an ESP32 with arduino as ISP

I loaded the arduino as ISP code into an ESP32 to program a atmega328PB over SPI connection. Reset is set to GPIO22 of ESP32. The example sketch does not work. I copied over only the necessary parts (without the preprocessor dependent parts) it worked but after programming the AVR, the ESP32 is kind of stuck somewhere. The response in arduino IDE is like this

avrdude: 1224 bytes of flash verified
avrdude: stk500_recv(): programmer is not responding

The program is uploaded correctly but the code in arduino as ISP doesn't reach the end_pmode() function. I cannot add a serial monitor (as the serial is connected to the PC and being used for programming via arduino as ISP) to figure out where the code is going wrong. any insights would really be helpful

You can try this method:

I have a video about this subject here:

Thanks, but this is using WiFi. I want to use USB. Maybe I will take a look inside the library.

Solved with adding SPI.endTransaction(); before SPI.end(); in the function end_pmode(). ESP32 was freezing on the call of SPI.end()

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.