Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info.
name = "Adafruit Industries LLC Feather Bluefruit Sense"

[modules]
__future__ = true
_bleio = false
_eve = false
_pew = false
_pixelmap = false
_stage = false
adafruit_bus_device = false
adafruit_pixelbuf = false
aesio = false
alarm = false
analogbufio = false
analogio = false
atexit = false
audiobusio = false
audiocore = false
audiodelays = false
audiofilters = false
audiofreeverb = false
audioio = false
audiomixer = false
audiomp3 = false
audiopwmio = false
audiospeed = false
aurora_epaper = false
bitbangio = false
bitmapfilter = true # Zephyr board has busio
bitmaptools = true # Zephyr board has busio
bitops = false
board = false
busdisplay = true # Zephyr board has busio
busio = true # Zephyr board has busio
camera = false
canio = false
codeop = false
countio = false
digitalio = true
displayio = true # Zephyr board has busio
dotclockframebuffer = false
dualbank = false
epaperdisplay = true # Zephyr board has busio
floppyio = false
fontio = true # Zephyr board has busio
fourwire = true # Zephyr board has busio
framebufferio = true # Zephyr board has busio
frequencyio = false
getpass = false
gifio = false
gnss = false
hashlib = false
hostnetwork = false
i2cdisplaybus = true # Zephyr board has busio
i2cioexpander = false
i2ctarget = false
imagecapture = false
ipaddress = false
is31fl3741 = false
jpegio = false
keypad = false
keypad_demux = false
locale = false
lvfontio = true # Zephyr board has busio
math = false
max3421e = false
mcp4822 = false
mdns = false
memorymap = false
memorymonitor = false
microcontroller = true
mipidsi = false
msgpack = false
neopixel_write = false
nvm = true # Zephyr board has nvm
onewireio = false
os = true
paralleldisplaybus = false
ps2io = false
pulseio = false
pwmio = false
qrio = false
qspibus = false
rainbowio = true
random = true
rclcpy = false
rgbmatrix = false
rotaryio = true # Zephyr board has rotaryio
rtc = false
sdcardio = true # Zephyr board has busio
sdioio = false
sharpdisplay = true # Zephyr board has busio
socketpool = false
spitarget = false
ssl = false
storage = true # Zephyr board has flash
struct = true
supervisor = true
synthio = false
terminalio = true # Zephyr board has busio
tilepalettemapper = true # Zephyr board has busio
time = true
touchio = false
traceback = true
uheap = false
usb = false
usb_cdc = true
usb_hid = false
usb_host = false
usb_midi = false
usb_video = false
ustack = false
vectorio = true # Zephyr board has busio
warnings = true
watchdog = false
wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CIRCUITPY_BUILD_EXTENSIONS = ["elf", "uf2"]
USB_VID=0x239A
USB_PID=0x8088
NAME="Feather Bluefruit Sense"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info.
name = "Adafruit Industries LLC Feather nRF52840 (Express, Sense)"
name = "Adafruit Industries LLC Feather nRF52840 Express"

[modules]
__future__ = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CIRCUITPY_BUILD_EXTENSIONS = ["elf", "uf2"]
USB_VID=0x239A
USB_PID=0x802A
NAME="Feather nRF52840 Express"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_EXT_ADV=y

CONFIG_USE_DT_CODE_PARTITION=y

CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM=n
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/ {
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
};
};

&zephyr_udc0 {
/delete-node/ board_cdc_acm_uart;
};


&gd25q16 {
/delete-node/ partitions;
};

/delete-node/ &storage_partition;
/delete-node/ &code_partition;

&flash0 {
partitions {
code_partition: partition@26000 {
label = "Application";
reg = <0x00026000 0x000c4000>;
};

storage_partition: partition@ea000 {
label = "storage";
reg = <0x000ea000 0x00008000>;
};

nvm_partition: partition@f2000 {
label = "nvm";
reg = <0x000f2000 0x00002000>;
};
};
};

&uart0 {
status = "okay";
};

#include "../app.overlay"
1 change: 1 addition & 0 deletions ports/zephyr-cp/boards/board_aliases.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ endmacro()

