Skip to content

Commit 56cb115

Browse files
committed
add pca10100 for 833 as 3rd party
1 parent 03bb265 commit 56cb115

File tree

5 files changed

+302
-49
lines changed

5 files changed

+302
-49
lines changed

boards.txt

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,9 @@ pca10056.name=Nordic nRF52840 DK
637637

638638
# VID/PID for Bootloader, Arduino & CircuitPython
639639
pca10056.vid.0=0x239A
640-
pca10056.pid.0=0x8029
640+
pca10056.pid.0=0x80DA
641641
pca10056.vid.1=0x239A
642-
pca10056.pid.1=0x0029
642+
pca10056.pid.1=0x00DA
643643

644644
# Upload
645645
pca10056.bootloader.tool=bootburn
@@ -662,7 +662,7 @@ pca10056.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
662662
pca10056.build.ldscript=nrf52840_s140_v6.ld
663663
pca10056.build.openocdscript=scripts/openocd/daplink_nrf52.cfg
664664
pca10056.build.vid=0x239A
665-
pca10056.build.pid=0x8029
665+
pca10056.build.pid=0x80DA
666666
pca10056.build.uf2_family=0xADA52840
667667

668668
# Menu: SoftDevice
@@ -690,16 +690,76 @@ pca10056.menu.debug_output.serial1.build.logger_flags=-DCFG_LOGGER=1 -DCFG_TUSB_
690690
pca10056.menu.debug_output.rtt=Segger RTT
691691
pca10056.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
692692

693+
# -----------------------------------
694+
# Nordic nRF52833 DK
695+
# -----------------------------------
696+
pca10100.name=Nordic nRF52833 DK
697+
698+
# VID/PID for Bootloader, Arduino & CircuitPython
699+
pca10100.vid.0=0x239A
700+
pca10100.pid.0=0x80D8
701+
pca10100.vid.1=0x239A
702+
pca10100.pid.1=0x00D8
703+
704+
# Upload
705+
pca10100.bootloader.tool=bootburn
706+
pca10100.upload.tool=nrfutil
707+
pca10100.upload.protocol=nrfutil
708+
pca10100.upload.use_1200bps_touch=true
709+
pca10100.upload.wait_for_upload_port=true
710+
pca10100.upload.maximum_size=286720
711+
pca10100.upload.maximum_data_size=106496
712+
713+
# Build
714+
pca10100.build.mcu=cortex-m4
715+
pca10100.build.f_cpu=64000000
716+
pca10100.build.board=NRF52833_PCA10100
717+
pca10100.build.core=nRF5
718+
pca10100.build.variant=pca10100
719+
pca10100.build.usb_manufacturer="Nordic"
720+
pca10100.build.usb_product="nRF52833 DK"
721+
pca10100.build.extra_flags=-DNRF52833_XXAA {build.flags.usb}
722+
pca10100.build.ldscript=nrf52833_s140_v7.ld
723+
pca10100.build.openocdscript=scripts/openocd/daplink_nrf52.cfg
724+
pca10100.build.vid=0x239A
725+
pca10100.build.pid=0x80D8
726+
pca10100.build.uf2_family=0x621E937A
727+
728+
# Menu: SoftDevice
729+
pca10100.menu.softdevice.s140v7=S140 7.3.0
730+
pca10100.menu.softdevice.s140v7.build.sd_name=s140
731+
pca10100.menu.softdevice.s140v7.build.sd_version=7.3.0
732+
pca10100.menu.softdevice.s140v7.build.sd_fwid=0x0123
733+
734+
# Menu: Debug Level
735+
pca10100.menu.debug.l0=Level 0 (Release)
736+
pca10100.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0
737+
pca10100.menu.debug.l1=Level 1 (Error Message)
738+
pca10100.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
739+
pca10100.menu.debug.l2=Level 2 (Full Debug)
740+
pca10100.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
741+
pca10100.menu.debug.l3=Level 3 (Segger SystemView)
742+
pca10100.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
743+
pca10100.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
744+
745+
# Menu: Debug Port
746+
pca10100.menu.debug_output.serial=Serial
747+
pca10100.menu.debug_output.serial.build.logger_flags=-DCFG_LOGGER=0
748+
pca10100.menu.debug_output.serial1=Serial1
749+
pca10100.menu.debug_output.serial1.build.logger_flags=-DCFG_LOGGER=1 -DCFG_TUSB_DEBUG=CFG_DEBUG
750+
pca10100.menu.debug_output.rtt=Segger RTT
751+
pca10100.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
752+
693753
# -----------------------------------
694754
# Particle Xenon
695755
# -----------------------------------
696756
particle_xenon.name=Particle Xenon
697757

