diff options
author | Ron Evans <[email protected]> | 2018-11-19 09:00:27 +0100 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-12-01 18:25:36 +0100 |
commit | 8325f2a53dc60409dca9d01d2204ad3939e2e9db (patch) | |
tree | 6452f845d23c41fa9ffb7408dce4e7a4a91624d8 | |
parent | 8f35a4711a0d090e056d641da8cc936ff8a38a4f (diff) | |
download | tinygo-8325f2a53dc60409dca9d01d2204ad3939e2e9db.tar.gz tinygo-8325f2a53dc60409dca9d01d2204ad3939e2e9db.zip |
reelboard: support Reel Board (nrf52840 dev board)
Signed-off-by: Ron Evans <[email protected]>
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | docs/targets.rst | 2 | ||||
-rw-r--r-- | src/machine/board_reelboard.go | 35 | ||||
-rw-r--r-- | targets/reelboard.json | 7 |
5 files changed, 54 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index e97ee4d83..76e63bce4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,5 +27,7 @@ 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.reel.elf -target=reelboard examples/blinky1 + - tinygo build -o blinky2.reel.elf -target=reelboard examples/blinky2 - tinygo build -o blinky1.pca10056.elf -target=pca10056 examples/blinky1 - tinygo build -o blinky2.pca10056.elf -target=pca10056 examples/blinky2 @@ -20,6 +20,11 @@ else ifeq ($(TARGET),microbit) OBJCOPY = arm-none-eabi-objcopy TGOFLAGS += -target $(TARGET) +else ifeq ($(TARGET),reelboard) +# reel board +OBJCOPY = arm-none-eabi-objcopy +TGOFLAGS += -target $(TARGET) + else ifeq ($(TARGET),bluepill) # "blue pill" development board # See: https://wiki.stm32duino.com/index.php?title=Blue_Pill @@ -50,6 +55,9 @@ flash-%: build/%.hex else ifeq ($(TARGET),microbit) flash-%: build/%.hex openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program $< reset exit' +else ifeq ($(TARGET),reelboard) +flash-%: build/%.hex + openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program $< reset exit' else ifeq ($(TARGET),arduino) flash-%: build/%.hex avrdude -c arduino -p atmega328p -P /dev/ttyACM0 -U flash:w:$< diff --git a/docs/targets.rst b/docs/targets.rst index 04cbfffd0..0a091c244 100644 --- a/docs/targets.rst +++ b/docs/targets.rst @@ -38,6 +38,8 @@ technology (LLVM) as the proprietary ARM compiler for code generation. <https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF52832>`_) * `nRF52840-MDK <https://wiki.makerdiary.com/nrf52840-mdk/>`_ (`nRF52840 <https://www.nordicsemi.com/eng/Products/nRF52840>`_) + * `reel board <https://www.phytec.eu/product-eu/internet-of-things/reelboard/>`_ (`nRF52840 + <https://www.nordicsemi.com/eng/Products/nRF52840>`_) * `Nordic PCA10056 <https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK>`_ (`nRF52840 <https://www.nordicsemi.com/eng/Products/nRF52840>`_) * `QEMU <https://wiki.qemu.org/Documentation/Platforms/ARM>`_ (`LM3S6965 diff --git a/src/machine/board_reelboard.go b/src/machine/board_reelboard.go new file mode 100644 index 000000000..db9abaa14 --- /dev/null +++ b/src/machine/board_reelboard.go @@ -0,0 +1,35 @@ +// +build reelboard + +package machine + +const HasLowFrequencyCrystal = true + +// LEDs on the reel board +const ( + LED = LED1 + LED1 = LED_YELLOW + LED2 = LED_RED + LED3 = LED_GREEN + LED4 = LED_BLUE + LED_RED = 11 + LED_GREEN = 12 + LED_BLUE = 41 + LED_YELLOW = 13 +) + +// User "a" button on the reel board +const ( + BUTTON = 7 +) + +// UART pins +const ( + UART_TX_PIN = 6 + UART_RX_PIN = 8 +) + +// I2C pins +const ( + SDA_PIN = 26 + SCL_PIN = 27 +) diff --git a/targets/reelboard.json b/targets/reelboard.json new file mode 100644 index 000000000..208e82130 --- /dev/null +++ b/targets/reelboard.json @@ -0,0 +1,7 @@ +{ + "inherits": ["nrf52840"], + "build-tags": ["reelboard"], + "flash": "openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program {hex} reset exit'", + "ocd-daemon": ["openocd", "-f", "interface/cmsis-dap.cfg", "-f", "target/nrf51.cfg"], + "gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"] +} |