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