diff --git a/.travis.yml b/.travis.yml index d21dc92b..e97ee4d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,3 +27,5 @@ script: - tinygo build -o blinky1.nrf51d.elf -target=pca10031 examples/blinky1 - tinygo build -o blinky1.stm32.elf -target=bluepill examples/blinky1 - tinygo build -o blinky1.avr.o -target=arduino examples/blinky1 # TODO: avr-as/avr-gcc doesn't work + - tinygo build -o blinky1.pca10056.elf -target=pca10056 examples/blinky1 + - tinygo build -o blinky2.pca10056.elf -target=pca10056 examples/blinky2 diff --git a/docs/targets.rst b/docs/targets.rst index 33963109..04cbfffd 100644 --- a/docs/targets.rst +++ b/docs/targets.rst @@ -38,6 +38,8 @@ technology (LLVM) as the proprietary ARM compiler for code generation. `_) * `nRF52840-MDK `_ (`nRF52840 `_) + * `Nordic PCA10056 `_ (`nRF52840 + `_) * `QEMU `_ (`LM3S6965 `_) |br| This target is supported only for testing purposes. It has not been tested diff --git a/src/machine/board_pca10056.go b/src/machine/board_pca10056.go new file mode 100644 index 00000000..5ea72513 --- /dev/null +++ b/src/machine/board_pca10056.go @@ -0,0 +1,35 @@ +// +build pca10056 + +package machine + +const HasLowFrequencyCrystal = true + +// LEDs on the pca10056 +const ( + LED = LED1 + LED1 = 13 + LED2 = 14 + LED3 = 15 + LED4 = 16 +) + +// Buttons on the pca10056 +const ( + BUTTON = BUTTON1 + BUTTON1 = 11 + BUTTON2 = 12 + BUTTON3 = 24 + BUTTON4 = 25 +) + +// UART pins +const ( + UART_TX_PIN = 6 + UART_RX_PIN = 8 +) + +// I2C pins +const ( + SDA_PIN = 26 + SCL_PIN = 27 +) diff --git a/targets/pca10056.json b/targets/pca10056.json new file mode 100644 index 00000000..382d2277 --- /dev/null +++ b/targets/pca10056.json @@ -0,0 +1,7 @@ +{ + "inherits": ["nrf52840"], + "build-tags": ["pca10056"], + "flash": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset", + "ocd-daemon": ["openocd", "-f", "interface/cmsis-dap.cfg", "-f", "target/nrf51.cfg"], + "gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"] +}