Skip to content
Merged
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
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = true # Zephyr board has zephyr_display
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = true # Zephyr board has wifi
zephyr_display = false
zephyr_kernel = false
zlib = false
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
8 changes: 8 additions & 0 deletions ports/zephyr-cp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@
status = "okay";
};

/* Remove slot1 (OTA), expand slot0 to use the space.
* CircuitPython doesn't use OTA updates. */
&slot0_partition {
reg = <0x40000 DT_SIZE_K(656)>;
};

/delete-node/ &slot1_partition;

#include "../app.overlay"
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
6 changes: 6 additions & 0 deletions ports/zephyr-cp/boards/nxp/frdm_rw612/autogen_board_info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = true # Zephyr board has wifi
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = true # Zephyr board has wifi
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = true # Zephyr board has wifi
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = true # Zephyr board has zephyr_display
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = true # Zephyr board has zephyr_display
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = true # Zephyr board has zephyr_display
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ wifi = false
zephyr_display = false
zephyr_kernel = false
zlib = true
# extmod modules shared with MicroPython
asyncio = true
binascii = true
json = true
re = true
select = true
28 changes: 27 additions & 1 deletion ports/zephyr-cp/cptools/build_circuitpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,18 @@
"adafruit_bus_device",
"getpass",
"storage",
"binascii",
"re",
"asyncio",
"select",
]
# Flags that don't match with with a *bindings module. Some used by adafruit_requests
MPCONFIG_FLAGS = ["array", "errno", "io", "json", "math"]

# extmod-based modules that should appear in the autogen list even though they
# don't have shared-bindings/ or bindings/ directories.
EXTMOD_MODULES = ["asyncio", "binascii", "json", "re", "select"]

# List of other modules (the value) that can be enabled when another one (the key) is.
REVERSE_DEPENDENCIES = {
"audiobusio": ["audiocore"],
Expand Down Expand Up @@ -343,7 +351,7 @@ def determine_enabled_modules(board_info, portdir, srcdir):
return enabled_modules, module_reasons


async def build_circuitpython():
async def build_circuitpython(): # noqa: C901
circuitpython_flags = ["-DCIRCUITPY"]
port_flags = []
enable_mpy_native = False
Expand All @@ -362,6 +370,10 @@ async def build_circuitpython():
circuitpython_flags.append(f"-DCIRCUITPY_ENABLE_MPY_NATIVE={1 if enable_mpy_native else 0}")
circuitpython_flags.append(f"-DCIRCUITPY_FULL_BUILD={1 if full_build else 0}")
circuitpython_flags.append(f"-DCIRCUITPY_SETTINGS_TOML={1 if full_build else 0}")
circuitpython_flags.append(f"-DMICROPY_PY_ASYNC_AWAIT={1 if full_build else 0}")
circuitpython_flags.append(f"-DMICROPY_PY_ASYNCIO={1 if full_build else 0}")
circuitpython_flags.append(f"-DMICROPY_PY_SELECT={1 if full_build else 0}")
circuitpython_flags.append(f"-DMICROPY_PY_SELECT_SELECT={1 if full_build else 0}")
circuitpython_flags.append("-DCIRCUITPY_STATUS_BAR=1")
circuitpython_flags.append(f"-DCIRCUITPY_USB_HOST={1 if usb_host else 0}")
circuitpython_flags.append(f"-DCIRCUITPY_BOARD_ID='\"{board}\"'")
Expand Down Expand Up @@ -434,6 +446,10 @@ async def build_circuitpython():
supervisor_source = [
"main.c",
"extmod/modjson.c",
"extmod/modbinascii.c",
"extmod/modre.c",
"extmod/modasyncio.c",
"extmod/modselect.c",
"extmod/vfs_fat.c",
"lib/tlsf/tlsf.c",
portdir / "background.c",
Expand Down Expand Up @@ -592,6 +608,16 @@ async def build_circuitpython():
logger.warning(
f"autogen_board_info.toml is missing or out of date. Please run `make BOARD={board}` locally and commit {autogen_board_info_fn}."
)
autogen_modules.add(tomlkit.comment("extmod modules shared with MicroPython"))
for extmod_module in EXTMOD_MODULES:
enabled = extmod_module in enabled_modules
v = tomlkit.item(enabled)
if extmod_module in module_reasons:
v.comment(module_reasons[extmod_module])
autogen_modules.add(extmod_module, v)
flag_name = MODULE_FLAG_NAMES.get(extmod_module, extmod_module.upper())
circuitpython_flags.append(f"-DCIRCUITPY_{flag_name}={1 if enabled else 0}")

if autogen_board_info_fn.parent.exists():
autogen_board_info_fn.write_text(tomlkit.dumps(autogen_board_info))

Expand Down
Loading