EggTimer programming on a Mac

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
I fixed that, I am not sure where I am writing this code and then adding the execution, I am not even sure I have the path to the file correct
 
Here is what I am getting in Iterm 2
Maurice-Spains-MacBook-Pro:~ mickeyspain$ #!/bin/bash
Maurice-Spains-MacBook-Pro:~ mickeyspain$ avrdude -v -v -v -v -pm328p -carduino -b115200 -P/dev/tty.usbserial -D -Uflash:w:Macintoshhardrive/Users/MickeySpain/Downloads/Eggtimer_1_52/Eggtimer_1_52.hex:i

avrdude: Version 6.1, compiled on Dec 6 2014 at 08:30:57
Copyright (c) 2000-2005 Brian Dean, https://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/usr/local/Cellar/avrdude/6.1/etc/avrdude.conf"
User configuration file is "/Users/mickeyspain/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/tty.usbserial
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done. Thank you.
 
You're *much* closer...now you have to get the finicky timing right for letting the board out of reset. Also since there are no bytes coming back from the board, you need to also verify that you've got the TX and RX signals from the USB cable plugged on to the right pins on the eggtimer. Victory is at hand!
 
Have I put the right path into the file? When am I supposed to take it out of reset? Maybe that is the issue
 
I'm pretty sure that the current problem is letting out of reset at the right time. avrdude doesn't actually open the file until its ready to start loading it (kinda annoying); you're not quite there yet...it's just trying to establish communications with the board.

For me, I need to let it out of reset about 1/3 of a second before hitting enter to fire off the script from iTerm. It can take me 3-4 tries to get it right, and I've done it enough times to be pretty close on every try. IMO it's too finicky, but it's doable.
 
It seems like it is close but is says user file not found, take a look



Maurice-Spains-MacBook-Pro:~ mickeyspain$ #!/bin/bash
Maurice-Spains-MacBook-Pro:~ mickeyspain$ avrdude -v -v -v -v -pm328p -carduino -b115200 -P/dev/tty.usbserial -D -Uflash:w:macintoshhd/Users/MickeySpain/Desktop/Eggtimer_1_52/Eggtimer_1_52.hex:i

avrdude: Version 6.1, compiled on Dec 6 2014 at 08:30:57
Copyright (c) 2000-2005 Brian Dean, https://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/usr/local/Cellar/avrdude/6.1/etc/avrdude.conf"
User configuration file is "/Users/mickeyspain/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/tty.usbserial
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
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 20 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 : Arduino
Description : Arduino
avrdude: Send: A [41] . [80] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [81] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [04]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [04]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [98] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
Hardware Version: 3
Firmware Version: 4.4
avrdude: Send: A [41] . [84] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [85] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [86] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [87] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [89] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us

avrdude: Send: A [41] . [81] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [04]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [04]
avrdude: Recv: . [10]
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: . [14]
avrdude: Recv: . [10]
avrdude: Send: E [45] . [05] . [04] . [d7] . [c2] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: Send: P [50] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: AVR device initialized and ready to accept instructions

Reading | | 0% 0.00savrdude: Send: u [75] [20]
avrdude: Recv: . [14] . [1e] . [95] . [0f] . [10]
Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: Send: V [56] P [50] . [00] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 1, lfuse value: 0
avrdude: Send: V [56] P [50] . [00] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 2, lfuse value: 0
avrdude: Send: V [56] P [50] . [00] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 3, lfuse value: 0
avrdude: safemode: lfuse reads as 0
avrdude: Send: V [56] X [58] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 1, hfuse value: 0
avrdude: Send: V [56] X [58] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 2, hfuse value: 0
avrdude: Send: V [56] X [58] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 3, hfuse value: 0
avrdude: safemode: hfuse reads as 0
avrdude: Send: V [56] P [50] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 1, efuse value: 0
avrdude: Send: V [56] P [50] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 2, efuse value: 0
avrdude: Send: V [56] P [50] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 3, efuse value: 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "macintoshhd/Users/MickeySpain/Desktop/Eggtimer_1_52/Eggtimer_1_52.hex"
avrdude: can't open input file macintoshhd/Users/MickeySpain/Desktop/Eggtimer_1_52/Eggtimer_1_52.hex: No such file or directory
avrdude: read from file 'macintoshhd/Users/MickeySpain/Desktop/Eggtimer_1_52/Eggtimer_1_52.hex' failed

avrdude: Send: V [56] P [50] . [00] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 1, lfuse value: 0
avrdude: Send: V [56] P [50] . [00] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 2, lfuse value: 0
avrdude: Send: V [56] P [50] . [00] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 3, lfuse value: 0
avrdude: safemode: lfuse reads as 0
avrdude: Send: V [56] X [58] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 1, hfuse value: 0
avrdude: Send: V [56] X [58] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 2, hfuse value: 0
avrdude: Send: V [56] X [58] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 3, hfuse value: 0
avrdude: safemode: hfuse reads as 0
avrdude: Send: V [56] P [50] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 1, efuse value: 0
avrdude: Send: V [56] P [50] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 2, efuse value: 0
avrdude: Send: V [56] P [50] . [08] . [00] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: safemode read 3, efuse value: 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude: Send: Q [51] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done. Thank you.
 
