Go Down

Topic: Use Optiboot out of own MCU-application (Read 221 times) previous topic - next topic



following situation: I have an Arduino Nano which is not connected via USB but via UART to an other microcontroller. On this Nano I have the Optiboot bootloader installed. Now I want to write a new application from this other microcontroller to my Nano in order to let Optiboot flash this new firmware. My questions:

- what (commands) do I have to send to Optiboot via UART exactly in order to transfer my new firmware to the Nanao?

- how do I tell Optiboot from outside to not to start an existing Nano-application but to start the Firmware update process?



Apr 17, 2018, 07:41 pm Last Edit: Apr 17, 2018, 07:41 pm by DrAzzy
Pulse reset low to start the bootloader (this is done by the DTR line of the serial adapter chip and a cap, google dtr reset circuit)

It communicates via STK500 protocol - I think there's a doc from Atmel that describes it.

Running from command line, you can run avrdude in a very verbose mode (see the docs for avrdude for details on how to enable this); the maximum verbosity mode will print every character sent or received to the console. Once you get close from the above documents, you can use that to see what you're doing wrong.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy


Apr 17, 2018, 11:24 pm Last Edit: Apr 18, 2018, 01:35 am by westfw
See https://github.com/Optiboot/optiboot/wiki/HowOptibootWorks

huh.  The minimal interface to optiboot might involve sending a series of STK_LOAD_ADDRESS commands each followed by a STK_PROG_PAGE command, carefully timed so that they complete before the next one is sent (or you can wait for the responses; hard to say which is easier.)  The other stk500v1 commands implemented by optiboot look like they're all to keep the host-side happy, rather than being important to optiboot itself.

Go Up