Go Down

Topic: Failed to write flash memory (Read 1 time) previous topic - next topic

Lyinginbedmon

I'm using an Arduino Nano with an attached rotary encoder LED ring, a compass module, and a GPS minimod, and after most recently connecting the GPS my Nano has ceased to allow uploads, repeatedly giving me the error "failed to write flash memory". Now it only flashes the system LED (#13 output on the Nano, as standard).

I ran the verbose error output and got this back:
Code: [Select]
avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "C:\Users\TIM\Documents\arduino-0022\arduino-0022\hardware/tools/avr/etc/avrdude.conf"

         Using Port            : \\.\COM5
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 57600
avrdude: ser_open(): setting dtr
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: Recv:
         AVR Part              : ATMEGA328P
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PC2
         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     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [81]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [98]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
         Hardware Version: 2
         Firmware Version: 1.16
avrdude: Send: A [41] . [84]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [85]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [86]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [87]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [89]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [04] . [00] . [00] . [00] . [80] . [00]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Send: E [45] . [05] . [04] . [d7] . [c2] . [00]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Send: P [50]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: u [75]   [20]
avrdude: Recv:
################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: Send: V [56] . [a0] . [03] . [fc] . [00]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: V [56] . [a0] . [03] . [fd] . [00]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: V [56] . [a0] . [03] . [fe] . [00]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: V [56] . [a0] . [03] . [ff] . [00]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: reading input file "C:\Users\TIM\AppData\Local\Temp\build2060245639898228065.tmp\sketch_jun25b.cpp.hex"
avrdude: writing flash (3950 bytes):

Writing | avrdude: Send: U [55] . [00] . [00]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Send: d [64] . [00] . [80] F [46] . [0c] . [94] b [62] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [0b] . [04] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [8a] . [00] . [0c] . [94] . [90] . [02] . [0c] . [94] . [8a] . [00] . [00] . [00] . [00] . [00] $ [24] . [00] ' [27] . [00] * [2a] . [00] . [00] . [00] . [00] . [00] % [25] . [00] ( [28] . [00] + [2b] . [00] . [00] . [00] . [00] . [00]   [20]
avrdude: Recv:

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
################################################## | 100% 10.04s

avrdude: failed to write flash memory, rc=-4
avrdude: Send: Q [51]   [20]
avrdude: Recv:
avrdude: Recv:

avrdude done.  Thank you.
Is there any way to resolve this issue? Or does this mean the flash memory of the board is fried and I'll need a new one?

madworm

Please remove all external circuitry (except for the programming adapter) and try again.

retrolefty

Quote
I'm using an Arduino Nano with an attached rotary encoder LED ring, a compass module, and a GPS minimod, and after most recently connecting the GPS my Nano has ceased to allow uploads, repeatedly giving me the error "failed to write flash memory". Now it only flashes the system LED (#13 output on the Nano, as standard).


Is the GPS module (or any external device or component) wiring to arduino pins 0 and 1?

If so that can interfere with the normal USB uploading function used to load new sketches into the board.

Lefty


Lyinginbedmon

Yes, the GPS is wired to the Nano's RX pin. Shall I presume then that I need to upload the sketch before attaching it?

retrolefty


Yes, the GPS is wired to the Nano's RX pin. Shall I presume then that I need to upload the sketch before attaching it?


Yes

Go Up