Verification error when uploading to ATMEGA1284p

Hello

I'm developing a custom board, it includes an TQFP ATMEGA1284p, an ESP8266, also a sim800L module

I bootload the 1284p before solder it to the board. The board has serial and reset pin headers so I can upload sketches to it via FTDI

It is working, but suddenly, it stopped uploading sketches, it just worked for a couple of times. Now when I try to upload, receive error

avrdude: verification error, first mismatch at byte 0x0000
         0x14 != 0x0c
avrdude: verification error; content mismatch

Full response bellow

I readed some posts recommending reload the bootloader when this error happens. The pcb has no headers pins for this purpose (I never thought I'll neeed), so I managed to solder cables to do so (see picture attached), I'm sure no bridges, but I can't get it to work

I'm using a 16Mhz resonator and have no oscilloscope

Please any advice .. help ?

Thanks

P.D.: sorry I was not allowed to upload image

El Sketch usa 1216 bytes (0%) del espacio de almacenamiento de programa. El máximo es 130048 bytes.
Las variables Globales usan 9 bytes (0%) de la memoria dinámica, dejando 16375 bytes para las variables locales. El máximo es 16384 bytes.
/home/mauricio/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude -C/home/mauricio/.arduino15/packages/MightyCore/hardware/avr/2.0.1/avrdude.conf -v -patmega1284p -carduino -P/dev/ttyUSB1 -b115200 -D -Uflash:w:/tmp/arduino_build_16702/Blink.ino.hex:i 

avrdude: Version 6.3, compiled on Jan 17 2017 at 06:01:25
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/mauricio/.arduino15/packages/MightyCore/hardware/avr/2.0.1/avrdude.conf"
         User configuration file is "/home/mauricio/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB1
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega1284P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 6.2
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: reading input file "/tmp/arduino_build_16702/Blink.ino.hex"
avrdude: writing flash (1216 bytes):

Writing | ################################################## | 100% 0.13s

avrdude: 1216 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_16702/Blink.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_16702/Blink.ino.hex:
avrdude: input file /tmp/arduino_build_16702/Blink.ino.hex contains 1216 bytes
avrdude: reading on-chip flash data:

Ha ocurrido un error mientras se enviaba el sketch
Reading | ################################################## | 100% 0.12s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x14 != 0x0c
avrdude: verification error; content mismatch

avrdude done.  Thank you.

Have you got the right baud rates selected ( not sure if this is the problem, but might help ?)

Hmm, it looks like serial line is not stable. I think, in case of incorrect baud rate (the bootloader vs -b parameter) it will not to be able write anything.
I would try another USB/serial transceiver. Is there something other on Rx Tx pins?

Hello, many thanks for your answers

@hammy, I just went with the default baud rate, from the tools menu (Arduino IDE 1.8.0), I can't see how to set upload baud rate ...

@Budvar10, I will try to resolder the serial comm pins today later, I've found, on same board, other pins poorly connected. Also, yes, there is other thing connected to RxTx (an ESP8266), but I set jumpers on these lines, to let me communicate with one or the other. Also set a jumper on te reset line, which is shared by all IC/modules. And, SIM800 module is connected to Rx1Tx1, which I think was attached when problem happened, I can remove it easily but didn't ... grr

I will try re soldering this afternoon

thanks !!

Hello

No changes, I've re soldered serial comm pins but issue persists

I'm wondering ...

  1. load the bootloader again may be a solution ? ... I've tried to do so, with an UNO, no luck
  2. what is the cheapest way to do it ?
  3. may I bootload the ATMEGA1284p with an USBASP module ?
  4. do I need windows to do this (I'm ubuntu guy) ?

Any recommendation is very welcome

Thanks

  1. You can read out the flash, eeprom, fuses, lock and compare it with files and setup you've used.
  2. Use of existing board e.g. see my banner: Arduino clone with ATmega1284P
  3. Sure.
  4. Not, it works with the Lnx as with Win. Personally, I'm using XP or Mint.

Just a thought are you using a crystal - this may not be the problem , but ..... I had read that without the frequency can drift , which affects baud rate and can give errors .
I’m using 16MHz and have uploaded with the ICSP connection ok, using a USBtiny programmer.