Commit Graph

244 Commits

Author SHA1 Message Date
Damien George
9a9e5529af zephyr/machine_pin: Retry configuring gpio with just GPIO_OUTPUT.
Some targets like frdm_k64f don't support GPIO_OUTPUT|GPIO_INPUT, so just
use GPIO_OUTPUT in those cases (it seems they still support reading the
current output state even when configured only as GPIO_OUTPUT, unlike other
targets which require both settings).

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
bf432a3e0f zephyr/machine_timer: Make machine.Timer id argument optional.
With a default of -1, for soft timer.  This matches other ports, and the
`extmod/machine_timer.c` implementation.

This change allows the `tests/extmod/machine_soft_timer.py` test to pass.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
0fd65c44cf zephyr/mpconfigport: Enable emergency exception buffer.
Needed to pass exception tests.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
6881618307 zephyr/mpconfigport: Enable sys.maxsize.
Costs +48 bytes.  Useful to introspect the target.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
ec65cac971 zephyr/boards/rpi_pico: Add board configuration for rpi_pico.
Although the rpi_pico can already build and run with the zephyr port, this
configuration improves it in a number of ways:
- Use the USB CDC ACM as the REPL, rather than just a UART.
- Enable I2C and SPI, and add I2C1.
- Enable a filesystem, which matches exactly the rp2 port's RPI_PICO
  configuration.  So switching between zephyr and rp2 is possible and will
  retain the filesystem.
- Make the MicroPython GC heap make the most use of the available RAM.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
0faddb3c8a zephyr/boards/nucleo_wb55rg: Enable BLE, I2C, SPI and add filesystem.
Bluetooth works well now on this board, so enable all supported features.

Also increase the MicroPython GC heap size to make use of the available
RAM.

Unfortunately the filesystem does not match the stm32 port's NUCLEO_WB55
configuration.  That's not possible to do because stm32 uses a 512 byte
flash erase size, while zephyr uses 4096 bytes.  But at least here in
zephyr there's now a sizable and usable filesystem.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
35880d432a zephyr/boards/frdm_k64f: Improve board configuration.
Changes:
- Enable CONFIG_PWM so that `machine.PWM()` works.
- Increase MicroPython GC heap size.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
d0ccaff5b7 zephyr/mpconfigport: Enable MICROPY_NLR_THUMB_USE_LONG_JUMP.
Needed for some ARMv6M boards, eg rpi_pico.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
07285323cf zephyr/mpconfigport: Enable import of mpy and a few related features.
Support for importing .mpy files is quite fundamental to MicroPython these
days, eg it allows installing more efficient .mpy code via "mip install"
(and installing `unittest` only works with the .mpy version because the .py
version uses f-strings, which are not enabled on the zephyr port).  So
enable it generally for use by all boards.

As part of this, also enable:
- min/max: needed by `micropython/import_mpy_invalid.py`, and widely used
- sys.modules: needed by `run-tests.py` to run .mpy tests with --via-mpy
- io module: needed to run .mpy tests, and useful for `io.IOBase`
- array slice assign: needed to run .mpy tests, and generally useful as a
  way to do a memory copy.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
16b00cd6e7 zephyr/mpconfigport: Enable machine.SoftI2C and machine.SoftSPI.
These work now that the C-level pin HAL is implemented.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
19814bf50f zephyr/mphalport: Implement C-level pin HAL.
Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 11:15:11 +10:00
Damien George
359887933c zephyr/machine_pin: Allow constructing a Pin with an existing Pin.
Following other ports.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 10:10:34 +10:00
Damien George
9b97a30943 zephyr/machine_pin: Add Pin.OPEN_DRAIN constant.
Adding this constant is all that's needed to support open-drain pins.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 10:10:33 +10:00
Damien George
6fd069e8a5 zephyr/src: Fix USB device_next driver to work with zephyr 4.0.0.
The blocklist argument is not available in zephyr 4.0.0.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 10:10:16 +10:00
Damien George
6a53319336 zephyr/src: Increase UART input buffer to 512 bytes and reduce latency.
There are two changes here:

1. Increase the UART input bufffer to 512 bytes.  That's necessary to get
   basic REPL reliability tests working, and helps improve `mpremote`
   usage, eg copying large files.

