Search code examples
arduinoesp32arduino-idearduino-esp32

ESP32 Arduino upload java.lang.NullPointerException error


I am trying to build the simplest example (blink project) on Arduino 1.8.16 using a ESP32 based board (Espduino compatible). It builds correctly but I am not able to upload to the board. I verified that the CH340 driver is loaded and works (I am able to build and upload the same project using platformio) so seems that the problem is related to Arduino IDE 1.8.x. I tryed both a standard installation and a portable installation but both do not work. I also searched the net for help but until know no solution I found solved the problem.

This is the error I have:

java.lang.NullPointerException at cc.arduino.packages.uploaders.SerialUploader.uploadUsingProgrammer(SerialUploader.java:295) at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:90) at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77) at processing.app.SketchController.upload(SketchController.java:732) at processing.app.SketchController.exportApplet(SketchController.java:703) at processing.app.Editor$UploadHandler.run(Editor.java:2061) at java.lang.Thread.run(Thread.java:748)

any help will be appreciated.


Solution

  • hey man hope this comes good, as a matter of fact is quite cryptic what is happening, i always solve it with changing the port in which my esp-32 is on and then switch it back again to its correct port , ALWAYS WORKS! ;)