Skip to content

Commit d1b5883

Browse files
authored
Merge pull request #1135 from dhalbert/nrf_board_rename
rename nRF boards to feather_nrf52832 and feather_nrf52840_express
2 parents 728622f + 6493c16 commit d1b5883

File tree

22 files changed

+137
-70
lines changed

22 files changed

+137
-70
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ env:
3030
- TRAVIS_BOARD=pirkey_m0
3131
- TRAVIS_BOARD=gemma_m0
3232
- TRAVIS_BOARD=hallowing_m0_express
33-
- TRAVIS_BOARD=feather52832
33+
- TRAVIS_BOARD=feather_nrf52832
34+
- TRAVIS_BOARD=feather_nrf52840_express
3435

3536
addons:
3637
artifacts:
@@ -54,7 +55,7 @@ before_script:
5455
- ([[ -z "$TRAVIS_BOARD" || $TRAVIS_BOARD = "feather_huzzah" ]] || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~trusty1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))
5556

5657
# For nrf builds
57-
- ([[ $TRAVIS_BOARD != "feather52832" && $TRAVIS_BOARD != "pca10056" ]] || sudo ports/nrf/drivers/bluetooth/download_ble_stack.sh)
58+
- ([[ $TRAVIS_BOARD != "feather_nrf52832" && $TRAVIS_BOARD != "feather_nrf52840_express" && $TRAVIS_BOARD != "pca10056" ]] || sudo ports/nrf/drivers/bluetooth/download_ble_stack.sh)
5859
# For huzzah builds
5960
- if [[ $TRAVIS_BOARD = "feather_huzzah" ]]; then wget https://github.com/jepler/esp-open-sdk/releases/download/2018-06-10/xtensa-lx106-elf-standalone.tar.gz && tar xavf xtensa-lx106-elf-standalone.tar.gz; PATH=$(readlink -f xtensa-lx106-elf/bin):$PATH; fi
6061
# For coverage testing (upgrade is used to get latest urllib3 version)

ports/nrf/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ the following links:
3636
> **NOTE**: These board specific readmes may be more up to date than the
3737
generic board-neutral documentation further down.
3838

39-
* Adafruit [Feather nRF52](boards/feather52/README.md): 512KB Flash, 64KB SRAM
40-
* Adafruit [Feather nRF52840](boards/feather52840/README.md): 1MB Flash, 256KB SRAM
41-
* Nordic PCA10056 see [Feather nRF52840](boards/feather52840/README.md)
39+
* Adafruit [Feather nRF52](boards/feather_nrf52832/README.md): 512KB Flash, 64KB SRAM
40+
* Adafruit [Feather nRF52840](boards/feather_nrf52840_express/README.md): 1MB Flash, 256KB SRAM
41+
* Nordic PCA10056 see [Feather nRF52840](boards/pca10056/README.md)
4242

4343
For all other board targets, see the generic notes below.
4444

@@ -74,12 +74,12 @@ Note: further tuning of features to include in bluetooth or even setting up the
7474

7575
## Target Boards and Make Flags
7676

