Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uploadUsingProgrammer problems should fail gracefully #10032

Open
tedder opened this issue Apr 11, 2020 · 2 comments
Open

uploadUsingProgrammer problems should fail gracefully #10032

tedder opened this issue Apr 11, 2020 · 2 comments
Labels
Component: Uploading Uploading programs to an Arduino board Type: Bug

Comments

@tedder
Copy link

tedder commented Apr 11, 2020

I sat and looked at this message for a long time, and upgraded my Arduino version, before determing what specific user error I was making- I had the wrong programmer selected. Based on the issues and other Googling I'm not the first person to get this NPE. It would be helpful if there was a better error message in the console, at a minimum.

I assume that targetPlatform is null at this point in the code, so targetPlatform.getProgrammer(..); fails.

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:2047)
	at java.lang.Thread.run(Thread.java:748)

somewhat-related issues: #7412 #7034

tedder added a commit to tedder/Arduino that referenced this issue Apr 11, 2020
Try to test and gracefully fail rather than throwing a NullPointerException.

See arduino#10032 for an example of this exception being thrown.
@per1234
Copy link
Collaborator

per1234 commented Apr 14, 2020

Which programmer did you have selected @tedder?

Which board did you have selected?

@per1234 per1234 added Component: Uploading Uploading programs to an Arduino board Type: Bug labels Apr 14, 2020
@tedder
Copy link
Author

tedder commented Apr 14, 2020

I just spent a lot of time trying to repro this, and I was afraid it was going to be that bane of reported bugs that can't be reproduced. But I got it.

Roughly, I have board support for STM32/ESP32/ESP8266/attiny installed, and have a Pololu AVR programmer connected. I couldn't repro it until I used the "ST-Link (STM32L0)" while on an ATTiny board. I then reproed it with the "STM32 BOOTLOADER (STM32L0)". I then changed my board from an ATTiny back to Arduino Uno and still get the NPE.

So it's clearly something provoked by the STM32 programmer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Uploading Uploading programs to an Arduino board Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants