nrf: Generalize feather52 target

This patch generalize the feather52 target to be a board without
an in-built Bluetooth stack or bootloader giving all flash memory to
micropython code.

This way the feather52 target can run any supported Bluetooth LE
stack the port supports for other nrf52832 targets. Hence, this
make Makefiles/linker scripts and BLE driver support easier
to maintain in the future.
pull/3137/merge
Glenn Ruben Bakke 2018-06-13 19:33:39 +02:00 zatwierdzone przez Damien George
rodzic b7ce2f1460
commit db67a5000f
4 zmienionych plików z 3 dodań i 62 usunięć

Wyświetl plik

@ -249,23 +249,6 @@ $(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os
.PHONY: all flash sd binary hex
ifeq ($(BOARD),feather52)
.PHONY: dfu-gen dfu-flash
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined make flag: $1$(if $2, ($2))))
dfu-gen:
nrfutil dfu genpkg --dev-type 0x0052 --application $(BUILD)/$(OUTPUT_FILENAME).hex $(BUILD)/dfu-package.zip
dfu-flash:
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0)
sudo nrfutil dfu serial --package $(BUILD)/dfu-package.zip -p $(SERIAL)
endif
all: binary hex
OUTPUT_FILENAME = firmware

Wyświetl plik

@ -97,7 +97,7 @@ pca10028 | s110 | Peripheral | [Segge
pca10031 | s110 | Peripheral | [Segger](#segger-targets)
wt51822_s4at | s110 | Peripheral | Manual, see [datasheet](https://4tronix.co.uk/picobot2/WT51822-S4AT.pdf) for pinout
pca10040 | s132 | Peripheral and Central | [Segger](#segger-targets)
feather52 | s132 | Peripheral and Central | [UART DFU](#dfu-targets)
feather52 | s132 | Peripheral and Central | Manual, SWDIO and SWCLK solder points on the bottom side of the board
arduino_primo | s132 | Peripheral and Central | [PyOCD](#pyocdopenocd-targets)
pca10056 | | | [Segger](#segger-targets)
@ -124,24 +124,6 @@ Install the necessary tools to flash and debug using OpenOCD:
sudo apt-get install openocd
sudo pip install pyOCD
## DFU Targets
sudo apt-get install build-essential libffi-dev pkg-config gcc-arm-none-eabi git python python-pip
git clone https://github.com/adafruit/Adafruit_nRF52_Arduino.git
cd Adafruit_nRF52_Arduino/tools/nrfutil-0.5.2/
sudo pip install -r requirements.txt
sudo python setup.py install
**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.
Example on how to generate and flash feather52 target:
make BOARD=feather52 SD=s132
make BOARD=feather52 SD=s132 dfu-gen
make BOARD=feather52 SD=s132 dfu-flash
## Bluetooth LE REPL
The port also implements a BLE REPL driver. This feature is disabled by default, as it will deactivate the UART REPL when activated. As some of the nRF devices only have one UART, using the BLE REPL free's the UART instance such that it can be used as a general UART peripheral not bound to REPL.

Wyświetl plik

@ -1,23 +0,0 @@
/*
GNU linker script for NRF52 w/ s132 2.0.1 SoftDevice
*/
/* Specify the memory areas */
/* Memory map: https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/memory-map */
MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K /* entire flash */
FLASH_TEXT (rx) : ORIGIN = 0x0001C000, LENGTH = 162K /* app */
FLASH_TEMP (rx) : ORIGIN = 0x00044800, LENGTH = 162K /* temporary storage area for DFU */
FLASH_USER (rx) : ORIGIN = 0x0006D000, LENGTH = 28K /* app data, filesystem */
RAM (xrw) : ORIGIN = 0x200039C0, LENGTH = 0x0C640 /* 49.5 KiB, give 8KiB headroom for softdevice */
}
/* produce a link error if there is not this amount of RAM for these sections */
_stack_size = 8K;
_minimum_heap_size = 16K;
_fs_start = ORIGIN(FLASH_USER);
_fs_end = ORIGIN(FLASH_USER) + LENGTH(FLASH_USER);
INCLUDE "boards/common.ld"

Wyświetl plik

@ -1,9 +1,8 @@
MCU_SERIES = m4
MCU_VARIANT = nrf52
MCU_SUB_VARIANT = nrf52832
SOFTDEV_VERSION = 2.0.1
LD_FILE = boards/feather52/custom_nrf52832_dfu_app.ld
SOFTDEV_VERSION = 3.0.0
LD_FILES += boards/nrf52832_512k_64k.ld
NRF_DEFINES += -DNRF52832_XXAA