add pca10100 for 833 as 3rd party

This commit is contained in:
hathach committed 2024-06-05 18:04:53 +07:00
1 parent 03bb265434
commit 56cb115ece
5 files changed
+302 -49

No files matched your search

+22 -36
View File
@@ -25,18 +25,7 @@ mcu_dict = {
}
def get_mcu(name):
if '52832' in name:
return 52832
elif '52833' in name:
return 52833
else:
# most of the board is 52840
return 52840
def build_upload(name):
mcu = get_mcu(name)
def build_upload(mcu, name):
print("# Upload")
print(f"{name}.bootloader.tool=bootburn")
print(f"{name}.upload.tool=nrfutil")
@@ -53,7 +42,7 @@ def build_upload(name):
print()
def build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid_list):
def build_header(mcu, name, variant, vendor_name, product_name, boarddefine, vid, pid_list):
prettyname = vendor_name + " " + product_name
print()
print("# -----------------------------------")
@@ -68,7 +57,7 @@ def build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid
print(f"{name}.pid.{i}={pid_list[i]}")
print()
build_upload(name)
build_upload(mcu, name)
print("# Build")
print(f"{name}.build.mcu=cortex-m4")
@@ -79,7 +68,6 @@ def build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid
print(f'{name}.build.usb_manufacturer="{vendor_name}"')
print(f'{name}.build.usb_product="{product_name}"')
mcu = get_mcu(name)
mcu_info = mcu_dict[mcu]
print(f"{name}.build.extra_flags={mcu_info['extra_flags']}")
print(f"{name}.build.ldscript={mcu_info['ldscript']}")
@@ -91,9 +79,8 @@ def build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid
print()
def build_softdevice(name):
def build_softdevice(mcu, name):
print("# Menu: SoftDevice")
mcu = get_mcu(name)
if mcu == 52832:
print(f"{name}.menu.softdevice.s132v6=S132 6.1.1")
print(f"{name}.menu.softdevice.s132v6.build.sd_name=s132")
@@ -135,15 +122,16 @@ def build_debug_output(name):
print(f"{name}.menu.debug_output.rtt=Segger RTT")
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")
def build_global_menu():
print("menu.softdevice=SoftDevice")
print("menu.debug=Debug Level")
print("menu.debug_output=Debug Port")
def make_board(name, variant, vendor_name, product_name, boarddefine, vid, pid_list):
build_header(name, variant, vendor_name, product_name, boarddefine, vid, pid_list)
build_softdevice(name)
def make_board(mcu, name, variant, vendor_name, product_name, boarddefine, vid, pid_list):
build_header(mcu, name, variant, vendor_name, product_name, boarddefine, vid, pid_list)
build_softdevice(mcu, name)
build_debug(name)
build_debug_output(name)
@@ -158,37 +146,37 @@ build_global_menu()
# ------------------------------
adafruit_boards_list = [
["feather52832", "feather_nrf52832", "Adafruit", "Feather nRF52832", "NRF52832_FEATHER",
[52832, "feather52832", "feather_nrf52832", "Adafruit", "Feather nRF52832", "NRF52832_FEATHER",
"0x239A", []],
["feather52840", "feather_nrf52840_express", "Adafruit", "Feather nRF52840 Express", "NRF52840_FEATHER",
[52840, "feather52840", "feather_nrf52840_express", "Adafruit", "Feather nRF52840 Express", "NRF52840_FEATHER",
"0x239A", ["0x8029", "0x0029", "0x002A", "0x802A"]],
["feather52840sense", "feather_nrf52840_sense", "Adafruit", "Feather nRF52840 Sense", "NRF52840_FEATHER_SENSE",
[52840, "feather52840sense", "feather_nrf52840_sense", "Adafruit", "Feather nRF52840 Sense", "NRF52840_FEATHER_SENSE",
"0x239A", ["0x8087", "0x0087", "0x0088", "0x8088"]],
["feather_nrf52840_sense_tft", "feather_nrf52840_sense_tft", "Adafruit", "Feather nRF52840 Sense TFT", "NRF52840_FEATHER_SENSE_TFT",
[52840, "feather_nrf52840_sense_tft", "feather_nrf52840_sense_tft", "Adafruit", "Feather nRF52840 Sense TFT", "NRF52840_FEATHER_SENSE_TFT",
"0x239A", ["0x8087", "0x0087", "0x0088", "0x8088"]], # TODO shared VID with sense for now
["itsybitsy52840", "itsybitsy_nrf52840_express", "Adafruit", "ItsyBitsy nRF52840 Express", "NRF52840_ITSYBITSY -DARDUINO_NRF52_ITSYBITSY",
[52840, "itsybitsy52840", "itsybitsy_nrf52840_express", "Adafruit", "ItsyBitsy nRF52840 Express", "NRF52840_ITSYBITSY -DARDUINO_NRF52_ITSYBITSY",
"0x239A", ["0x8051", "0x0051", "0x0052", "0x8052"]],
["cplaynrf52840", "circuitplayground_nrf52840", "Adafruit", "Circuit Playground Bluefruit", "NRF52840_CIRCUITPLAY",
[52840, "cplaynrf52840", "circuitplayground_nrf52840", "Adafruit", "Circuit Playground Bluefruit", "NRF52840_CIRCUITPLAY",
"0x239A", ["0x8045", "0x0045", "0x8046"]],
["cluenrf52840", "clue_nrf52840", "Adafruit", "CLUE", "NRF52840_CLUE",
[52840, "cluenrf52840", "clue_nrf52840", "Adafruit", "CLUE", "NRF52840_CLUE",
"0x239A", ["0x8071", "0x0071", "0x8072"]],
["ledglasses_nrf52840", "ledglasses_nrf52840", "Adafruit", "LED Glasses Driver nRF52840", "NRF52840_LED_GLASSES",
[52840, "ledglasses_nrf52840", "ledglasses_nrf52840", "Adafruit", "LED Glasses Driver nRF52840", "NRF52840_LED_GLASSES",
"0x239A", ["0x810D", "0x010D", "0x810E"]],
["mdbt50qrx", "raytac_mdbt50q_rx", "Raytac", "nRF52840 Dongle", "MDBT50Q_RX",
[52840, "mdbt50qrx", "raytac_mdbt50q_rx", "Raytac", "nRF52840 Dongle", "MDBT50Q_RX",
"0x239A", ["0x810B", "0x010B", "0x810C"]],
["metro52840", "metro_nrf52840_express", "Adafruit", "Metro nRF52840 Express", "NRF52840_METRO",
[52840, "metro52840", "metro_nrf52840_express", "Adafruit", "Metro nRF52840 Express", "NRF52840_METRO",
"0x239A", ["0x803F", "0x003F", "0x0040", "0x8040"]],
# ["feather52833", "feather_nrf52833_express", "Adafruit", "Feather nRF52833 Express", "NRF52833_FEATHER",
# [52833, "feather52833", "feather_nrf52833_express", "Adafruit", "Feather nRF52833 Express", "NRF52833_FEATHER",
# "0x239A", ["0x8029", "0x0029", "0x002A", "0x802A"]],
]
@@ -207,11 +195,9 @@ print("# and are not officially supported")
print("# -------------------------------------------------------")
thirdparty_boards_list = [
["pca10056", "pca10056", "Nordic", "nRF52840 DK", "NRF52840_PCA10056",
"0x239A", ["0x8029", "0x0029"]],
["particle_xenon", "particle_xenon", "Particle", "Xenon", "PARTICLE_XENON",
"0x239A", ["0x8029", "0x0029"]],
[52840, "pca10056", "pca10056", "Nordic", "nRF52840 DK", "NRF52840_PCA10056", "0x239A", ["0x80DA", "0x00DA"]],
[52833, "pca10100", "pca10100", "Nordic", "nRF52833 DK", "NRF52833_PCA10100", "0x239A", ["0x80D8", "0x00D8"]],
[52840, "particle_xenon", "particle_xenon", "Particle", "Xenon", "PARTICLE_XENON", "0x239A", ["0x80DA", "0x00DA"]],
]
for b in thirdparty_boards_list:
+9 -7
View File
@@ -2,12 +2,6 @@ import os
import urllib.request
from multiprocessing import Pool
# Get all variants
all_variant = []
for entry in os.scandir("variants"):
if entry.is_dir():
all_variant.append(entry.name)
all_variant.sort()
# Detect version in platform.txt
version = ''
@@ -24,7 +18,7 @@ print(f'version {version}')
def get_sd(name):
if '52832' in name:
return 's132_6.1.1'
elif '52833' in name:
elif '52833' in name or name == 'pca10100':
return 's140_7.3.0'
else:
# most of the board is 52840
@@ -58,6 +52,14 @@ def download_variant(variant):
print(f"Downloading {f_uf2}")
urllib.request.urlretrieve(url_prefix + f_uf2, f'bootloader/{variant}/{f_uf2}')
if __name__ == "__main__":
# Get all variants
all_variant = []
for entry in os.scandir("variants"):
if entry.is_dir():
all_variant.append(entry.name)
all_variant.sort()
with Pool() as p:
p.map(download_variant, all_variant)