Go Down

Topic: STK500 protocol - Command Sequence (Read 2784 times) previous topic - next topic

stevensam2012

Sep 11, 2015, 01:17 am Last Edit: Sep 11, 2015, 01:19 am by stevensam2012
Hi All,

I am trying to figure out what the sequence of STK500 commands is to program an Arduino.

I would like to have a hex file stored on an SD card and have a processor read the hex file and burn it to an Arduino using the standard bootloader.

I have had a look through the commands in the protocol:
http://www.atmel.com/Images/doc2525.pdf

And I have seen a Python implementation of the programming side:
https://translate.google.com/translate?hl=en&sl=es&tl=en&u=http%3A%2F%2Fwww.sistemasorp.es%2F2014%2F11%2F11%2Fprogramando-un-arduino-remotamente-con-el-modulo-esp8266%2F

But I don't have a clear idea of what the minimum required message flow is to program the Arduino.

If someone could point me towards some appropriate documentation, or could explain to me what is required to implement a programmer that would be great.

Cheers,
-Steve

p.s - Also, I'd be interested in doing this for the SAMD21 bootloader that is on an Arduino Zero. Any info that would help me get started would be appreciated.

dsauriol

I think that Nick Gammon has a way to program an hex file stored on the SD slot/card from an Ethernet shield but I can't seem to find that  post ....

:-(


westfw

Nick's program using ISP to program files from the SD card; I don't think I've seen a sketch that implements the serial (bootloader) protocol.

This might help: https://github.com/Optiboot/optiboot/wiki/HowOptibootWorks
Optiboot implements a very small subset of the stk500 commands; you can probably get by with a sequence of
LOAD_ADDRESS(address) and PROGAM_PAGE(one_page_of_data) commands.

CrossRoads

#3
Sep 11, 2015, 04:12 am Last Edit: Sep 11, 2015, 04:12 am by CrossRoads
I have this card all set to read from SD card and write via ICSP to the target chip. It runs Nick's program.
One version lets you select 1 of 16 files to transfer, another will let you select one of 256 programs.
http://www.crossroadsfencing.com/BobuinoRev17/


Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

john1993

have a processor read the hex file and burn it to an Arduino using the standard bootloader.
op seems to imply serial not isp. like the other thread a week or so back and many others before that most replies do no involve using the standard bootloader. i have versions that do this using a much simpler bootloader like the one i posted here a couple days ago. however it would be useful to have one that works with "mainstream" ones like opti or mega.

dmjlambert

#5
Sep 12, 2015, 05:01 pm Last Edit: Sep 12, 2015, 05:20 pm by dmjlambert
This other thread was brewing at the same time:
http://forum.arduino.cc/index.php?topic=346888

AdrianZa and George Caley got that concept working with mainstream bootloaders.


Go Up