In anticipation of everyone receiving their copy of Arduventure and suddenly realising they don’t know how to upload a .hex file to the Arduboy, I’m here to ask now:
Just how do you upload a .hex file to the Arduboy?
Yes … when is the Mac version coming along? I have clicked the Mac button on @crait’s page many times and although I find the popup funny, I really want to see a Mac version.
We’ll a provide .arduboy file not a .hex file. 95% will be windows, so those people can use a Game Loader. Mac (like myself) and Linux users. can upload on command line (and we’ll explain how to extract the .hex file). We’ll provide a step by step how to.
BUT we’re also still working on a macOS version of the Game Loader with mixed results. My team working on it isn’t used to develop for macOS, so it’s a long search (especially on serial connections).
And once and for all, after all backers have received their “paid for” version, we’ll release the source too.
Well, you can use avrdude on the mac. Or Windows, Linux, etc. The hard part is getting all the settings right, and recent versions understand “arduino” a a programmer type for programming arduinos, though the Arduino API doesn’t seem to leverage that. So getting the partno right (it’s atmega32u4) should do the trick.
There are also GUI front ends available for it that run on the Mac & Linux for those who are uncomfortable with the command line, The easiest to install seems to be Burn-O-Mat, as the others are Java or Mono zip files that require the appropriate incantations.
Thanks @mwm, I was unaware you could load a .hex file using avrdude. Is this something you use and if so could you document the process for the community?
As @filmote said, do you have any idea what the right settings are?
I’ve attempted to use avrdude in the past with something along the lines of avrdude -p m32u4 -c arduino -P COM# -U flash:w:"file.hex":i but with no success (the command line just locked up, it would not even accept ctrl+z to cancel).
Yes, in fact all uploaders use avrdude internally.
I always go to github and download the zip with the source, then wait few minutes for arduino, compile and fiddle around selecting the right port and… just kidding I always use my uploader of course
If you upload a sketch using the Arduino IDE and set checkbox Show verbose output during: upload in the IDE preferences, somewhere in that output will be the avrdude command it uses, including the switches and options.
Aside from pulling both the avrdude executable and config file from %APPDATA%, it seems that before calling avrdude the IDE does something significant to the COM port that severs the Arduboy’s connection to that port and moves it along to the next free port in preparation for the avrdude upload.
Forcing reset using 1200bps open/close on port COM4
PORTS {COM4, } / {} => {}
PORTS {} / {COM5, } => {COM5, }
Found upload port: COM5
Attemping to use the same command the IDE claims to be using yields
avrdude: ser_open(): can’t open device “\.\COM5”: The system cannot find the file specified.
And attempting to replace COM5 with COM4 yields many
Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
Maybe… never tried. All the steps are very clear in my uploader source. I am pretty sure most of them work in mono, but there is stuff that I do not know, for example how to handle the “arduboy:” links in other platforms
In that case you’d have to be able to detect the OS and provide the correct copy if you’re providing the executable.
If are allowing the user to provide the avrdude path rather than letting the program provide the executable then it should work (assuming wine/mono are implementing Process correctly).
Oh, but the ManagementObjectSearcher code won’t work…
Yeah, it would need to be changed to run with mono/wine.
It’s a shame, but it’s probably not worth the effort.