698758
# VID/PID for Bootloader, Arduino & CircuitPython
699759
particle_xenon.vid.0=0x239A
700-
particle_xenon.pid.0=0x8029
760+
particle_xenon.pid.0=0x80DA
701761
particle_xenon.vid.1=0x239A
702-
particle_xenon.pid.1=0x0029
762+
particle_xenon.pid.1=0x00DA
703763

704764
# Upload
705765
particle_xenon.bootloader.tool=bootburn
@@ -722,7 +782,7 @@ particle_xenon.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
722782
particle_xenon.build.ldscript=nrf52840_s140_v6.ld
723783
particle_xenon.build.openocdscript=scripts/openocd/daplink_nrf52.cfg
724784
particle_xenon.build.vid=0x239A
725-
particle_xenon.build.pid=0x8029
785+
particle_xenon.build.pid=0x80DA
726786
particle_xenon.build.uf2_family=0xADA52840
727787

728788
# Menu: SoftDevice

tools/makeboards.py

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,7 @@
2525
}
2626

2727

28-
def get_mcu(name):
29-
if '52832' in name:
30-
return 52832
31-
elif '52833' in name:
32-
return 52833
33-
else:
34-
# most of the board is 52840
35-
return 52840
36-
37-
38-
def build_upload(name):
39-
mcu = get_mcu(name)
28+
def build_upload(mcu, name):
4029
print("# Upload")
4130
print(f"{name}.bootloader.tool=bootburn")
4231
print(f"{name}.upload.tool=nrfutil")
@@ -53,7 +42,7 @@ def build_upload(name):
5342
print()
5443

5544

56-
def build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid_list):
45+
def build_header(mcu, name, variant, vendor_name, product_name, boarddefine, vid, pid_list):
5746
prettyname = vendor_name + " " + product_name
5847
print()
5948
print("# -----------------------------------")
@@ -68,7 +57,7 @@ def build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid
6857
print(f"{name}.pid.{i}={pid_list[i]}")
6958
print()
7059

71-
build_upload(name)
60+
build_upload(mcu, name)
7261

7362
print("# Build")
7463
print(f"{name}.build.mcu=cortex-m4")
@@ -79,7 +68,6 @@ def build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid
7968
print(f'{name}.build.usb_manufacturer="{vendor_name}"')
8069
print(f'{name}.build.usb_product="{product_name}"')
8170

82-
mcu = get_mcu(name)
8371
mcu_info = mcu_dict[mcu]
8472
print(f"{name}.build.extra_flags={mcu_info['extra_flags']}")
8573
print(f"{name}.build.ldscript={mcu_info['ldscript']}")
@@ -91,9 +79,8 @@ def build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid
9179
print()
9280

9381

94-
def build_softdevice(name):
82+
def build_softdevice(mcu, name):
9583
print("# Menu: SoftDevice")
96-
mcu = get_mcu(name)
9784
if mcu == 52832:
9885
print(f"{name}.menu.softdevice.s132v6=S132 6.1.1")
9986
print(f"{name}.menu.softdevice.s132v6.build.sd_name=s132")
@@ -135,15 +122,16 @@ def build_debug_output(name):
135122
print(f"{name}.menu.debug_output.rtt=Segger RTT")
136123
print(f"{name}.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")
137124

125+
138126
def build_global_menu():
139127
print("menu.softdevice=SoftDevice")
140128
print("menu.debug=Debug Level")
141129
print("menu.debug_output=Debug Port")
142130

143131

144-
def make_board(name, variant, vendor_name, product_name, boarddefine, vid, pid_list):
145-
build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid_list)
146-
build_softdevice(name)
132+
def make_board(mcu, name, variant, vendor_name, product_name, boarddefine, vid, pid_list):
133+
build_header(mcu, name, variant, vendor_name, product_name, boarddefine, vid, pid_list)
134+
build_softdevice(mcu, name)
147135
build_debug(name)
148136
build_debug_output(name)
149137