FYI, I got here using a different path than the one described in this thread. I'll describe my method in case anybody cares to try it.

You can also get avrdude by installing the CrossPack AVR package from this page (get the one with the most recent date, currently it's 20131216). It's a standard double-click disk image with a package installer inside, no need to install "Homebrew" or anything like that first. Note that you may need to single-click the .pkg file while holding down the control key and select Open from the menu that appears, then click Open on the dialog box that appears to get around the default security on newer versions of OS X (this works for any program, you should never need to turn off the OS X security entirely just to run a program).

To actually run the avrdude command to do the upgrade, I worked up the attached script. Drag the script into the folder you get when you double-click the .zip file downloaded from Eggtimer's website (there should be a single .hex and a single .bat file in this folder). When double-clicked the .command file will automatically open up a Terminal window (doesn't require any third-party software such as iTerm, this works in a stock OS X install except for the CrossPack AVR install) and run the script. The script checks for the Prolific serial device and will abort if it doesn't find it (make sure you don't have more than one plugged-in at the same time), and will also check for a single .hex file in the same folder it was run from, and if both of those pass it will run the avrdude command to do the firmware upgrade. As said above the timing is touchy, I find things are more reliable if you short the reset pads rather than try to power-up the device at the appropriate time. If the script fails to connect it will pause, wait for the user to hit return, and try again when they do (you can hold down the control key and press the c key to quit the script, or just close the Terminal window). Once a successful download happens the script will terminate on its own (you'll probably have to close the window). There should be nothing that needs to be edited in the script, it will automatically figure out the firmware filename (provided there is exactly one .hex file in the folder it's run from), and same for the attached serial adapter.

I will note that this ONLY works for programming, though the "screen" commands provided above should work just fine in Terminal as well (I've never used iTerm, it's probably more user-friendly than OS X's Terminal, and I use a different comms program when I interact with my TRS but I'm not allowed to share that program, but "screen" comes with OS X so again nothing special needs to be installed for that to work). I've used my script to program both my LCD and TRS successfully, I don't have an Eggtimer proper but I would expect it to work there as well.

So a more step-by-step flow would be:

1) Download and install the latest CrossPack AVR package (see above for details).
2) Download and unzip the .command file provided in this post.
3) Download and unzip the new firmware from the Eggtimer Rocketry page.
4) Drag the .command file from step 2 into the folder that was created by step 3 (you can hold down option while dragging to copy the file instead of moving it, you can also drag the .zip file and double-click it inside the folder to get the .command file in the right place).
5) Get your device ready to program, and when ready double-click the .command file inside the firmware folder. A Terminal window will open and the script will prompt you from there if needed.

Steps 1 & 2 only need to be done once on a Mac, though it would be good to check this post in case I have any reason to update the script to make sure you have the latest.

If anyone runs into any trouble you can obviously post (probably best to PM me) the full output from the Terminal window (go to the Shell menu, select "Export Text As..." and attach the .txt file you create or paste it into the PM) and I can try to figure out what went wrong.

View attachment Eggtimer_flash.command.zip
 
Thank you, worked like a charm. Do I need to do a master reset after a flash update? Thanks again. Everyone for your help
 
Thanks Will, I should go have a look at the crosspack avr - simplifies locating the .hex file to load. Also thanks for mentioning about using the reset inputs rather than relying on power cycling the unit. I always do it that way but it needs to be emphasized in the instructions.

BTW Mickey in the listing above the file couldn't be found b/c you need to start the absolute path with a /, and I'm not sure you need the 'macintoshhd' part so I think it should be /Users/....
 
Last edited:
Thank you, worked like a charm. Do I need to do a master reset after a flash update? Thanks again. Everyone for your help

Generally you do NOT need to do a master reset after a flash update, which deletes all of your flight data.

I know that people don't want their flight data to go away until they download and analyze, if I made a change to the way that the data was stored in the Eggtimer's memory I'd probably have some kind of data conversion program that you'd upload and run on your Eggtimer before you upload the actual firmware. I haven't had to do that yet.
 
Man you guys are really impressive....
To be honest,,
I really didn't need to know just exactly how much I suck with computers....
I was really quite happy before I knew......

I know one person who knew how much I suck with computers though,,,,,,,

I don't wanna say his name but it rhymes with C-R-I-S E-R-V-I-N-G............

Teddy
 
Just figured I would ask, I still have 3 more to flash update. Going to try the first method and take the Macintosh HD out of the script. I actually have not flown any yet so no data. Ground testing and then flying at Red Glare
 
Will the command file work for updating the TRS and LCD is if place it in a folder with the update files?
 
I don't have an Eggtimer, only a TRS and an LCD. I've used the .command file for both without any trouble. Just copy it into each folder containing the .hex file (so one folder for the TRS and one for the LCD, with the .hex and .command files in each).
 
Will, thanks for building that file. Worked great. I'm not sure I'd have been able to figure it out on my own. I was able to flash my TRS, LCD, and a regular Eggtimer. Worked perfectly with all three products.
 
Will, thank you so much for your hard work. the flash almost ran by itself. It took me a minute to remember to instal a MAC version of prolific.

Steve
 
Back
Top