launching other dowload utility with avrdude_wraper and post_compile_script

Hello,

hopefully some of you will be interrested in this small utility:
it s a very small windows program which parses the avrdude command line and launch a new .bat file with 2 parameters in order to launch a specific download utility or to execute a job after compile like de-assembly.

the file is called avrdudearg.exe, it accepts the following parameters:
-board=xxx
-file=yyy
-path=zzz
-Uflash:w:ttt.hex:i
-cwww

it will launch avrdudearg.bat with the full path of the .cpp file as %1 and will add the board/protocol as %2 argument (xxx or www).
the bat file is now able to launch your own utility with a comprensive file name pointing in the temp folder where the .cpp.hex and .cpp.elf are stored !

I ve made this to be able to launch the ST-LINK_CLI utility in order to program STM32 discovery board from Arduino (WIP)....
the utility can also be used to launch the teensy_loader_cli or a dfu-programmer ...

the zip file should be extracted in the "hardware\tools" folder as is.
you can modify the avrdudearg.bat as you like.

in order to launch avrdudearg.exe at the end of the compile you must add the following line in your board.txt:
theboard.build.post_compile_script=avrdudearg
in order to launch avrdudearg.exe for downloading you must add the following line in your board.txt:
theboard.upload.avrdude_wrapper=avrdudearg
it is possibe to use it for the download and post compile together, as long as you check %2 and split the code inside the .bat file

this is inspired from some work posted on dorkbotPDX blog (perl script) and from http://www.geocities.jp/arduino_diecimila/bootloader/bitbang_w_ide_en.html
thx to respective authors.
the .c file has been compiled successfully using a VC++6.0 portable version under windows XP...so it must be run in XP compatibility mode.

I may provide other version once the STM32 integration is progressing, but I m not really planning to support this tool :slight_smile:
please take it as is and enjoy it, or tune it and share with us.

remark : the file is visible here below as an attachemenet when you are logged-in in the forum ! otherwise you wont see it

avrdudearg.zip (31.7 KB)