all: implement tinygo flash command

This will now just work:

    tinygo flash -target=arduino examples/blinky1
This commit is contained in:
Ayke van Laethem
2018-09-14 20:59:28 +02:00
parent 6450daa3c8
commit 112f6dc01a
4 changed files with 54 additions and 6 deletions
+2 -1
View File
@@ -3,5 +3,6 @@
"build-tags": ["avr", "avr8", "atmega", "atmega328p", "js", "wasm"],
"linker": "avr-gcc",
"pre-link-args": ["-nostdlib", "-T", "targets/avr.ld", "-Wl,--gc-sections", "targets/avr.S"],
"objcopy": "avr-objcopy"
"objcopy": "avr-objcopy",
"flash": "avrdude -c arduino -p atmega328p -P {port} -U flash:w:{hex}"
}
+2 -1
View File
@@ -3,5 +3,6 @@
"build-tags": ["nrf", "nrf52", "nrf52832", "js", "wasm"],
"linker": "arm-none-eabi-gcc",
"pre-link-args": ["-nostdlib", "-nostartfiles", "-mcpu=cortex-m4", "-mthumb", "-T", "targets/arm.ld", "-Wl,--gc-sections", "-fno-exceptions", "-fno-unwind-tables", "-ffunction-sections", "-fdata-sections", "-Os", "-DNRF52832_XXAA", "-D__STARTUP_CLEAR_BSS", "-Ilib/CMSIS/CMSIS/Include", "lib/nrfx/mdk/gcc_startup_nrf51.S", "lib/nrfx/mdk/system_nrf52.c"],
"objcopy": "arm-none-eabi-objcopy"
"objcopy": "arm-none-eabi-objcopy",
"flash": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset"
}