2018-02-07 14:40:44 -05:00
|
|
|
# CircuitPython Port To The Nordic Semiconductor nRF52 Series
|
2017-05-28 23:20:46 -04:00
|
|
|
|
2018-02-07 14:40:44 -05:00
|
|
|
This is a port of CircuitPython to the Nordic Semiconductor nRF52 series of chips.
|
2017-05-28 23:20:46 -04:00
|
|
|
|
2019-10-06 21:30:26 -04:00
|
|
|
> **NOTE**: There are board-specific READMEs that may be more up to date than the
|
|
|
|
generic board-neutral documentation below.
|
2018-05-15 16:42:27 -04:00
|
|
|
|
2017-06-02 18:16:31 -04:00
|
|
|
## Compile and Flash
|
|
|
|
|
2017-06-07 12:56:20 -04:00
|
|
|
Prerequisite steps for building the nrf port:
|
2017-06-02 18:16:31 -04:00
|
|
|
|
2018-02-07 14:40:44 -05:00
|
|
|
git clone <URL>.git circuitpython
|
|
|
|
cd circuitpython
|
2019-10-06 21:30:26 -04:00
|
|
|
git submodule update --init --recursive
|
2017-06-02 18:16:31 -04:00
|
|
|
make -C mpy-cross
|
|
|
|
|
2019-10-06 21:30:26 -04:00
|
|
|
Some boards have UF2 bootloaders and can simply be flashed in the normal way, by copying
|
|
|
|
firmware.uf2 to the BOOT drive.
|
|
|
|
|
2018-07-17 10:24:49 -04:00
|
|
|
To build and flash issue the following command inside the ports/nrf/ folder:
|
2017-06-02 18:16:31 -04:00
|
|
|
|
2018-07-17 10:24:49 -04:00
|
|
|
make BOARD=pca10056
|
|
|
|
make BOARD=pca10056 flash
|
2018-02-07 14:40:44 -05:00
|
|
|
|
2017-06-07 15:33:47 -04:00
|
|
|
## Segger Targets
|
2017-06-02 18:16:31 -04:00
|
|
|
|
|
|
|
Install the necessary tools to flash and debug using Segger:
|
|
|
|
|
2017-06-07 15:33:47 -04:00
|
|
|
[JLink Download](https://www.segger.com/downloads/jlink#)
|
|
|
|
|
|
|
|
[nrfjprog linux-32bit Download](https://www.nordicsemi.com/eng/nordic/download_resource/52615/16/95882111/97746)
|
|
|
|
|
|
|
|
[nrfjprog linux-64bit Download](https://www.nordicsemi.com/eng/nordic/download_resource/51386/21/77886419/94917)
|
2017-06-02 18:16:31 -04:00
|
|
|
|
2017-06-07 15:33:47 -04:00
|
|
|
[nrfjprog osx Download](https://www.nordicsemi.com/eng/nordic/download_resource/53402/12/97293750/99977)
|
2017-06-02 18:16:31 -04:00
|
|
|
|
2017-06-07 15:33:47 -04:00
|
|
|
[nrfjprog win32 Download](https://www.nordicsemi.com/eng/nordic/download_resource/33444/40/22191727/53210)
|
2017-06-02 18:16:31 -04:00
|
|
|
|
2017-08-08 12:45:42 -04:00
|
|
|
note: On Linux it might be required to link SEGGER's `libjlinkarm.so` inside nrfjprog's folder.
|
2017-06-07 15:33:47 -04:00
|
|
|
|
|
|
|
## DFU Targets
|
2017-06-02 18:16:31 -04:00
|
|
|
|
2018-08-22 04:22:17 -04:00
|
|
|
run follow command to install [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) from PyPi
|
|
|
|
|
2018-08-22 08:42:41 -04:00
|
|
|
$ pip3 install --user adafruit-nrfutil
|
2018-02-07 14:40:44 -05:00
|
|
|
|
2017-06-02 18:16:31 -04:00
|
|
|
**make flash** and **make sd** will not work with DFU targets. Hence, **dfu-gen** and **dfu-flash** must be used instead.
|
|
|
|
* dfu-gen: Generates a Firmware zip to be used by the DFU flash application.
|
2018-02-07 14:40:44 -05:00
|
|
|
* dfu-flash: Triggers the DFU flash application to upload the firmware from the generated Firmware zip file.
|
2017-06-02 18:16:31 -04:00
|
|
|
|
2017-06-09 16:33:51 -04:00
|
|
|
|
|
|
|
When enabled you have different options to test it:
|
|
|
|
* [NUS Console for Linux](https://github.com/tralamazza/nus_console) (recommended)
|
|
|
|
* [WebBluetooth REPL](https://glennrub.github.io/webbluetooth/micropython/repl/) (experimental)
|