High everyone,
I have a strange problem. I am hoping yuu guys will be able to help me.
I have 3D printer with a custom board (atmega2560). This board can only be programmed through the ISP connector. Not through the USB connection (the usb connection is really unstable. Probably bad board design). I have been programming this board for a long time with USBAsp programmer on the ISP connector with the ArduinoIDE software. This works every time.
I currently trying to get platformIO for this custom board. However, I have problems uploading the firmware with the USBAsp programmer. This is the error I am getting.
Writing | ################################################## | 100% 74.27s avrdude: 131012 bytes of flash written avrdude: verifying flash memory against .pio/build/usbasp/firmware.hex: avrdude: load data flash data from input file .pio/build/usbasp/firmware.hex: avrdude: input file .pio/build/usbasp/firmware.hex contains 131012 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 50.02s avrdude: verifying ... avrdude: verification error, first mismatch at byte 0x0000 0x04 != 0x0c avrdude: verification error; content mismatch avrdude done. Thank you. *** [upload] Error 1
At the moment the error is like this.
avrdude: verification error, first mismatch at byte 0x0002
0x40 != 0x41
avrdude is right. The program does not work. Even if the program blink_led does nog word.
The program does work if I use the ArduinoIDE to upload the program.
These are the platformio.ini settings that I am using.
[env:usbasp] platform = atmelavr board = ATmega2560 framework = arduino upload_protocol = usbasp ; each flag in a new line upload_flags = -Pusb
I also tested some other things. The following things do work:
- Uploading firmware from platformIO through USB straight to a UNO
- Uploading firmware from platformIO through the USBAsp programmer to a UNO
- Uploading firmware from ArduinoIDE through the USBAsp programmer to the custom board atmega2560
These are the fuses of the atmega2560 custom board.
avrdude: safemode: Fuses OK (E:FD, H:D9, L:FF)
Any help would be appreciated