2. Remove `uart_sem` semaphore.  This is no longer needed because
   `zephyr_getchar()` should be fully non-blocking and have as low a
   latency as possible.  `mp_hal_stdin_rx_chr()` (which calls
   `zephyr_getchar`) already uses `MICROPY_EVENT_POLL_HOOK` to get
   an efficient wait, and doing an extra wait and check for the
   semaphore in `zephyr_getchar()` just introduces unnecessary latency and
   can lead to slower input, and potentially overflowing the UART input
   buffer.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 10:10:16 +10:00
Damien George
4951a06bbb zephyr: Enable sys.stdin/out/err.
This change enables `sys.stdin`, `sys.stdout` and `sys.stderr` objects.
They are useful for general IO, and also help with testing zephyr boards.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 10:10:16 +10:00
Damien George
6b82eb75be zephyr/main: Add /flash/lib or /sd/lib to sys.path on start up.
If there is a filesystem available, this change makes sure there is a "lib"
in `sys.path`, eg so that "mip install" works correctly.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 10:10:16 +10:00
Damien George
d9b4327c66 zephyr/main: Execute boot.py and main.py like other ports.
Changes here make the zephyr port act the same as other ports for the
start up and shut down sequence:
- `boot.py` is executed if it exists, and can force a soft reset
- `main.py` is only executed if in friendly REPL and if `boot.py` executed
  successfully; and it can also force a soft reset
- print "MPY: " before "soft reboot" on soft reset

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 10:10:16 +10:00
David Schneider
16d9e704ae zephyr: Update generated header path.
Support disabled LEGACY_GENERATED_INCLUDE_PATH compatibility option.
Since Zephyr 3.7 generated include files are namespaced.

See also: zephyrproject-rtos/zephyr@bbe5e1e6eb

Signed-off-by: David Schneider <schneidav81@gmail.com>
2025-07-08 09:53:24 +10:00
Damien George
5eb94df09e zephyr/prj.conf: Use UART for console as default, not CONSOLE_SUBSYS.
Most boards enable the UART console because it's needed for USB (where USB
CDC creates a virtual UART), and for ctrl-C to work.

The `prj_minimal.conf` settings still use CONSOLE_SUBSYS.

Fixes issue #17608.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 09:29:30 +10:00
Damien George
5321b666ea zephyr/README: Update URL describing QEMU network settings.
Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 09:29:30 +10:00
Damien George
9171865782 zephyr/boards: Disable WDT on qemu boards and networking for cortex_m3.
This gets qemu_x86 and qemu_cortex_m3 building with `prj.conf` settings.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 09:29:30 +10:00
Damien George
49dbe1e272 zephyr/machine_pin: Configure OUT pin also as input so it's readable.
Zephyr allows setting both GPIO_OUTPUT and GPIO_INPUT on a pin, which means
it's an output pin that can have its current value read.

Fixes issue #17596.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-08 08:57:48 +10:00
Daniel Campora
abcf023554 zephyr/machine_uart: Complete UART driver and make it interrupt driven.
Before this commit the UART would only work in very simple use cases.
Receiving large amounts of data would result in lost bytes.  Plus the print
function would crash due to `uart_config_get()` returning incorrect values.
Additionally, receiving data with `timeout==0` would fail even if data was
already available in the internal UART Rx FIFO.

This commit fixes those issues.  The non-implemented functions have also
been made usable.

Signed-off-by: Daniel Campora <danicampora@gmail.com>
2025-07-08 07:50:06 +10:00
Ayush Singh
35f15cfdf2 zephyr/boards/beagleconnect_freedom: Remove board overlay.
Some checks failed
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Since MicroPython supports Zephyr v4.0.0, no need for overlay to enable
PWM.  It is enabled by default for a while now.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-06-23 11:39:43 +10:00
Ayush Singh
41fc3e1505 zephyr/boards/beagleconnect_freedom: Enable networking.
Having both PWM and networking enabled now works fine. So enable subg
networking.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-06-23 11:39:21 +10:00
Andrew Leech
d5f2fc239a extmod/modbluetooth: Add timeout to deinit.
If the BLE radio stops responding before deinit is called the function can
get stuck waiting for an event that is never received, particularly if the
radio is external or on a separate core.

