Skip to content

Commit

Permalink
makepython-nrf: add bootloader instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Jan 19, 2024
1 parent 4cfd09e commit 636ab50
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions boards/makepython-nrf52840/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ install: program
.PHONY: program
program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).bin
tockloader $(FLAGS) flash --address 0x10000 $<

.PHONY: flash-bootloader
flash-bootloader:
curl -L --output /tmp/makepython-nrf52840-bootloader_v1.1.3.bin https://github.com/tock/tock-bootloader/releases/download/v1.1.3/makepython-nrf52840-bootloader_v1.1.3.bin
tockloader flash --address 0 /tmp/makepython-nrf52840-bootloader_v1.1.3.bin
rm /tmp/makepython-nrf52840-bootloader_v1.1.3.bin
39 changes: 39 additions & 0 deletions boards/makepython-nrf52840/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,42 @@ display.
## Getting Started

First, follow the [Tock Getting Started guide](../../doc/Getting_Started.md).

The MakePython nRF52840 is designed to be programmed using an external JLink
programmer. We would like to avoid this requirement, so we use the [Tock
Bootloader](https://github.com/tock/tock-bootloader) which allows us to program
the board over the UART connection. However, we still require the programmer one
time to flash the bootloader.

To flash the bootloader we must connect a JLink programmer. The easiest way is
to use an nRF52840dk board.

### Connect the nRF52840dk to the MakePython-nRF52840

First we jumper the board as shown with the following pin mappings

| nRF52840dk | MakePython-nRF52840 |
|------------|---------------------|
| GND | GND |
| SWD SEL | +3V3 |
| SWD CLK | SWDCLK |
| SWD IO | SWDDIO |

Make sure _both_ the nRF52840dk board and the MakePython-nRF52840 board are
attached to your computer via two USB connections.

Then:

```
make flash-bootloader
```

This will use JLinkExe to flash the bootloader using the nRF52840dk's onboard
jtag hardware.

### Using the Bootloader

The bootloader activates when the reset button is pressed twice in quick
succession. The green LED will stay on when the bootloader is active.

Once the bootloader is installed tockloader will work as expected.

0 comments on commit 636ab50

Please sign in to comment.