Go Down

Topic: Burning bootloader and upload program from own program (Read 209 times) previous topic - next topic

MikD

This may be a tall order. But is the place to ask.

What I would like to do is to write a Windows program, preferably in C#, that is 1) capable of burning the bootloader via an Atmel-SAM-ICE, 2) upload the program .hex/.elf file, via the Atmel-SAM-ICE immediately after burning the bootloader, then wait for the program to program an external EEPROM and then 3) upload a second program.

Right now I do each of the three steps manually via the Arduino IDE, incl. waiting for the compilations, using both the Atmel-SAM-ICE and USB port but it is rather cumbersome. Thus I would like to do it all in one go from a Windows program.

I have searched the web for snippets or ideas but so far have been unable to find something useful. I therefore ask for some hints or links to webpages I haven't found.

TIA
MikD

Juraj

turn on verbose mode in IDE and see the executed commands. then try to run the commands from command line. then wrap them into a shell script

david_prentice

Shirley,   you just select EDBG as programmer.  Then select Burn Bootloader.

There is no need to use an external programmer for a Zero or M0 Pro.
Yes,  you can use ATMEL-ICE, SAM-ICE, ... for SAMD21 boards that do not have an on-board EDBG.

David.

MikD

Burning the bootloader from the command prompt worked after some fiddling and reading this:

https://forum.sparkfun.com/viewtopic.php?t=44209

However, I have not had any luck with bossac.exe so far. It stalls immediately after printing "Set binary mode" and I have to abort the process by pressing Ctrl+C. I have even tried the GUI version of Bossa but it stalls as soon as I select the relevant USB port :-(

One important detail I forgot to mention is that my board is an M0 with an Arduino Zero bootloader and not a true Arduino Zero with the EDBG.

The work continues.

Go Up