diff options
author | Ayke van Laethem <[email protected]> | 2018-09-14 20:59:28 +0200 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-09-14 20:59:28 +0200 |
commit | 112f6dc01a5a318decb36c030c617fe89c8c0920 (patch) | |
tree | e9e3a4f32693a8628be6dbfdb97f56f1e614515a /targets | |
parent | 6450daa3c851aa9ebc8356314e59f2ce17d3a6f2 (diff) | |
download | tinygo-112f6dc01a5a318decb36c030c617fe89c8c0920.tar.gz tinygo-112f6dc01a5a318decb36c030c617fe89c8c0920.zip |
all: implement `tinygo flash` command
This will now just work:
tinygo flash -target=arduino examples/blinky1
Diffstat (limited to 'targets')
-rw-r--r-- | targets/arduino.json | 3 | ||||
-rw-r--r-- | targets/pca10040.json | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/targets/arduino.json b/targets/arduino.json index 2be517596..39d5f44f7 100644 --- a/targets/arduino.json +++ b/targets/arduino.json @@ -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}" } diff --git a/targets/pca10040.json b/targets/pca10040.json index 6ec3d33c9..d8215d6b8 100644 --- a/targets/pca10040.json +++ b/targets/pca10040.json @@ -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" } |