Skip to content

Commit 87f2472

Browse files
orrmanycujomalainey
authored andcommitted
Adding S340 to nrf52840 Feather BSP
* Adding readme to s340 dir * Create and update nrf52840_s340_v6.ld from nrf52840_s140_v6.ld * Update bluefruit.cpp. Handling alternative sd_softdevice_enable() call depending on the presence of ANT license key, while preserving bwd compat. * Fix preprocessor #if semantics * Update .gitignore ** Ignoring s340 binaries, since they are not allowed to be distributed. ** See http://orrmany.hu/wiki/doku.php?id=s340:arduino_ide_integration_for_the_nrf52840_feather_express_with_s340
1 parent dfcc057 commit 87f2472

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed

boards.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,60 @@ feather52840.menu.debug_output.serial1.build.logger_flags=-DCFG_LOGGER=1 -DCFG_T
117117
feather52840.menu.debug_output.rtt=Segger RTT
118118
feather52840.menu.debug_output.rtt.build.logger_flags=-DCFG_LOGGER=2 -DCFG_TUSB_DEBUG=CFG_DEBUG -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
119119

120+
# ----------------------------------
121+
# Bluefruit Feather nRF52840 Express s340
122+
# ----------------------------------
123+
feather52840_s340.name=Adafruit Bluefruit Feather nRF52840 Express w.ANT
124+
125+
# VID/PID for bootloader with/without UF2, Arduino + Circuitpython App
126+
feather52840_s340.vid.0=0x239A
127+
feather52840_s340.pid.0=0x8029
128+
feather52840_s340.vid.1=0x239A
129+
feather52840_s340.pid.1=0x0029
130+
feather52840_s340.vid.2=0x239A
131+
feather52840_s340.pid.2=0x002A
132+
feather52840_s340.vid.3=0x239A
133+
feather52840_s340.pid.3=0x802A
134+
135+
# Upload
136+
feather52840_s340.bootloader.tool=bootburn
137+
feather52840_s340.upload.tool=nrfutil
138+
feather52840_s340.upload.protocol=nrfutil
139+
feather52840_s340.upload.use_1200bps_touch=true
140+
feather52840_s340.upload.wait_for_upload_port=true
141+
feather52840_s340.upload.maximum_size=815104
142+
feather52840_s340.upload.maximum_data_size=237568
143+
#TODO: fix sizes above
144+
145+
# Build
146+
feather52840_s340.build.mcu=cortex-m4
147+
feather52840_s340.build.f_cpu=64000000
148+
feather52840_s340.build.board=NRF52840_FEATHER
149+
feather52840_s340.build.core=nRF5
150+
feather52840_s340.build.variant=feather_nrf52840_express
151+
feather52840_s340.build.usb_manufacturer="Adafruit LLC"
152+
feather52840_s340.build.usb_product="Feather nRF52840 Express"
153+
feather52840_s340.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
154+
feather52840_s340.build.ldscript=nrf52840_s340_v6.ld
155+
feather52840_s340.build.vid=0x239A
156+
feather52840_s340.build.pid=0x8029
157+
158+
# SofDevice Menu
159+
feather52840_s340.menu.softdevice.s340v6=0.3.0 SoftDevice s340 6.1.1
160+
feather52840_s340.menu.softdevice.s340v6.build.sd_name=s340
161+
feather52840_s340.menu.softdevice.s340v6.build.sd_version=6.1.1
162+
feather52840_s340.menu.softdevice.s340v6.build.sd_fwid=0x00B9
163+
164+
# Debug Menu
165+
feather52840_s340.menu.debug.l0=Level 0 (Release)
166+
feather52840_s340.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0
167+
feather52840_s340.menu.debug.l1=Level 1 (Error Message)
168+
feather52840_s340.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
169+
feather52840_s340.menu.debug.l2=Level 2 (Full Debug)
170+
feather52840_s340.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
171+
feather52840_s340.menu.debug.l3=Level 3 (Segger SystemView)
172+
feather52840_s340.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
173+
120174
# -----------------------------------
121175
# Adafruit Feather nRF52840 Sense
122176
# -----------------------------------

cores/nRF5/linker/nrf52840_s340_v6.ld

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Linker script to configure memory regions. */
2+
3+
SEARCH_DIR(.)
4+
GROUP(-lgcc -lc -lnosys)
5+
6+
MEMORY
7+
{
8+
FLASH (rx) : ORIGIN = 0x31000, LENGTH = 0xF4000 - 0x31000
9+
10+
/* SRAM required by S132 depend on
11+
* - Attribute Table Size (Number of Services and Characteristics)
12+
* - Vendor UUID count
13+
* - Max ATT MTU
14+
* - Concurrent connection peripheral + central + secure links
15+
* - Event Len, HVN queue, Write CMD queue
16+
*/
17+
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
18+
}
19+
20+
SECTIONS
21+
{
22+
. = ALIGN(4);
23+
.svc_data :
24+
{
25+
PROVIDE(__start_svc_data = .);
26+
KEEP(*(.svc_data))
27+
PROVIDE(__stop_svc_data = .);
28+
} > RAM
29+
30+
.fs_data :
31+
{
32+
PROVIDE(__start_fs_data = .);
33+
KEEP(*(.fs_data))
34+
PROVIDE(__stop_fs_data = .);
35+
} > RAM
36+
} INSERT AFTER .data;
37+
38+
INCLUDE "nrf52_common.ld"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
This directory needs to store the v6.1.1 version of the BLE+ANT combinded S340 softdevice headers
2+
The way you can get that is described here: https://www.nordicsemi.com/Software-and-tools/Software/S340-ANT
3+
4+
IMPORTANT: You should put the S340 library headers under: s340_nrf52_6.1.1_API
5+
6+
That is, your library tree should look like this:
7+
8+
s340_nrf52_6.1.1_API
9+
└── include
10+
├── ant_error.h
11+
├── ant_interface.h
12+
├── ant_parameters.h
13+
├── ble.h
14+
├── ble_err.h
15+
├── ble_gap.h
16+
├── ble_gatt.h
17+
├── ble_gattc.h
18+
├── ble_gatts.h
19+
├── ble_hci.h
20+
├── ble_l2cap.h
21+
├── ble_ranges.h
22+
├── ble_types.h
23+
├── nrf52
24+
│   └── nrf_mbr.h
25+
├── nrf_error.h
26+
├── nrf_error_sdm.h
27+
├── nrf_error_soc.h
28+
├── nrf_nvic.h
29+
├── nrf_sd_def.h
30+
├── nrf_sdm.h
31+
├── nrf_soc.h
32+
└── nrf_svc.h

0 commit comments

Comments
 (0)