77-
Target Board (BOARD) | Bluetooth Stack (SD) | Bluetooth Support | Flash Util
78-
---------------------|-------------------------|------------------------|-------------------------------
79-
pca10040 | s132 | Peripheral and Scanner | [Segger](#segger-targets)
80-
feather52832 | s132 | Peripheral and Scanner | [UART DFU](#dfu-targets)
81-
pca10056 | s140 | Peripheral and Scanner | [Segger](#segger-targets)
82-
feather52840 | s140 | Peripheral and Scanner | [UART DFU](#dfu-targets)
77+
Target Board (BOARD) | Bluetooth Stack (SD) | Bluetooth Support | Flash Util
78+
-------------------------|-------------------------|------------------------|-------------------------------
79+
pca10040 | s132 | Peripheral and Scanner | [Segger](#segger-targets)
80+
pca10056 | s140 | Peripheral and Scanner | [Segger](#segger-targets)
81+
feather_nrf52832 | s132 | Peripheral and Scanner | [UART DFU](#dfu-targets)
82+
feather_nrf52840_express | s140 | Peripheral and Scanner | UF2 bootloader
8383

8484
## Segger Targets
8585

@@ -107,9 +107,9 @@ run follow command to install [adafruit-nrfutil](https://github.com/adafruit/Ada
107107
* dfu-gen: Generates a Firmware zip to be used by the DFU flash application.
108108
* dfu-flash: Triggers the DFU flash application to upload the firmware from the generated Firmware zip file.
109109

110-
Example on how to generate and flash feather52832 target:
110+
Example on how to generate and flash feather_nrf52832 target:
111111

112-
make BOARD=feather52832 SD=s132
112+
make BOARD=feather_nrf52832 SD=s132
113113
make BOARD=feather52832 SD=s132 dfu-gen dfu-flash
114114

115115
## Bluetooth LE REPL

ports/nrf/boards/feather52832/mpconfigboard.mk

Lines changed: 0 additions & 10 deletions
This file was deleted.

ports/nrf/boards/feather52840/mpconfigboard.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

ports/nrf/boards/feather52832/README.md renamed to ports/nrf/boards/feather_nrf52832/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ run following command to install [adafruit-nrfutil](https://github.com/adafruit/
3838
#### REPL over UART (default settings)
3939

4040
To build a CircuitPython binary with default settings for the
41-
`feather52832` target enter:
41+
`feather_nrf52832` target enter:
4242

43-
> **NOTE:** `BOARD=feather52832` is the default option and isn't stricly required.
43+
> **NOTE:** `BOARD=feather_nrf52832` is the default option and isn't stricly required.
4444
4545
```
46-
$ make BOARD=feather52832 V=1
46+
$ make BOARD=feather_nrf52832 V=1
4747
```
4848

4949
#### REPL over BLE UART (AKA 'NUS')
@@ -113,15 +113,15 @@ image, as described earlier in this readme.
113113
> The name of the serial port target will vary, depending on your OS.
114114
115115
```
116-
$ make BOARD=feather52832 SERIAL=/dev/tty.SLAB_USBtoUART dfu-gen dfu-flash
116+
$ make BOARD=feather_nrf52832 SERIAL=/dev/tty.SLAB_USBtoUART dfu-gen dfu-flash
117117
```
118118

119119
By default, CircuitPython will build with **BLE** support enabled using
120120
`SD=s132` and the `SOFTDEV_VERSION=2.0.1`. If you wish to specify a different
121121
SD family or version you can enter the optional fields as shown below:
122122

123123
```
124-
$ make BOARD=feather52832 SERIAL=/dev/tty.SLAB_USBtoUART SD=s132 SOFTDEV_VERSION=5.0.0 dfu-gen dfu-flash
124+
$ make BOARD=feather_nrf52832 SERIAL=/dev/tty.SLAB_USBtoUART SD=s132 SOFTDEV_VERSION=5.0.0 dfu-gen dfu-flash
125125
```
126126

127127
## Working with CircuitPython
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
MCU_SERIES = m4
2+
MCU_VARIANT = nrf52
3+
MCU_SUB_VARIANT = nrf52
4+
SD ?= s132
5+
SOFTDEV_VERSION ?= 2.0.1
6+
7+
LD_FILE = boards/feather_nrf52832/custom_nrf52832_dfu_app_$(SOFTDEV_VERSION).ld
8+
BOOT_FILE = boards/feather_nrf52832/bootloader/feather52_bootloader_$(SOFTDEV_VERSION)_s132_single
9+
10+
BOOT_SETTING_ADDR = 0x7F000
11+
NRF_DEFINES += -DNRF52832_XXAA
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2016 Glenn Ruben Bakke
7+
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
8+
*
9+
* Permission is hereby granted, free of charge, to any person obtaining a copy
10+
* of this software and associated documentation files (the "Software"), to deal
11+
* in the Software without restriction, including without limitation the rights
12+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
* copies of the Software, and to permit persons to whom the Software is
14+
* furnished to do so, subject to the following conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be included in
17+
* all copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
*/
27+
28+
#define FEATHER52840
29+
30+
#define MICROPY_HW_BOARD_NAME "Adafruit Feather nRF52840 Express"
31+
#define MICROPY_HW_MCU_NAME "nRF52840"
32+
#define MICROPY_PY_SYS_PLATFORM "Feather52840"
33+
34+
// #define MICROPY_HW_NEOPIXEL NRF_GPIO_PIN_MAP(0, 13)
35+
36+
// #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 9)
37+
// #define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 11)
38+
// #define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 12)
39+
// #define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 14)
40+
// #define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 8)
41+
// #define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 8)
42+
43+
// #define MICROPY_HW_UART_RX NRF_GPIO_PIN_MAP(0, 8)
44+
// #define MICROPY_HW_UART_TX NRF_GPIO_PIN_MAP(0, 6)
45+
// #define MICROPY_HW_UART_HWFC (0)
46+
47+
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
48+
49+
// If you change this, then make sure to update the linker scripts as well to
50+
// make sure you don't overwrite code
51+
#define PORT_HEAP_SIZE (128 * 1024)
52+
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
53+
54+
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
55+
56+
// TODO #include "external_flash/devices.h"
57+
58+
#define EXTERNAL_FLASH_DEVICE_COUNT 1
59+
#define EXTERNAL_FLASH_DEVICES GD25Q16C
60+
61+
#define EXTERNAL_FLASH_QSPI_DUAL
62+
63+
// TODO include "external_flash/external_flash.h"
64+
65+
#define BOARD_HAS_CRYSTAL 1
66+
67+
#define DEFAULT_I2C_BUS_SCL NRF_GPIO_PIN_MAP(1, 11)
68+
#define DEFAULT_I2C_BUS_SDA NRF_GPIO_PIN_MAP(1, 12)
69+
70+
#define DEFAULT_SPI_BUS_SCK NRF_GPIO_PIN_MAP(0, 20)
71+
#define DEFAULT_SPI_BUS_MOSI NRF_GPIO_PIN_MAP(0, 23)
72+
#define DEFAULT_SPI_BUS_MISO NRF_GPIO_PIN_MAP(0, 22)
73+
74+
#define DEFAULT_UART_BUS_RX NRF_GPIO_PIN_MAP(1, 0)
75+
#define DEFAULT_UART_BUS_TX NRF_GPIO_PIN_MAP(0, 24)

ports/nrf/common-hal/board/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
*/
2626

2727
// Pins aren't actually defined here. They are in the board specific directory
28-
// such as boards/feather52832/pins.csv
28+
// such as boards/feather_nrf52832/pins.csv

tools/build_adafruit_bins.sh

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,30 @@ rm -rf ports/atmel-samd/build*
22
rm -rf ports/esp8266/build*
33
rm -rf ports/nrf/build*
44

5-
ATMEL_BOARDS="arduino_zero circuitplayground_express circuitplayground_express_crickit feather_radiofruit_zigbee feather_m0_basic feather_m0_adalogger itsybitsy_m0_express itsybitsy_m4_express feather_m0_rfm69 feather_m0_rfm9x feather_m0_express feather_m0_express_crickit feather_m4_express metro_m0_express metro_m4_express pirkey_m0 trinket_m0 gemma_m0 feather52832 feather_huzzah pca10056 hallowing_m0_express"
5+
ATMEL_BOARDS="\
6+
arduino_zero \
7+
circuitplayground_express \
8+
circuitplayground_express_crickit \
9+
feather_huzzah \
10+
feather_m0_adalogger \
11+
feather_m0_basic \
12+
feather_m0_express \
13+
feather_m0_express_crickit \
14+
feather_m0_rfm69 \
15+
feather_m0_rfm9x \
16+
feather_m4_express \
17+
feather_nrf52832 \
18+
feather_nrf52840 \
19+
feather_radiofruit_zigbee \
20+
gemma_m0 \
21+
hallowing_m0_express \
22+
itsybitsy_m0_express \
23+
itsybitsy_m4_express \
24+
metro_m0_express \
25+
metro_m4_express \
26+
pirkey_m0 \
27+
trinket_m0 \
28+
"
629
ROSIE_SETUPS="rosie-ci"
730

831
PARALLEL="-j 5"
@@ -41,11 +64,16 @@ for board in $boards; do
4164
(( exit_status = exit_status || $? ))
4265
temp_filename=ports/esp8266/build/firmware-combined.bin
4366
extension=bin
44-
elif [ $board == "feather52832" ]; then
45-
make $PARALLEL -C ports/nrf TRANSLATION=$language BOARD=feather52832
67+
elif [ $board == "feather_nrf52832" ]; then
68+
make $PARALLEL -C ports/nrf TRANSLATION=$language BOARD=feather_nrf52832
4669
(( exit_status = exit_status || $? ))
4770
temp_filename=ports/nrf/build-$board-s132/firmware.bin
4871
extension=bin
72+
elif [ $board == "feather_nrf52840_express" ]; then
73+
make $PARALLEL -C ports/nrf TRANSLATION=$language BOARD=feather_nrf52840_express SD=s140
74+
(( exit_status = exit_status || $? ))
75+
temp_filename=ports/nrf/build-$board-s140/firmware.bin
76+
extension=bin
4977
elif [ $board == "pca10056" ]; then
5078
make $PARALLEL -C ports/nrf TRANSLATION=$language BOARD=pca10056 SD=s140
5179
(( exit_status = exit_status || $? ))

0 commit comments

Comments
 (0)