circuitpython/ports/nrf
Jeff Epler e95e921ca1 codeformat: Fix filename matching
In #4683, tannewt noticed that uncrustify was not running on some
file in common-hal.

I investigated and found that it was not being run on a bunch of paths.

Rather than make incremental changes, I rewrote list_files to work
bsaed on regular expressions; these regular expressions are created from
the same git-style glob patterns.

I spot-checked some specific filenames after this change, and all looks good:

```
$ python3 tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py  ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup extmod/virtpin.c ports/raspberrypi/background.h ports/raspberrypi/common-hal/pulseio/PulseIn.c
black --fast --line-length=99 -v tests/thread/thread_exit1.py
```
recursiveloop and int_small are excluded, while PulseIn, virtpin,
and background are included.

Testing running from a subdirectory (not _specifically_ supported though):
```
(cd ports && python3 ../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c)
../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup ../extmod/virtpin.c raspberrypi/common-hal/pulseio/PulseIn.
```

As a side-effect, a bunch more files are re-formatted now. :-P
2021-04-30 10:48:08 -05:00
..
bluetooth [build] Allow USB to be set to 0 2021-04-23 11:13:34 -04:00
boards Merge pull request #4236 from jun2sak/nrf52-sleep 2021-04-28 12:11:31 -04:00
common-hal codeformat: Fix filename matching 2021-04-30 10:48:08 -05:00
device/nrf52 run code formatting script 2021-03-15 19:27:36 +05:30
examples run code formatting script 2021-03-15 19:27:36 +05:30
freeze run code formatting script 2021-03-15 19:27:36 +05:30
nrfx@3f55e49eb1 update nrfx submodule to v2 2019-12-18 15:39:11 +07:00
peripherals/nrf run code formatting script 2021-03-15 19:27:36 +05:30
supervisor codeformat: Fix filename matching 2021-04-30 10:48:08 -05:00
.gitignore add CharacteristicBuffer; UART seems to work! 2019-01-07 22:46:20 -05:00
Makefile Merge pull request #4236 from jun2sak/nrf52-sleep 2021-04-28 12:11:31 -04:00
README.md address review comments 2019-12-11 15:43:06 -05:00
background.c run code formatting script 2021-03-15 19:27:36 +05:30
background.h supervisor: factor supervisor_background_tasks from sundry ports 2020-07-15 11:49:44 -05:00
fatfs_port.c run code formatting script 2021-03-15 19:27:36 +05:30
gccollect.c run code formatting script 2021-03-15 19:27:36 +05:30
ld_defines.c run code formatting script 2021-03-15 19:27:36 +05:30
mpconfigport.h run code formatting script 2021-03-15 19:27:36 +05:30
mpconfigport.mk Merge pull request #4236 from jun2sak/nrf52-sleep 2021-04-28 12:11:31 -04:00
mphalport.h run code formatting script 2021-03-15 19:27:36 +05:30
nrfx_config.h Merge remote-tracking branch 'upstream/main' into nrf52-sleep 2021-04-09 13:48:45 -04:00
nrfx_glue.h run code formatting script 2021-03-15 19:27:36 +05:30
nrfx_log.h nrf: Rewrite the SPI common-hal using nrfx 2018-06-25 23:46:34 +02:00
qstrdefsport.h nrf: Remove old qstr defines 2018-06-27 20:52:13 +02:00
sd_mutex.c run code formatting script 2021-03-15 19:27:36 +05:30
sd_mutex.h run code formatting script 2021-03-15 19:27:36 +05:30

README.md

CircuitPython Port To The Nordic Semiconductor nRF52 Series

This is a port of CircuitPython to the Nordic Semiconductor nRF52 series of chips.

NOTE: There are board-specific READMEs that may be more up to date than the generic board-neutral documentation below.

Flash

Some boards have UF2 bootloaders and can simply be flashed in the normal way, by copying firmware.uf2 to the BOOT drive.

For some boards, you can use the flash target:

make BOARD=pca10056 flash

Segger Targets

Install the necessary tools to flash and debug using Segger:

JLink Download

nrfjprog linux-32bit Download

nrfjprog linux-64bit Download

nrfjprog osx Download

nrfjprog win32 Download

note: On Linux it might be required to link SEGGER's libjlinkarm.so inside nrfjprog's folder.

DFU Targets

run follow command to install adafruit-nrfutil from PyPi

$ pip3 install --user adafruit-nrfutil

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.
  • dfu-flash: Triggers the DFU flash application to upload the firmware from the generated Firmware zip file.

When enabled you have different options to test it: