ATMega328p USBTinyisp Bootloader Java Error

I've spent the day on this one and finally decided I need help. Any help is greatly appreciated. I've done a lot of research so I should be able to detail this well but I am always learning...

Specs:

Windows 10 Surface Pro i7 IDE 1.6.11 Boards build 1.6.13

I have 4 boards with an ATMega328p 16mhz chip that I'm working with. I'm using a Sparkfun AVR programmer with an ICSP Pogo to connect and load to the boards. (USBTinyISP) I can load sketches just fine to 2 of the 4 boards. I decided earlier that the 2 I can't load to must have a problem and may need to have their bootloader code reloaded. (never done bootloader stuff before) I was provided the bootloader hex files and custom boards.txt file and told to unzip it to Documents/Arduino/hardware/. After doing this I had new boards available in Arduino IDE under Tools - Board.

I made sure my Programmer was set to USBTinyISP, selected the custom board and then chose Burn Bootlaoder. Below is what I get whether I have anything connected to the USBTinyISP or not. (remember, I can load things just fine so no problems with the USB drivers, connections, pinouts)

Arduino: 1.6.11 (Windows 10), Board: "HoloProjector I2C FHP (Blue)"

java.lang.NullPointerException at cc.arduino.packages.uploaders.SerialUploader.burnBootloader(SerialUploader.java:360) at processing.app.Editor.lambda$handleBurnBootloader$11(Editor.java:2752) at java.lang.Thread.run(Thread.java:745) Error while burning bootloader.

Here's what I know:

  1. Arduino IDE doesn't have any problems when I select a predefined board even without connection (I get errors but they all make sense)
  2. I've tried multiple configurations in boards.txt (current is below)

fhp.name=HoloProjector I2C FHP (Blue) fhp.upload.tool=avrdude fhp.upload.protocol=arduino fhp.upload.maximum_size=32256 fhp.upload.maximum_data_size=2048 fhp.upload.speed=115200 fhp.bootloader.tool=avrdude fhp.bootloader.low_fuses=0xFF fhp.bootloader.high_fuses=0xDE fhp.bootloader.extended_fuses=0x05 fhp.bootloader.file=holoprojector/hp_i2c_fhp.hex fhp.bootloader.unlock_bits=0x3F fhp.bootloader.lock_bits=0x0F fhp.build.mcu=atmega328p fhp.build.f_cpu=16000000L fhp.build.core=arduino fhp.build.variant=standard

  1. I've made sure any anti-virus is shut down
  2. I've uninstalled and reinstalled Ardiuno IDE (current version after disable of anti-virus)
  3. I've uninstalled and installed Arduino IDE 1.0.6 and tried and got the same results
  4. I've downloaded the nightly and ran it to see what would happen and got the same results
  5. I put the custom board files on a different machine and got the same results
  6. Whether the board is connected or not doesn't seem to matter at all
  7. Disconnecting the programmer also yields the same result

Deductive logic has failed me and now I have no idea what to do.

Please

tmorgan: I was provided the bootloader hex files and custom boards.txt file and told to unzip it to Documents/Arduino/hardware/.

Is that all that was in the zip file? It would be helpful is you would attach it to a message here(click the "Reply" or "Preview" button and an "Attachments and other options" link appears).

This boards.txt is not correctly formatted for installation in Documents/Arduino/hardware/. It looks like either the person who wrote it never bothered to do even minimal testing or else it was intended to be pasted into the Arduino AVR Boards package. You could do that but I don't recommend it because you will need to redo it over again everytime you install a new Arduino AVR Boards/Arduino IDE version.

Without the full package I can't do complete testing but I think if you change your boards.txt to this it should work:

fhp.name=HoloProjector I2C FHP (Blue)
fhp.upload.tool=arduino:avrdude
fhp.upload.protocol=arduino:arduino
fhp.upload.maximum_size=32256
fhp.upload.maximum_data_size=2048
fhp.upload.speed=115200
fhp.bootloader.tool=arduino:avrdude
fhp.bootloader.low_fuses=0xFF
fhp.bootloader.high_fuses=0xDE
fhp.bootloader.extended_fuses=0x05
fhp.bootloader.file=holoprojector/hp_i2c_fhp.hex
fhp.bootloader.unlock_bits=0x3F
fhp.bootloader.lock_bits=0x0F
fhp.build.mcu=atmega328p
fhp.build.f_cpu=16000000L
fhp.build.core=arduino:arduino
fhp.build.variant=arduino:standard

Adding the arduino: before the components that are not included in the HoloProjector package tells the Arduino IDE to get these from the arduino core instead. Those missing components were the reason for the error you were getting.

