Skip to content

Commit

Permalink
reelboard: support Reel Board (nrf52840 dev board)
Browse files Browse the repository at this point in the history
Signed-off-by: Ron Evans <[email protected]>
  • Loading branch information
deadprogram authored and aykevl committed Dec 1, 2018
1 parent 8f35a47 commit 8325f2a
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -48,6 +53,9 @@ ifeq ($(TARGET),pca10040)
flash-%: build/%.hex
nrfjprog -f nrf52 --sectorerase --program $< --reset
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)
Expand Down
2 changes: 2 additions & 0 deletions docs/targets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions src/machine/board_reelboard.go
Original file line number Diff line number Diff line change
@@ -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
)
7 changes: 7 additions & 0 deletions targets/reelboard.json
Original file line number Diff line number Diff line change
@@ -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"]
}

0 comments on commit 8325f2a

Please sign in to comment.