| Age | Commit message (Collapse) | Author |
|
This commit enables support for Zcmp opcodes when the firmware is built
to target ESP32P4 microcontrollers.
The ESP32P4 explicitly supports the Zcmp extension for reducing the
amount of code needed for function prologues and epilogues (see section
4.1.1.1 of the ESP32P4 datasheet).
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit lets the RP2 port build system use the appropriate flags to
pass to "mpy-cross" when building frozen MPY files as part of the build
process.
Now all possible variants (RP2040, RP2350/Arm, and RP2350/RV32) have
their right flags assigned, falling back the flags set of the RP2040 if
a new variant is introduced. Before these changes all variants would
use the RP2040 set of flags which may be a bit of an issue when building
code for the RP2350 in RV32 mode.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit enables support for Zcmp opcodes when the firmware is built
for the RP2350 in RV32 mode.
The RP2350 explicitly supports the Zcmp extension for reducing the
amount of code needed for function prologues and epilogues (see section
3.8.1.20 of the datasheet).
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit introduces the possibility of using Zcmp opcodes when
generating function prologues and epilogues, reducing the generated code
size.
With the addition of selected Zcmp opcodes, each generated function can
be up to 30 bytes shorter and having a faster prologue and epilogue. If
Zcmp opcodes can be used then register saving is a matter of a simple
CM.PUSH opcode rather than a series of C.SWSP opcodes. Conversely,
register restoring is a single CM.POPRET opcode instead of a series of
C.LWSP opcodes followed by a C.JR RA opcode. This should also lead to
faster code given that there's only one opcode doing the registers
saving rather than a series of them.
For functions that allocate less than three locals then the generated
code will allocate up to 12 bytes of unused stack space. Whilst this is
a relatively rare occurrence for generated native and viper code,
inline assembler blocks will probably incur into this penalty. Still,
considering that at the moment the only targets that support Zcmp
opcodes are relatively high-end MCUs (the RP2350 in RV32 mode and the
ESP32P4), this is probably not much of an issue.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit performs the necessary changes to handle an additional RV32
CPU extension flag, for the Zcmp extension in this case.
The changes are not limited to RV32-only code, as other parts of the
tooling need to be modified for this: the testing framework has to be
made aware that an extra bit can be set in sys.implementation._mpy and
needs to know how it is called, and "mpy-cross" must be able to actually
set that flag bit in the first place via the appropriate command line
argument.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit introduces a new optional makefile variable to let the build
system know that, when running code, a custom QEMU binary must be used
instead of the one provided by the system's PATH.
Given that the CI machine won't keep up with QEMU updates unless its
base image tracks a new version of QEMU itself, sometimes it is needed
to use a custom QEMU build to be able to test new code in an emulated
context rather than having to perform on-device testing during
development.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit extends the test runner to automatically discover inline
assembler tests for known RV32 extensions, and checks whether to add the
discovered tests to the enabled tests list.
Automatic discovery requires that inline assembler tests for RV32
extensions follow a specific pattern both for filenames and for the
tests' output in case of success. A valid RV32 extension test must
have:
* A code fragment that checks for support of the extension on the
running target in "/tests/feature_check", called
"inlineasm_rv32_<extensionname>.py" that should print the string
"rv32_<extensionname>" if the extension is supported
* A matching expected result file in "/tests/feature_check" called
"inlineasm_rv32_<extensionname>.py.exp" that must contain the string
"rv32_<extensionname>" (without quotes)
* A regular MicroPython test file in "/tests/inlineasm/rv32" called
"asm_ext_<extensionname>.py"
For example, to test the Zba extension, there must be a file called
"/tests/feature_check/inlineasm_rv32_zba.py" that should print the
string "rv32_zba" if the extension is supported, together with a file
called "/test/feature_check/inlineasm_rv32_zba.py.exp" that contains the
string "rv32_zba" in it, and finally there must be a regular MicroPython
test file called "/tests/inlineasm/rv32/asm_ext_zba.py".
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit introduces a new generic ASM API function to clear a
register (i.e. clearing all the registers' bits).
The native emitter used to perform a XOR operation to clear a given
register, but different platform have more optimised method to achieve
the same result taking up less space - either for the generated code or
for the code generator itself.
Arm, RV32, X86, and X64 already had an already optimised generator and
generated optimised code. The code generator when build for Thumb takes
less space generating a constant immediate move rather than a XOR
operation, even though both operations would distill down to a single
narrow opcode. On Xtensa the situation is almost the same as Thumb,
with the exception that a constant immediate move would take one byte
less than a XOR operation.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
The SDMMC_HOST_DEFAULT() macro sets slot to SDMMC_HOST_SLOT_1, but this
was not being overridden when the user specified a different slot number.
This caused SDMMC initialization to fail on chips like ESP32-P4 when
trying to use slot 0.
This commit ensures the slot number passed to the SDCard constructor is
properly assigned to the host configuration structure.
Tested on ESP32-P4 with SD card on slot 0.
Signed-off-by: jetpax <jep@alphabetiq.com>
|
|
Signed-off-by: Thomas Kiss <thokis@googlemail.com>
|
|
This is unused since 007f127a61ea058ca010b85883072bdefe0234c0 "all:
Simplify mp_int_t/mp_uint_t definition".
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
|
|
This commit introduces ESP8266 support for target wiring tests, fixing
execution of relevant tests that once failed on that platform.
ESP8266 boards need to have GPIO4 and GPIO5 connected together to
provide a UART loopback, in order to test whether UART data effectively
flows through.
The wiring-enabled UART transmission timing test was also updated with
measurements compatible with a few ESP8266 test boards.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit modifies the "extmod/vfs_blockdev_invalid" test to better
behave on boards with low available memory.
Before these changes the test would fail on ESP8266 (at least), due to
low memory, but in a way that could not be easily solved as the error
occurred in the middle of the test.
The test has been rewritten to delay its output until the very end, so
if a low memory condition occurs and needs to stop execution then no
real output will show up before the skip marker.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit marks the "stress/list_sort.py" test to be skipped when
running on ESP8266.
The test just takes too long without yielding to the OS whilst doing the
sort, causing the internal software watchdog to kick in and reboot the
board.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This does not actually cover any additional lines, but it does cover new
functionality not previously covered.
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
|
|
This test fails on all esp32 boards without this fix, because the
try/except that runs with the heap locked attempts to increase the size of
the globals dict when assigning to the exception variable `e`.
Fix that by preallocating the global variable `e`.
Signed-off-by: Damien George <damien@micropython.org>
|
|
The OTA variant of the ESP8266_GENERIC board was never fully completed in
its functionality. It relies on the https://github.com/pfalcon/yaota8266
component which was also never fully finished and has been unmaintained for
many years.
This commit removes this variant and it's associated build support. It
makes it an "old_variant" so the existing historical firmware is still
listed on the download page.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Commit 6201e77999b3614518abc4b21773e735d9b0b0ee removed the
ESP32_GENERIC_S3 FLASH_4M variant from `board.json`. But the firmware
still exists on the download server, and it makes sense to still keep those
old versions available for download, just like all other older versions are
still available.
This commit introduce a new scheme for `board.json` whereby old variants
that are no longer built can be moved to the "old_variants" section. This
keeps them available on the download page, allowing a way to deprecate
individual board variants without removing them entirely.
An optional string can be added to the old variant to describe why it's
obsolete and what to use instead.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
This brings in:
- usb-device: raise RuntimeError when DCD error occurs
- usb-device-hid: return True after submit_xfer
- inspect: implement a very basic signature function
- datetime: apply localtz patch to include naive date/time support
- datetime: optimize for code size
- sdcard: updating sector calculation for SDXC
- mip: optimize _CHUNK_SIZE const for code size
- aioble/examples: change variable name to _ADV_INTERVAL_US
- aioble: fix typo in README in aioble.ADDR_PUBLIC
- copy: fix typo in _deepcopy_dispatch
- requests: update example for fetching using requests
- all: fix formatting errors in docstrings
- CONTRIBUTING: add guidelines for module documentation and versioning
- cbor2: silence missing `__eq__` warning
- pyproject.toml: reorganize ruff lint settings for newer ruff
- all: correct various typos in comments and docs
- lora: fix import error detection for missing drivers
- inspect: support closures/generators/async-funcs in inspect.signature
- usb-device-hid: fix descriptor protocol config and set correct default
- usb-device-hid: use report protocol after report descriptor requested
- umqtt.simple: add unsubscribe method
- aiohttp: correctly handle WebSocket message fragmentation
- iperf3: fix use as a CLI on the unix port of MicroPython
- iperf3: factor out data transfer logic to separate function
- iperf3: fix server UDP mode
- unix-ffi/socket: remove ip add/drop membership from socket
- tarfile: add basic unittest for tarfile.TarFile
- tarfile: fix FileSection.skip to not rely on extended readinto args
- argparse: Add support for custom argument types
- pyproject.toml: add codespell configuration, CI and precommit
- all: fix spelling and typos in comments and docstring
- aioble/examples: change variable name to _ADV_INTERVAL_US
Signed-off-by: Damien George <damien@micropython.org>
|
|
This updates the esp_hosted component for ESP32-P4 boards to use the latest
version 2.7.0. Testing on a P4 board with C6 WiFi shows there are no
regressions for WiFi or BLE.
Also rename the `CONFIG_ESP_ENABLE_BT` option to the new
`CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE` option used by the component.
This change is made partly to work around a current issue with the IDF
component manager, that esp_hosted versions after 2.0.17 and prior to
2.7.0 have all disappeared.
Signed-off-by: Damien George <damien@micropython.org>
|
|
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>
|
|
Add peripheral clock selection for ADC345 to use analog port under ADC3.
Fixes #18527.
Signed-off-by: Yuuki NAGAO <wf.yn386@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: #18061
Fixes: #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>
|
|
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>
|
|
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>
|
|
Add variants to the new ESP32_GENERIC_P4 board, so they appear on the
download page.
Signed-off-by: Damien George <damien@micropython.org>
|
|
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
b5fcb33eaa682bb666c839cd4fb301175cc3564f 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 40df95357c7b3270dc60421a0078fd73b122473f / 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>
|
|
This adds an ANSI-rendered pinout for the WeAct Studio RP2350B Core board.
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
|
|
Add support for the upcoming Soldered NULA Mini ESP32C6 board by Soldered
Electronics.
Signed-off-by: Josip Šimun Kuči <josipsimunkuci@gmail.com>
|
|
This is necessary to get native code running on the ESP32-P4.
Signed-off-by: Damien George <damien@micropython.org>
|
|
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>
|
|
(and a smaller binary size as a result)
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|