| Age | Commit message (Collapse) | Author |
|
TinyUSB defines TUD_OPT_RHPORT which is the same thing, make
shorter definition RHPORT in the two files which use it.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
As per 4c9ce826cbfbd99cff10cc933064f87a13bee4ac the tests now target Python
3.8 syntax and features, so update the ruff configuration to match.
Changes in this commit:
- Update to Python 3.8 syntax.
- Ignore import not at top of module warnings.
- Exclude common SDK folders.
- Exclude cpydiff test with intentional error.
Also see: https://github.com/micropython/micropython-lib/pull/1059
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
|
|
Currently the CI for stm32 only tests building about half of the available
MCU families. This commit adds the remaining families to the stm32 CI
jobs.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This is needed to build Cortex-M55 (STM32N6) based boards.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Some boards (eg NUCLEO_G0B1RE and NUCLEO_G474RE) have USB disabled but
still configure MICROPY_HW_USB_FS/HS for the cases where USB does get
enabled. Such a configuration should not build any of the code in
`usbd_conf.c`, nor the USB interrupt handlers.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
This commit fixes the initialization sequence for TinyUSB when enabled on
the stm32 port:
- Following other ports, `mp_usbd_init()` should be called just after
running `boot.py`, to give the user a chance to configure USB.
- Hardware initialization (via `pyb_usbd_init()`) should only occur once,
the first time TinyUSB is started up. This is achieved by adding a hook
to the shared TinyUSB bindings to call `pyb_usbd_init()`, and only do the
hardware init if TinyUSB was not already initialized.
Also, `pyb_usbd_init()` is renamed `mp_usbd_ll_init()` to make it match
with the rest of the stared TinyUSB binding code.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Break the FS and HS initialization routines out into separate functions,
and call them as necessary from the TinyUSB or STM USB helper functions.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This allows a port to do hardware initialization just before the TinyUSB
stack is brought up. That means the hardware is only turned on when it's
needed.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This change adds WeAct Studio Mini STM32H743 board support to the STM32
port. Some of the work from PR #12540 is combined here.
WeAct Studio Mini STM32H43 board:
https://github.com/WeActStudio/MiniSTM32H7xx
This board uses STM32H743VI:
https://www.st.com/en/microcontrollers-microprocessors/stm32h743vi.html
Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Mike Tolkachev <contact@miketolkachev.dev>
|
|
Signed-off-by: Mike Tolkachev <contact@miketolkachev.dev>
|
|
Allows using TinyUSB stack on N6.
Note there's still an issue with TinyUSB on the N6: `pyb_usbd_init()` can't
be called multiple times (on soft-reboot).
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
|
|
This commit adds a new workflow step to the CI, to test the debug
emitter provided by mpy-cross. The checks being done are limited to
make sure that the debug emitter does not crash and emits opcodes for a
simple test file that is guaranteed to work for all configurations.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit fixes a regression introduced in
1b92bda5b8e5e2db8e57c4b7134930e52bc5207a, where a new architecture was
added to mpy-cross but it had no matching native emitter exists.
The result was that the architecture emitter entry point would be
correctly calculated according to the native architecture index, but if
the emitters entry points table was not updated to match the new number
of architectures an out of bound access may be performed.
Unfortunately adding RV64IMC shifted the debug emitter index further
down the table, and that table wasn't updated to reflect the lack of an
emitter for RV64. Adding a NULL entry there would cause a NULL pointer
access as there was no need to perform any check about the emitter entry
point function's validity until now.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
Adds the ability to use PSRAM and non-contiguous memory.
Example usage, add this to dts overlay:
/ {
heap_psram {
compatible = "micropython,heap";
size = <DT_SIZE_M(4)>;
memory-region = <&psram>;
};
heap_sram1 {
compatible = "micropython,heap";
size = <DT_SIZE_K(140)>;
memory-region = <&sram1>;
};
};
Signed-off-by: Vdragon <mail@massdriver.space>
|
|
Allows using custom DTS things such as bindings.
Signed-off-by: Vdragon <mail@massdriver.space>
|
|
Fixes issue #7915.
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
|
|
There were a few typos in the documentation for the `I2CTarget.irq` method
description where `IRQ_ADDR_MATCH_READ` was used, however
`IRQ_ADDR_MATCH_WRITE` should have been used.
Fixes issue #18470.
Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
|
|
Fixes issue #18370.
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
|
|
This commit adds custom command completion functions for both the zsh
and fish shell.
The behaviour for those new completions follow the existing completion
for the bash shell, including the way to generate the completion alias
(with appropriately named command line switches).
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
Add the IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP to modsocket in the Unix
port so that the directives take on the values defined in the system
headers. This is needed because the values of these directives are
different for MacOS vs other Unix systems.
Fixes issue #8456.
Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
|
|
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: '6'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
|
|
Uses constants added in previous commit.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
Changes are:
- Add constants for some of the supported ESP-NOW data rates.
- Add constants for switching an ESP32 WLAN radio in/out of
Long Range mode.
- Document the new constants and their usage.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
Only set the rate on interfaces that are active.
It seems ESP-IDF 5.4.x or so added checks that the interface is enabled,
whereas previous versions silently did nothing.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
Noted while adding C2 support that some of these comments are a bit out of
date. Spun out to its own commit, and also mention C5 as well.
This change also adds some recommendation on which ESP32 board to pick, as
we occasionally see issues or questions that would be non-issues on a board
with more RAM (and for small production or personal projects the savings of
picking a cheaper ESP32 chip are basically neglible).
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
It's now available in the version of TinyUSB used by this repository.
Also, update to the newer `tud_cdc_configure_t` struct name and newer
`tud_cdc_configure()` function name.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This is 0.19.0 plus the following changes:
- remove obsolete dcd_esp32sx
- fix for HID stylus descriptor and HID example
- typos, docs and generator scripts
- MTP fix
- DWC2 enumeration when EP0 size=8
- DWC2 fix for EP0 IN
- stm32 FSDEV IRQ remapping fix
- DWC2 ZLP fix
The reason we need the extra 24 commits is due to a bug with TinyUSB's
handling of zero-length-packets in the DWC2 (Synopsis) backend, which
affects the stm32 port. That's fixed by
https://github.com/hathach/tinyusb/pull/3293
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
This commit adds a `--json` option to `mpy-tool.py`, in order to generate
Compiler-Explorer-compatible JSON annotation information for the bytecode
disassembly. Some of this information might be theoretically possible to
parse out from the text itself, but not all of it is, e.g. disambiguating
child references with non-unique simple names.
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
|
|
Add wrapper macros that by default expand to the callback name.
Users can define this macro to add a prefix (e.g., mp_) to
callback implementations, to redirect or completely override
MicroPython's TinyUSB callbacks.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
|
|
When `MICROPY_PYEXEC_ENABLE_EXIT_CODE_HANDLING` is enabled, `SystemExit`
now sets the `PYEXEC_FORCED_EXIT` flag in addition to the exit code. This
allows the REPL to properly detect and exit when SystemExit is raised,
while still preserving the exit code in the lower bits.
Fixes `repl_lock.py` test which expects REPL to exit on `SystemExit`.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
|
|
Enable `MICROPY_PYEXEC_ENABLE_EXIT_CODE_HANDLING` to propagate `sys.exit()`
exit codes properly. Update `convert_pyexec_result()` to handle return
values where pyexec returns the exit code with `PYEXEC_FORCED_EXIT` flag
set for `SystemExit`. Extract the exit code from the lower 8 bits when the
flag is set, otherwise return as-is (0 for success, 1 for exception).
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
|
|
This ensures that ctrl-C works on the unix port when executing code at the
REPL.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Consolidates file and string execution to use the standard pyexec interface
for consistency with other ports.
Simplify execute_from_lexer for remaining usage: Remove unused LEX_SRC_VSTR
and LEX_SRC_FILENAME cases, keeping only LEX_SRC_STR for REPL and
LEX_SRC_STDIN for stdin execution.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
|
|
Add a general normalize_newlines() function that handles newline variations
(\\r\\r\\n, \\r\\n) to \\n while preserving literal \\r characters that are
part of test content.
This provides a robust solution for cross-platform test compatibility,
particularly addressing PTY double-newline issues that can occur with some
terminal implementations.
The function is applied to all test output before comparison, eliminating
platform-specific newline issues.
Includes a unit test to verify the normalization behavior.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
|
|
Provides support for command line `-X compile-only` option on unix port.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
|
|
When `MICROPY_PYEXEC_COMPILE_ONLY` is enabled and the global
`mp_compile_only` is True, code is compiled but not executed.
Also add comprehensive tests for compile-only functionality covering both
successful compilation and syntax error detection.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
|
|
When `MICROPY_MODULE___FILE__` is enabled and parsing file input, set the
global `__file__` variable to the source filename. This matches the
behavior of the unix port and provides the current filename to the
executing script.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
|
|
This improves REPL usage consistency across ports, by utilizing the pyexec
code for the unix REPL.
Only enabled when MICROPY_USE_READLINE == 1 (the default).
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
|
|
RP2350 builds were using the incomplete `rp2_af.csv` alt function table
(originally made for RP2040) which broke pins > 31 in RP2350B (48-pin
QFN-80) builds:
>>> machine.Pin(31)
Pin(GPIO31, mode=IN, pull=PULL_DOWN)
>>> machine.Pin(32)
Pin(GPIO32, mode=ALT, pull=PULL_DOWN, alt=31)
To fix this, separate alt-functions tables for RP2350 and RP2350B are added
in this commit.
UART_AUX (alt function 11) was also missing, along with XIP_CS1 and
CORESIGHT_TRACE, and they are now added as well.
Signed-off-by: Phil Howard <github@gadgetoid.com>
Signed-off-by: Damien George <damien@micropython.org>
|
|
The currently documentation for ilistdir tuples says that the size element
is included based on the platform. However, this is not the case as it is
included based on the filesystem type. This commit makes the according
adjustment.
Fixes issue #17516.
Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
|
|
Currently, dict views (eg `dict.keys()`, `dict.values()`) do not implement
the `bool` or `len` unary operations. That may seem like a reasonable
omission for MicroPython to keep code size down, but it actually leads to
silently incorrect bool operations, because by default things are true.
Eg we currently have:
>>> bool(dict().keys())
True
which is wrong, it should be `False` because the dict is empty.
This commit implements `bool` and `len` unary operations on dict views by
simply delegating to the existing dict unary op function.
Fixes issue #12385.
Signed-off-by: Damien George <damien@micropython.org>
|
|
`globals()` needs to be provided in case `__import__` is a Python function.
|
|
The globals need to be forwarded from the caller's context.
Signed-off-by: Damien George <damien@micropython.org>
|
|
The documentation used integers to specify Teensy board pins, which match
the board's silkscreen. But in Python code Dxx have to be used, since
integers are not accepted as a Pin identifier.
This commit changes the Pinout tables accordingly, consistent with the
other MIMXRT boards.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Signed-off-by: Vdragon <mail@massdriver.space>
|
|
Use new Zephyr FS, and be a demonstration of that configuration.
This is still on-disk compatible with existing filesystems on the internal
flash.
Signed-off-by: Vdragon <mail@massdriver.space>
|