0

I'm experimenting a strange problem. when uploading code to my custom designed arduino (it's based on the CH340 usb to ttl) uploads the firmware without problems but most of the times fails to read back the the flash.

The sketch seems to be uploaded ok, it works as expected, it seems it's only failing to verify the memory after upload and only when using the USB, if I upload via ISCP it uploads and verifies OK.

The micro I'm using was a blank one which I burn the bootloader in it , could it be something realted to the fuses?

AVRDUDE output:

Launching: C:\Users\marcp\eclipse\cpp-oxygen\eclipse\arduinoPlugin\packages\arduino\tools\avrdude\6.3.0-arduino9/bin/avrdude -CC:\Users\marcp\eclipse\cpp-oxygen\eclipse\arduinoPlugin\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:\Users\marcp\Dropbox\Source\RiegoMatic\HDO.RiegoMatic.Locker.Firmware/Release/RMLockerFirmware.hex:i 
Output:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "C:\Users\marcp\Dropbox\Source\RiegoMatic\HDO.RiegoMatic.Locker.Firmware/Release/RMLockerFirmware.hex"
avrdude: writing flash (6684 bytes):

Writing | ################################################## | 100% 1.13s

avrdude: 6684 bytes of flash written
avrdude: verifying flash memory against C:\Users\marcp\Dropbox\Source\RiegoMatic\HDO.RiegoMatic.Locker.Firmware/Release/RMLockerFirmware.hex:
avrdude: load data flash data from input file C:\Users\marcp\Dropbox\Source\RiegoMatic\HDO.RiegoMatic.Locker.Firmware/Release/RMLockerFirmware.hex:
avrdude: input file C:\Users\marcp\Dropbox\Source\RiegoMatic\HDO.RiegoMatic.Locker.Firmware/Release/RMLockerFirmware.hex contains 6684 bytes
avrdude: reading on-chip flash data:

Reading | 
avrdude: stk500_paged_load(): (a) protocol error, expect=0x10, resp=0x00
avrdude: stk500_cmd(): programmer is out of sync
avr_read(): error reading address 0x0000
    read operation not supported for memory "flash"
avrdude: failed to read all of flash memory, rc=-2
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00

avrdude done.  Thank you.

The execution of command "6.3.0-arduino9/bin/avrdude" is done.

enter image description here

enter image description here

UPDATE:

  • Included schematic
  • I'm using the default arduino 1.8.8 bootloader included with the IDE
  • Added fuses current setup
  • what bootloader do you use? – Juraj Jan 13 at 19:00
  • And please show you schematic and board layout. – Majenko Jan 13 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.