cp_board_alias(pca10056 nrf52840dk/nrf52840)
cp_board_alias(adafruit_feather_nrf52840_zephyr adafruit_feather_nrf52840/nrf52840/uf2)
cp_board_alias(adafruit_feather_nrf52840_sense_zephyr adafruit_feather_nrf52840/nrf52840/sense/uf2)
cp_board_alias(renesas_ek_ra6m5 ek_ra6m5)
cp_board_alias(renesas_ek_ra8d1 ek_ra8d1)
cp_board_alias(renesas_da14695_dk_usb da14695_dk_usb)
Expand Down
21 changes: 12 additions & 9 deletions ports/zephyr-cp/cptools/build_circuitpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ async def build_circuitpython():
genhdr = builddir / "genhdr"
genhdr.mkdir(exist_ok=True, parents=True)
version_header = genhdr / "mpversion.h"
mpconfigboard_fn = board_tools.find_mpconfigboard(portdir, board)
mpconfigboard = {"USB_VID": 0x1209, "USB_PID": 0x000C, "USB_INTERFACE_NAME": "CircuitPython"}
if mpconfigboard_fn is not None and mpconfigboard_fn.exists():
with mpconfigboard_fn.open("rb") as f:
mpconfigboard.update(tomllib.load(f))
async with asyncio.TaskGroup() as tg:
tg.create_task(
cpbuild.run_command(
Expand All @@ -379,21 +384,16 @@ async def build_circuitpython():
)

board_autogen_task = tg.create_task(
zephyr_dts_to_cp_board(zephyr_board, portdir, builddir, zephyrbuilddir)
zephyr_dts_to_cp_board(zephyr_board, portdir, builddir, zephyrbuilddir, mpconfigboard)
)
board_info = board_autogen_task.result()
mpconfigboard_fn = board_tools.find_mpconfigboard(portdir, board)
mpconfigboard = {"USB_VID": 0x1209, "USB_PID": 0x000C, "USB_INTERFACE_NAME": "CircuitPython"}
if mpconfigboard_fn is None:
mpconfigboard_fn = (
portdir / "boards" / board_info["vendor_id"] / board / "circuitpython.toml"
)
logging.warning(
f"Could not find board config at: boards/{board_info['vendor_id']}/{board}"
)
elif mpconfigboard_fn.exists():
with mpconfigboard_fn.open("rb") as f:
mpconfigboard.update(tomllib.load(f))

autogen_board_info_fn = mpconfigboard_fn.parent / "autogen_board_info.toml"

Expand All @@ -402,6 +402,9 @@ async def build_circuitpython():
circuitpython_flags.append(f"-DCIRCUITPY_CREATOR_ID=0x{creator_id:08x}")
circuitpython_flags.append(f"-DCIRCUITPY_CREATION_ID=0x{creation_id:08x}")

vendor = mpconfigboard.get("VENDOR", board_info["vendor"])
name = mpconfigboard.get("NAME", board_info["name"])

enabled_modules, module_reasons = determine_enabled_modules(board_info, portdir, srcdir)

web_workflow_enabled = board_info.get("wifi", False) or board_info.get("hostnetwork", False)
Expand Down Expand Up @@ -459,8 +462,8 @@ async def build_circuitpython():
f"-DUSB_INTERFACE_NAME='\"{mpconfigboard['USB_INTERFACE_NAME']}\"'"
)
for macro, limit, value in (
("USB_PRODUCT", 16, board_info["name"]),
("USB_MANUFACTURER", 8, board_info["vendor"]),
("USB_PRODUCT", 16, name),
("USB_MANUFACTURER", 8, vendor),
):
circuitpython_flags.append(f"-D{macro}='\"{value}\"'")
circuitpython_flags.append(f"-D{macro}_{limit}='\"{value[:limit]}\"'")
Expand Down Expand Up @@ -512,7 +515,7 @@ async def build_circuitpython():
"This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info."
)
)
autogen_board_info.add("name", board_info["vendor"] + " " + board_info["name"])
autogen_board_info.add("name", vendor + " " + name)
autogen_modules = tomlkit.table()
autogen_board_info.add("modules", autogen_modules)
for module in sorted(
Expand Down
4 changes: 3 additions & 1 deletion ports/zephyr-cp/cptools/zephyr2cp.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def find_ram_regions(device_tree):


@cpbuild.run_in_thread
def zephyr_dts_to_cp_board(board_id, portdir, builddir, zephyrbuilddir): # noqa: C901
def zephyr_dts_to_cp_board(board_id, portdir, builddir, zephyrbuilddir, mpconfigboard=None): # noqa: C901
board_dir = builddir / "board"
# Auto generate board files from device tree.

Expand Down Expand Up @@ -486,6 +486,8 @@ def zephyr_dts_to_cp_board(board_id, portdir, builddir, zephyrbuilddir): # noqa
soc_name = board_yaml["socs"][0]["name"]
board_info["soc"] = soc_name
board_name = board_yaml["full_name"]
if mpconfigboard and "NAME" in mpconfigboard:
board_name = mpconfigboard["NAME"]
board_info["name"] = board_name
# board_id_yaml = zephyr_board_dir / (zephyr_board_dir.name + ".yaml")
# board_id_yaml = yaml.safe_load(board_id_yaml.read_text())
Expand Down
Loading