I had an interesting idea recently, but don't have all the knowledge needed to make it work. I know that several people have made Arduino programmers with an esp8266, allowing them to program the Arduino over WiFi.

However, I am interested in being able to program the raw chips (attiny84 or atmega328p) via the ICSP method, since they don't normally have a bootloader.

But the application I think would be really useful is the ability to upload a HEX file to the internal filesystem and use the esp8266 as a batch programmer (no need to have the computer recompile and upload each time; the file would be ready to go at the push of a button).

The issue is that I have no information as to how to actually build the programmer portion of this. I can set up a web UI, file upload, menu system, and even find the hex file, but all the current solutions merely act as an interface for Avrdude. I don't know how that issues commands or provides the programming file.

I need a method to issue the programming commands over (presumably) SPI and transfer the file from SPIFFS, rather than have it fed piecewise from the computer. Ideally I need some way to burn fuses too, and a configurable SPI speed (since the chips have the slow clock initially).

Can anyone help me with this or point me to a code library? Note: I am aware of (and inspired by) the ISPNub, but I am unsure of how to port it to the esp8266 (it doesn't use the SPI library, but a custom implementation that won't port easily), or how its method of reading the firmware from flash would differ from the need to parse the hex file.

  • ESP8266AVRISP is bundled with esp8266 Arduino boards package – Juraj Jan 19 at 5:55
  • That's actually fairly interesting, but it seems to only act as a server for running commands sent from Avrdude. I'm looking for a way to have the hex file on the esp8266 itself, where it parses that and programs the AVR directly. I don't know what I can get out of the library, since I don't know what logic happens in avrdude to send those commands. – RDragonrydr Jan 20 at 15:09
  • gammon.com.au/bootloader – Juraj Jan 20 at 15:20
  • Good point. I'll have to see if I can port that. I can't read Lua, though, so can someone tell me if that script pre-parses anything beyond converting to a byte array? – RDragonrydr Jan 20 at 15:51
  • there is no Lua. the sketch is here github.com/nickgammon/arduino_sketches/tree/master/… – Juraj Jan 20 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.