The ESP32-P4 currently comes in three revisions (0.0, 0.1 and 1.0) and all
of them are out in the wild. Even though the IDF defaults to a minimum of
0.1 we would like to support as many as possible, so configure MicroPython
to work down to revision 0.0.
The firmware only grows by 32 bytes when enabling this option.
Signed-off-by: Damien George <damien@micropython.org>
Among other things, the framebuf module is missing on NUCEO_G474RE. This
board seems to disable a lot of modules, while other *E boards with the
same flash configuration (eg NUCLEO_F411RE) don't seem to disable any
modules in this way.
So, remove all of the lines disabling modules to make it consistent with
other boards.
Signed-off-by: Steve Sanbeg <steve.sanbeg@gmail.com>
This test reproduces the bug that gave rise to the esp32 segfaults in
issues #18061 and #18481 on all platforms.
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
This fixes the test used by the help function to iterate over its
argument's attribute to use the proper `mp_map_slot_is_filled` function
to check if a slot in the map is filled; the previous test only checked
for `MP_OBJ_NULL` keys and would attempt to print the null value
whenever a `MP_OBJ_SENTINEL` key marking a deleted entry was present.
Fixes: #18061Fixes: #18481
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
Prior to this change mpy-cross would fail to build under Windows with:
D:\a\micropython\micropython\py\emitinlinerv32.c(398,40): warning
C4319: '~': zero extending 'unsigned int' to 'mp_uint_t' of greater
size [D:\a\micropython\micropython\mpy-cross\mpy-cross.vcxproj]
Signed-off-by: Damien George <damien@micropython.org>
Add a cast to fix build error of mpy-cross on Windows CI.
Prior to this fix the failure was:
D:\a\micropython\micropython\py\asmbase.c(105,56): warning C4319: '~':
zero extending 'unsigned int' to 'size_t' of greater size
[D:\a\micropython\micropython\mpy-cross\mpy-cross.vcxproj]
Signed-off-by: Damien George <damien@micropython.org>
The existing `serial_test.py` script tests data in/out throughput and
reliability. But it only tests data sizes that are a power of two, which
may not catch certain errors with USB transmission (because FS packet size
is 64 bytes).
This commit adds a new echo sub-test to the `serial_test.py` script. It
sends out data to the target and gets the target to echo it back, and then
compares the result (the echo'd data should be equal to the sent data). It
does this for data packets between 1 and 520 (inclusive) bytes, which
covers USB FS and HS packet sizes (64 and 512 respectively).
It uses random data for the test, but seeded by a constant seed so that
it's deterministic. If there's an error then it prints out all the sent
and echo'd data to make it easier to see where it went wrong (eg if the
previous packet was repeated).
Signed-off-by: Damien George <damien@micropython.org>
The destination directory for the firmware built by `autobuild.sh` is
currently hard-coded to `/tmp/autobuild-firmware-$$`. Now that there are
many boards built by this script, the `/tmp` partition can run out of
space.
This commit makes the destination directory configurable via the
`MICROPY_AUTOBUILD_DEST` environment variable.
Signed-off-by: Damien George <damien@micropython.org>
As noted in discussion on PR #18263, the id parameter is optional on ports
that support virtual timers.
Add some more general explanation of hardware vs virtual timers, and remove
redundant documentation about timer callbacks in favour of the isr_rules
page.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
- Reverts the change from ec527a1 - since later change cccac2cc we
no longer exit CMake early to get the submodule list, so it's OK
to run component manager during this phase.
- Fixes issue where "make submodules BOARD=ESP32_GENERIC_S3" (or any other
board that depends on USB) would fail due to missing component(s).
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
These recently added boards had copy-paste image names,
change them to match the images pending addition to
micropython-media.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This fixes a regression introduced by PR #17926 / commit
b5fcb33eaa which accidentally disabled
`hashlib.sha1` and the `cryptolib` module on rp2 boards that don't have
networking enabled, eg RPI_PICO.
`hashlib.md5` is enabled to keep the configuration the same as boards that
do have networking enabled.
Signed-off-by: Damien George <damien@micropython.org>
On RP2350B where there are more than 32 pins, using
`pio_sm_set_pins_with_mask()` and `pio_sm_set_pindirs_with_mask()` is not
correct because their arguments are `uint32_t` and higher bits get lost
when `pio.gpio_base(16)` is used.
This commit fixes the issue by using the 64-bit API functions on RP2350B.
It also makes sure pin wrapping is supported, i.e. using [30, 31, 0, 1] or
[46, 47, 16, 17] as contiguous pin ranges for a PIO program.
Fixes issue #16199.
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
Clears the control registers and aborts the closed channel upon a call to
`.close()` and `.__del__()` (GC collect).
Fixes issue #18446.
Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
A follow up to 40df95357c / PR #17692, this
commit adds the HSTX alternate pin function for GPIO12-19 on the RP2350.
Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
Add a #if MICROPY_PY_MACHINE_I2S guard around the call to
machine_i2s_init0() in ports/rp2/main.c. This matches the existing
guard around machine_i2s_deinit_all() in the same function.
Signed-off-by: David Lechner <david@pybricks.com>
Eventually this cache flushing mechanism should be generalised to work the
same way for all architectures. But for now, this allows ESP32 RV32 SoCs
to flush the D-cache whenn needed.
Signed-off-by: Damien George <damien@micropython.org>
This was necessary to un-wedge the USJ TX path on ESP32-P4, I think because
the bootloader prints a lot on this chip. I think it might be possible to
hit it on other chips, though.
The implementation is based on the ESP-IDF driver, which will always add an
extra flush when the TXFIFO is empty in case the host is expecting a ZLP.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Includes a base variant with LAN, and C5_WIFI and C6_WIFI variants with
LAN, WiFi and BLE.
And builds this board in the esp32 CI, to cover the P4 support.
Signed-off-by: Vincent1-python <pywei201209@163.com>
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Signed-off-by: Damien George <damien@micropython.org>
This commit adds support for ESP32-P4 SoCs.
Signed-off-by: Vincent1-python <pywei201209@163.com>
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Signed-off-by: Damien George <damien@micropython.org>
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 4c9ce826cb 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>
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>
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>
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
1b92bda5b8, 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>
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>
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>