Thanks so much for the reply. I updated my boards.txt file to match what you have but now the Arduino IDE won’t load at all. It crashes on “preparing boards” and doesn’t open completely. I’ve attached the ZIP file I was given. I do know I had to move the boards.txt file in order for the IDE to see the boards. The ZIP structure wasn’t correct.

HPs.zip (26.8 KB)

I can't reproduce it but I also don't know how you have installed it. Please attach the folder as you have it installed and attach it.

Thanks pert for helping me. Attached is the exact structure and exact files. The file path is:

C:\Users\tmorgan\Documents\Arduino\hardware\HPs\bootloaders\holoprojector where the boards.txt is in the HPs folder and the hex files are in the holoprojector folder.

hardware.zip (21.6 KB)

The folder structure was wrong, in fact I don’t understand why it ever even showed up in the Tools > Board menu for you with that structure. It didn’t for me. I fixed the folder structure, corrected a mistake I made on the protocol, and fixed where you had forgotten to add the arduino reference to the variant values for the other two boards, which probably wouldn’t have mattered if you’re only using blue. The updated folder is attached, just replace your current folder with the one attached.

As to why the Arduino IDE won’t start, I can’t reproduce this. You may have a separate issue. If that issue persists after installing this new version try moving the HPs folder out of the hardware folder and see if the IDE will start then. That will show whether the HPs boards package is the cause of the issue.

hardware.zip (21.8 KB)

pert!!! you did it! I'm able to load these just fine now. I'm so thankful you took the time to help me. It really means a lot.

Glad it’s working! Now there’s still a minor issue that’s easy to fix but completely optional. When you compile you’ll see a warning:

Warning: Board HPs:avr:rhp doesn't define a 'build.board' preference. Auto-set to: AVR_RHP
Warning: Board HPs:avr:fhp doesn't define a 'build.board' preference. Auto-set to: AVR_FHP
Warning: Board HPs:avr:thp doesn't define a 'build.board' preference. Auto-set to: AVR_THP

That can be safely ignored but it gets kind of annoying if you’re trying to watch for other errors/warnings. You can fix it by updating boards.txt to:

# See: http://code.google.com/p/arduino/wiki/Platforms

##############################################################

fhp.name=HoloProjector I2C FHP (Blue)
fhp.upload.tool=arduino:avrdude
fhp.upload.protocol=arduino
fhp.upload.maximum_size=32256
fhp.upload.maximum_data_size=2048
fhp.upload.speed=115200
fhp.bootloader.tool=arduino:avrdude
fhp.bootloader.low_fuses=0xFF
fhp.bootloader.high_fuses=0xDE
fhp.bootloader.extended_fuses=0x05
fhp.bootloader.file=holoprojector/hp_i2c_fhp.hex
fhp.bootloader.unlock_bits=0x3F
fhp.bootloader.lock_bits=0x0F
fhp.build.mcu=atmega328p
fhp.build.f_cpu=16000000L
fhp.build.core=arduino:arduino
fhp.build.variant=arduino:standard
fhp.build.board=AVR_FHP

##############################################################

thp.name=HoloProjector I2C THP (Red)
thp.upload.tool=arduino:avrdude
thp.upload.protocol=arduino
thp.upload.maximum_size=32256
fhp.upload.maximum_data_size=2048
thp.upload.speed=115200
thp.bootloader.tool=arduino:avrdude
thp.bootloader.low_fuses=0xFF
thp.bootloader.high_fuses=0xDE
thp.bootloader.extended_fuses=0x05
thp.bootloader.file=holoprojector/hp_i2c_thp.hex
thp.bootloader.unlock_bits=0x3F
thp.bootloader.lock_bits=0x0F
thp.build.mcu=atmega328p
thp.build.f_cpu=16000000L
thp.build.core=arduino:arduino
thp.build.variant=arduino:standard
thp.build.board=AVR_THP

##############################################################

rhp.name=HoloProjector I2C RHP (Green)
rhp.upload.tool=arduino:avrdude
rhp.upload.protocol=arduino
rhp.upload.maximum_size=32256
rhp.upload.maximum_data_size=2048
rhp.upload.speed=115200
rhp.bootloader.tool=arduino:avrdude
rhp.bootloader.low_fuses=0xFF
rhp.bootloader.high_fuses=0xDE
rhp.bootloader.extended_fuses=0x05
rhp.bootloader.file=holoprojector/hp_i2c_rhp.hex
rhp.bootloader.unlock_bits=0x3F
rhp.bootloader.lock_bits=0x0F
rhp.build.mcu=atmega328p
rhp.build.f_cpu=16000000L
rhp.build.core=arduino:arduino
rhp.build.variant=arduino:standard
rhp.build.board=AVR_RHP

##############################################################

That just sets the same build.board values that the Arduino IDE already sets automatically so it doesn’t change anything except to fix the warning.