@@ -158,37 +146,37 @@ def make_board(name, variant, vendor_name, product_name, boarddefine, vid, pid_l
158146
# ------------------------------
159147

160148
adafruit_boards_list = [
161-
["feather52832", "feather_nrf52832", "Adafruit", "Feather nRF52832", "NRF52832_FEATHER",
149+
[52832, "feather52832", "feather_nrf52832", "Adafruit", "Feather nRF52832", "NRF52832_FEATHER",
162150
"0x239A", []],
163151

164-
["feather52840", "feather_nrf52840_express", "Adafruit", "Feather nRF52840 Express", "NRF52840_FEATHER",
152+
[52840, "feather52840", "feather_nrf52840_express", "Adafruit", "Feather nRF52840 Express", "NRF52840_FEATHER",
165153
"0x239A", ["0x8029", "0x0029", "0x002A", "0x802A"]],
166154

167-
["feather52840sense", "feather_nrf52840_sense", "Adafruit", "Feather nRF52840 Sense", "NRF52840_FEATHER_SENSE",
155+
[52840, "feather52840sense", "feather_nrf52840_sense", "Adafruit", "Feather nRF52840 Sense", "NRF52840_FEATHER_SENSE",
168156
"0x239A", ["0x8087", "0x0087", "0x0088", "0x8088"]],
169157

170-
["feather_nrf52840_sense_tft", "feather_nrf52840_sense_tft", "Adafruit", "Feather nRF52840 Sense TFT", "NRF52840_FEATHER_SENSE_TFT",
158+
[52840, "feather_nrf52840_sense_tft", "feather_nrf52840_sense_tft", "Adafruit", "Feather nRF52840 Sense TFT", "NRF52840_FEATHER_SENSE_TFT",
171159
"0x239A", ["0x8087", "0x0087", "0x0088", "0x8088"]], # TODO shared VID with sense for now
172160

173-
["itsybitsy52840", "itsybitsy_nrf52840_express", "Adafruit", "ItsyBitsy nRF52840 Express", "NRF52840_ITSYBITSY -DARDUINO_NRF52_ITSYBITSY",
161+
[52840, "itsybitsy52840", "itsybitsy_nrf52840_express", "Adafruit", "ItsyBitsy nRF52840 Express", "NRF52840_ITSYBITSY -DARDUINO_NRF52_ITSYBITSY",
174162
"0x239A", ["0x8051", "0x0051", "0x0052", "0x8052"]],
175163

176-
["cplaynrf52840", "circuitplayground_nrf52840", "Adafruit", "Circuit Playground Bluefruit", "NRF52840_CIRCUITPLAY",
164+
[52840, "cplaynrf52840", "circuitplayground_nrf52840", "Adafruit", "Circuit Playground Bluefruit", "NRF52840_CIRCUITPLAY",
177165
"0x239A", ["0x8045", "0x0045", "0x8046"]],
178166

179-
["cluenrf52840", "clue_nrf52840", "Adafruit", "CLUE", "NRF52840_CLUE",
167+
[52840, "cluenrf52840", "clue_nrf52840", "Adafruit", "CLUE", "NRF52840_CLUE",
180168
"0x239A", ["0x8071", "0x0071", "0x8072"]],
181169

182-
["ledglasses_nrf52840", "ledglasses_nrf52840", "Adafruit", "LED Glasses Driver nRF52840", "NRF52840_LED_GLASSES",
170+
[52840, "ledglasses_nrf52840", "ledglasses_nrf52840", "Adafruit", "LED Glasses Driver nRF52840", "NRF52840_LED_GLASSES",
183171
"0x239A", ["0x810D", "0x010D", "0x810E"]],
184172

185-
["mdbt50qrx", "raytac_mdbt50q_rx", "Raytac", "nRF52840 Dongle", "MDBT50Q_RX",
173+
[52840, "mdbt50qrx", "raytac_mdbt50q_rx", "Raytac", "nRF52840 Dongle", "MDBT50Q_RX",
186174
"0x239A", ["0x810B", "0x010B", "0x810C"]],
187175

188-
["metro52840", "metro_nrf52840_express", "Adafruit", "Metro nRF52840 Express", "NRF52840_METRO",
176+
[52840, "metro52840", "metro_nrf52840_express", "Adafruit", "Metro nRF52840 Express", "NRF52840_METRO",
189177
"0x239A", ["0x803F", "0x003F", "0x0040", "0x8040"]],
190178

191-
# ["feather52833", "feather_nrf52833_express", "Adafruit", "Feather nRF52833 Express", "NRF52833_FEATHER",
179+
# [52833, "feather52833", "feather_nrf52833_express", "Adafruit", "Feather nRF52833 Express", "NRF52833_FEATHER",
192180
# "0x239A", ["0x8029", "0x0029", "0x002A", "0x802A"]],
193181
]
194182

@@ -207,11 +195,9 @@ def make_board(name, variant, vendor_name, product_name, boarddefine, vid, pid_l
207195
print("# -------------------------------------------------------")
208196

209197
thirdparty_boards_list = [
210-
["pca10056", "pca10056", "Nordic", "nRF52840 DK", "NRF52840_PCA10056",
211-
"0x239A", ["0x8029", "0x0029"]],
212-
213-
["particle_xenon", "particle_xenon", "Particle", "Xenon", "PARTICLE_XENON",
214-
"0x239A", ["0x8029", "0x0029"]],
198+
[52840, "pca10056", "pca10056", "Nordic", "nRF52840 DK", "NRF52840_PCA10056", "0x239A", ["0x80DA", "0x00DA"]],
199+
[52833, "pca10100", "pca10100", "Nordic", "nRF52833 DK", "NRF52833_PCA10100", "0x239A", ["0x80D8", "0x00D8"]],
200+
[52840, "particle_xenon", "particle_xenon", "Particle", "Xenon", "PARTICLE_XENON", "0x239A", ["0x80DA", "0x00DA"]],
215201
]
216202

217203
for b in thirdparty_boards_list:

tools/update_bootloader.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
import urllib.request
33
from multiprocessing import Pool
44

5-
# Get all variants
6-
all_variant = []
7-
for entry in os.scandir("variants"):
8-
if entry.is_dir():
9-
all_variant.append(entry.name)
10-
all_variant.sort()
115

126
# Detect version in platform.txt
137
version = ''
@@ -24,7 +18,7 @@
2418
def get_sd(name):
2519
if '52832' in name:
2620
return 's132_6.1.1'
27-
elif '52833' in name:
21+
elif '52833' in name or name == 'pca10100':
2822
return 's140_7.3.0'
2923
else:
3024
# most of the board is 52840
@@ -58,6 +52,14 @@ def download_variant(variant):
5852
print(f"Downloading {f_uf2}")
5953
urllib.request.urlretrieve(url_prefix + f_uf2, f'bootloader/{variant}/{f_uf2}')
6054

55+
6156
if __name__ == "__main__":
57+
# Get all variants
58+
all_variant = []
59+
for entry in os.scandir("variants"):
60+
if entry.is_dir():
61+
all_variant.append(entry.name)
62+
all_variant.sort()
63+
6264
with Pool() as p:
6365
p.map(download_variant, all_variant)

variants/pca10100/variant.cpp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
Copyright (c) 2018, Adafruit Industries (adafruit.com)
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
See the GNU Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public
17+
License along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
*/
20+
21+
#include "variant.h"
22+
#include "wiring_constants.h"
23+
#include "wiring_digital.h"
24+
#include "nrf.h"
25+
26+
const uint32_t g_ADigitalPinMap[] =
27+
{
28+
// P0
29+
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ,
30+
8 , 9 , 10, 11, 12, 13, 14, 15,
31+
16, 17, 18, 19, 20, 21, 22, 23,
32+
24, 25, 26, 27, 28, 29, 30, 31,
33+
34+
// P1
35+
32, 33, 34, 35, 36, 37, 38, 39,
36+
40, 41, 42, 43, 44, 45, 46, 47
37+
};
38+
39+
40+
void initVariant()
41+
{
42+
// init all 4 onboard LEDs
43+
pinMode(PIN_LED1, OUTPUT);
44+
ledOff(PIN_LED1);
45+
46+
pinMode(PIN_LED2, OUTPUT);
47+
ledOff(PIN_LED2);
48+
49+
pinMode(PIN_LED3, OUTPUT);
50+
ledOff(PIN_LED3);
51+
52+
pinMode(PIN_LED4, OUTPUT);
53+
ledOff(PIN_LED4);
54+
}
55+

0 commit comments

Comments
 (0)