The voltage across IO0 is 1.2V(When IO0 is not connected to VCC), hence it remains in download mode. But if I swap the esp32 with another, It seems to be working. I'm not sure whether its internal pullup resistor is working or not.
Is there any way that I can fix the bad one by adding an external pullup resistor or by any means? Because it was working previously. and as I told you If I connect IO0 to VCC it seems to be working but then I'm unable to upload the code, I'll have to disconnect each time for uploading the code.
I think the problem has been rectified. I uploaded my previous program along with the data to spiffs. Now voltage across the IO0 seems to be stable as it should be. I was wondering what might have caused this problem and I think most probably corrupt data in spiffs has caused this issue (I might be wrong since I'm a beginner only) but I'd love to know the reason behind it...