Skip to content

Image download with out rebuilding

neilh edited this page Jan 3, 2019 · 4 revisions

Summary

For an already built and saved image, can repeatedly download the same image to multiple loggers/Mayflys with avrdude.exe

prog_mayfly.bat mayfly_v0.19.2b.nh_190102_firmware.hex

This means only need to customize the microSD: mayfly.ini for each unqiue logger, to show on the cloud as a unique logger.

Description

For an already built image, stored say in location "\Documents\Arduino\env03\release".
Use avr tools "avrdude" to download to logger/Mayfly.

This can be on the same computer in the office as normally used, OR copy the .hex to a computer that is going to the field with the avrdude utility On a Win10 the avr-dude is found here: .platformio\packages\tool-avrdude and it needs avrdude.exe and avrdude.conf

Create prog_mayfly.bat

I create a batch file,"prog_mayfly.bat" that is fixed to USB Port COM10 (you need to determine your own system, or remove it if only one USB com port) and has the following in it

---begin prog_mayfly.bat, has two lines----------------------
rem prog_mayfly <nam.hex>
c:\users<user acc>.platformio\packages\tool-avrdude\avrdude -v -p atmega1284p -C C:\Users<user acc>.platformio\packages\tool-avrdude\avrdude.conf -c arduino -b 57600 -D -P "COM10" -U flash:w:%1:i
---end----------------------

or if copied to another computer only need

---begin prog_mayfly.bat, has two lines----------------------
rem prog_mayfly <nam.hex>
avrdude -v -p atmega1284p -C avrdude.conf -c arduino -b 57600 -D -P "COM10" -U flash:w:%1:i
---end----------------------

program logger

An example useage from a cmd prompt is
...user prompt..\Documents\Arduino\env03\release>prog_mayfly.bat mayfly_v0.17.2b.nh_190102_firmware.hex

avrdude: Version 6.3, compiled on Sep 12 2016 at 17:24:16
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\neilh77\.platformio\packages\tool-av   

     Using Port                    : COM10
     Using Programmer              : arduino
     Overriding Baud Rate          : 57600
     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                       Pol
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadB
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ------
       eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0
       flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0

     Programmer Type : Arduino
     Description     : Arduino
     Hardware Version: 3
     Firmware Version: 6.0
     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.02s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "mayfly_v0.17.2b.nh_190102_firmware.hex"
avrdude: writing flash (75712 bytes):
Writing | ################################################## | 100% 24.00s

avrdude: 75712 bytes of flash written
avrdude: verifying flash memory against mayfly_v0.17.2b.nh_190102_firmware.hex:
avrdude: load data flash data from input file mayfly_v0.17.2b.nh_190102_firmware.hex:
avrdude: input file mayfly_v0.17.2b.nh_190102_firmware.hex contains 75712 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 22.54s

avrdude: verifying ...
avrdude: 75712 bytes of flash verified

avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.

..user prompt\Documents\Arduino\env03\release>

More on AvrDude utility

http://ladyada.net/learn/avr/avrdude.html
http://www.nongnu.org/avrdude/