This commit adds a timeout, similar to the timeout already used in the init
function.  Updated for nimble, btstack, esp32 and zephyr bindings.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-06-04 02:21:32 +10:00
Ayush Singh
670b7c9350 zephyr/boards: Add support for BeaglePlay CC1352p7.
- Enable support for FLASH and IEEE802154 subg radio
- Requires Zephyr v3.8.0

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-05-26 12:13:04 +10:00
Alessandro Gatti
f47e214cdc all: Rename the "NORETURN" macro to "MP_NORETURN".
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This commit renames the NORETURN macro, indicating to the compiler
that a function does not return, into MP_NORETURN to maintain the same
naming convention of other similar macros.

To maintain compaitiblity with existing code NORETURN is aliased to
MP_NORETURN, but it is also deprecated for MicroPython v2.

This changeset was created using a similar process to
decf8e6a8b ("all: Remove the "STATIC"
macro and just use "static" instead."), with no documentation or python
scripts to change to reflect the new macro name.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-05-13 10:36:47 +10:00
Anton Blanchard
45e4deb96d zephyr/mpconfigport: Fix mp_int_t and mp_uint_t to work on 64-bit archs.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
These both need to fit a pointer, so make them `intptr_t` and `uintptr_t`,
similar to other ports.

Signed-off-by: Anton Blanchard <antonb@tenstorrent.com>
2025-05-07 21:36:54 +10:00
danicampora
fe28cd78fe zephyr/modbluetooth_zephyr: Allow BLE to create services at runtime.
This commit adds the required functionality for a peripheral to create
services at runtime, using `BLE.register_services()`.

The feature is enabled on the nrf52840dk_nrf52840 board.

Note that the `CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n` option must be used
so that BLE notifications/indications can be sent even if not subscribed.

Signed-off-by: danicampora <danicampora@gmail.com>
2025-05-07 21:25:53 +10:00
Ayush Singh
bee1fd5e78 zephyr/boards: Enable ADC on beagleconnect_freedom.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Enable Analog inputs.  Requires Zephyr >= v3.8.0.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-05-02 12:39:16 +10:00
Vdragon
8728db3e41 zephyr: Introduce auto-listing of FlashArea Partitions.
This enables listing all flash area partitions automagically instead of
just sotrage_partitions.  It uses the label, and the ID when not present.

Signed-off-by: Vdragon <mail@massdriver.space>
2025-05-02 12:37:20 +10:00
Vdragon
6601d4d7eb zephyr: Create ability to use device_next with CDC ACM as REPL.
This enables using the newer USB stack and its CDC ACM for the REPL.

To switch to it, board file must contain `CONFIG_USB_DEVICE_STACK_NEXT=y`
and `CONFIG_USBD_CDC_ACM_CLASS=y`.  In the case of a board that is a
platform that supports the older device stack, `CONFIG_USB_DEVICE_STACK=n`
may be necessary.

Signed-off-by: Vdragon <mail@massdriver.space>
2025-05-02 12:27:14 +10:00
Patrick Joy
62479f2cb6 zephyr/boards: Add nrf9151dk board configuration.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Add support for the nrf9151dk.  This DK has a GD25WB256 32mb external QSPI
flash chip.

Signed-off-by: Patrick Joy <patrick@thinktransit.com.au>
2025-04-30 12:44:12 +10:00
Patrick Joy
e3d9d8ef51 zephyr/boards: Add nrf5340dk board configuration.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Add support for the nrf5340dk.  This DK has a MX25R64 8mb external QSPI
flash chip.

Compile using:

    $ west build -b nrf5340dk/nrf5340/cpuapp

Signed-off-by: Patrick Joy <patrick@thinktransit.com.au>
2025-04-30 12:29:11 +10:00
Vdragon
d939511dae zephyr: Create options to enable frozen modules.
Enables the ability to use frozen modules in the zephyr port.

Enabled by adding `CONFIG_MICROPY_FROZEN_MODULES` to the board
configuration file.  Manually set manifest path with
`CONFIG_MICROPY_FROZEN_MANIFEST`.

Signed-off-by: Vdragon <mail@massdriver.space>
2025-04-30 11:59:17 +10:00
Ayush Singh
f9a755c91c zephyr/boards: Enable PWM on beagleconnect_freedom.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Enable PWM config for bcf.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-04-30 00:30:27 +10:00
Ayush Singh
f4a7e713ea zephyr/machine_pwm: Implement PWM support.
Implement PWM support using standard zephyr APIs, exposed as the standard
MicroPython `machine.PWM` class.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-04-30 00:28:45 +10:00
Maureen Helm
3c8d1b13f5 zephyr: Upgrade to Zephyr v4.0.0.
Updates the Zephyr port build instructions. The CI is updated to use
Zephyr docker image 0.27.4, SDK 0.17.0 and the latest Zephyr release
tag.

Tested on max32690fthr and frdm_k64f.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2025-04-29 23:00:37 +10:00
Detlev Zundel
b83606fe33 zephyr: Remove reference to CONFIG_MMC_VOLUME_NAME for v4.0.
Commit 07a8e3253a2d8a2076c9c83c4ed4158fa3fbb2a2 removes
CONFIG_MMC_VOLUME_NAME from the Kconfig space. Instead we need to use
the device tree to find the "disk-name" property of "zephyr,mmc-disk"
devices.

Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2025-04-29 23:00:37 +10:00
Detlev Zundel
cd3eaad05c zephyr: Fix call to thread_analyzer_print for v4.0.
Commit 1b6e0f64796dfd6f86a8679ea6d24e1fca1e63a8 for Zephyr v4.0.0
changed the function "thread_analyzer_print" to require a cpu argument
and allow thread analysis on each cpu separately. The argument is
ignored when THREAD_ANALYZER_AUTO_SEPARATE_CORES=n which is the
default on single core machines.

Promote this change to the MicroPython zephyr module.

Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2025-04-29 23:00:37 +10:00
Detlev Zundel
cd71db0172 zephyr: Fix prj.conf for v4.1-rc1.
The (deprecated) kconfig option NET_SOCKETS_POSIX_NAMES was removed in
commit abad505bdeed6102061767f45acd63323973f564 so remove it from our
configuration.

As the option has been deprecated longer, this also works for v3.7 and
v4.0 the other still supported versions.

Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2025-04-29 23:00:37 +10:00
danicampora
3823aeb0f1 zephyr/machine_timer: Add machine.Timer class implementation.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Simple `machine.Timer` implementation in-line with the rest of the
MicroPython ports.

Note: Only virtual timers are supported (not linked to any particular
hardware peripheral).

Tested with the nRF5340 and the nRF52840.

Signed-off-by: danicampora <danicampora@gmail.com>
2025-03-07 21:32:22 +11:00
danicampora
859b6efce5 zephyr/machine_wdt: Add watchdog timer implementation.
Simple implementation in-line with the rest of the MicroPython ports

Tested on the nRF52832 and the nRF5340.

Signed-off-by: danicampora <danicampora@gmail.com>
2025-03-05 13:22:22 +11:00
Ayush Singh
fa942d532f zephyr/boards: Add support for BeagleConnect Freedom.
Enable the following capabilities: I2C, SPI, FLASH.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-15 11:44:42 +11:00
Maureen Helm
a9803f4711 zephyr: Allow using devicetree node labels to construct machine objects.
Zephyr v3.7.0 added a new feature to allow getting devices by their
devicetree node labels. Use this feature in the MicroPython Zephyr port
to simplify constructing machine module objects, including Pin, SPI,
I2C, and UART. It's still possible to use the more verbose device names
(e.g., gpio@400ff040, i2c@40066000, spi@4002c000), but now we can also
use their devicetree node labels (e.g., gpiob, i2c0, spi0).

Node labels aren't standardized across all SoC families because they
generally try to follow their respective SoC hardware user manual naming
convention, however many boards define common labels for devices routed
to Arduino headers (e.g., arduino_i2c, arduino_serial, and arduino_spi).
That means I2C("arduino_i2c") will work on quite a few boards (>100 in
the main Zephyr tree).

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-10-01 20:02:01 -05:00
Maureen Helm
f33df7197e zephyr: Refactor device lookup into a common helper function.
Refactors Zephyr device lookup operations into a common helper function
to reduce boilerplate code that was repeated in multiple modules.

Suggested-by: Damien George <damien@micropython.org>
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-10-01 20:02:01 -05:00
Maureen Helm
545d4efb55 zephyr: Upgrade to Zephyr v3.7.0.
Updates the Zephyr port build instructions and CI to use the latest
Zephyr release tag.

Tested on frdm_k64f.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-10-02 07:49:53 +10:00
Maureen Helm
e191265f7f zephyr: Change SPI chip select from a pointer to a struct member.
Zephyr v3.4.0 changed the SPI chip select from a pointer to a struct
member to allow using the existing SPI dt-spec macros in C++.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-10-02 07:49:53 +10:00