summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-14tools/mpy-tool.py: Make global qstr list a dedicated class.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14tools/mpy-tool.py: Optimise freezing of empty str and bytes objects.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14tools/mpy-tool.py: Optimise freezing of ints that can fit a small int.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14qemu-arm/test-frzmpy: Add test for freezing constant tuples.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14tests/perf_bench: Update import tests for changes to .mpy consts.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14ports: Recompile bytecode tests now that .mpy format changed.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14tools/mpy-tool.py: Support freezing tuples and other consts.Damien George
This also simplifies how constants are frozen. Signed-off-by: Damien George <damien@micropython.org>
2022-04-14tools/mpy-tool.py: Support loading tuples from .mpy files.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14py/persistentcode: Support loading and saving tuples in .mpy files.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14py/parse: Add MICROPY_COMP_CONST_TUPLE option to build const tuples.Damien George
This commit adds support to the parser so that tuples which contain only constant elements (bool, int, str, bytes, etc) are immediately converted to a tuple object. This makes it more efficient to use tuples containing constant data because they no longer need to be created at runtime by the bytecode (or native code). Furthermore, with this improvement constant tuples that are part of frozen code are now able to be stored fully in ROM (this will be implemented in later commits). Code size is increased by about 400 bytes on Cortex-M4 platforms. See related issue #722. Signed-off-by: Damien George <damien@micropython.org>
2022-04-14py/parse: Print const object value in mp_parse_node_print.Damien George
To give more information when printing the parse tree. Signed-off-by: Damien George <damien@micropython.org>
2022-04-14py/parse: Factor obj extract code to mp_parse_node_extract_const_object.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14py/persistentcode: Define enum values for obj types instead of letters.Damien George
To keep the separate parts of the code that use these values in sync. And make it easier to add new object types. Signed-off-by: Damien George <damien@micropython.org>
2022-04-14esp32/modesp32: Properly define RTC_VALID_EXT_PINS on S2/S3 variants.Stephane Smith
On ESP32 S2/S3 variants, GPIO0 through GPIO21 are valid RTC pins. This commit defines the valid RTC_VALID_EXT_PINS for the S2/S3 variants, otherwise, it keeps functionality the same.
2022-04-14esp32/machine_pin: Don't expose pins 33-37 when octal SPIRAM is enabled.Stephane Smith
For ESP32-S3 configurations, CONFIG_SPIRAM_MODE_OCT requires pins 33-37 for PSRAM. So exclude them from the machine_pin_type and machine_pin_irq_type object tables.
2022-04-14esp32/boards: Compile GENERIC_SPIRAM and UM_TINYPICO with -Os.Stephane Smith
These boards do not build with IDF v4.4 because the section .iram0.text does not fit in region iram0_0_seg. Enabling SPIRAM increases the code size so use -Os instead of -O2 to build these boards. Fixes issue #8260.
2022-04-14esp32: Add MICROPY_HW_ENABLE_UART_REPL and enable on generic S2/S3.Damien George
Some S2/S3 modules don't use the native USB interface but instead have an external USB-UART. To make the GENERIC_S3/S3 firmware work on these boards the UART REPL is enabled in addition to the native USB CDC REPL. Fixes issues #8418 and #8524. Signed-off-by: Damien George <damien@micropython.org>
2022-04-14esp32/boards: Add test manifest to test freezing during build.Damien George
Includes tests for freezing @micropython.native and @micropython.viper code. Signed-off-by: Damien George <damien@micropython.org>
2022-04-14Revert "py/emitnative: Don't store prelude at end of machine code if..."Damien George
This reverts commit 7e8222ae063d78ae8f901bb0f9fef663edd2edb6. The prelude data must exist somewhere in the native code so load_raw_code and mpy-tool.py can access and parse it. Signed-off-by: Damien George <damien@micropython.org>
2022-04-14stm32/mpbthciport: Switch scheduling callback to use node scheduler.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-14py/scheduler: Add support for scheduling static C-based callbacks.Damien George
If MICROPY_SCHEDULER_STATIC_NODES is enabled then C code can declare a static mp_sched_node_t and schedule a callback using mp_sched_schedule_node(). In contrast to using mp_sched_schedule(), the node version will have at most one pending callback outstanding, and will always be able to schedule if there is nothing already scheduled on this node. This guarantees that the the callback will be called exactly once after it is scheduled. Signed-off-by: Damien George <damien@micropython.org>
2022-04-12rp2/machine_uart: Use read/write mutex to prevent char duplication.Peter Hinch
Duplication of characters is caused by re-entrant calls from separate cores of uart_fill_tx_fifo(). This patch uses a mutex to ensure that a re-entrant execution of the function returns without affecting the UART FIFO. Fixes issues #8344 and #8360.
2022-04-11stm32/boards/PYBD_SFx: Allow FROZEN_MANIFEST to be overridden.Dave Hylands
Because mpconfigboard.mk used = rather then ?= it doesn't allow FROZEN_MANIFEST to be overridden using a GNUmakefile or the manifest.
2022-04-11stm32/system_stm32: Improve H7 PLL and OSC configuration.iabdalkader
- Allow boards to configure CSI, HSI48 and PLL2. - Allow peripheral clock source configuration. - Set H7 SYSCLKSource.
2022-04-11stm32/system_stm32: Allow boards to configure PLL VCI, VCO and FRACN.iabdalkader
This removes hard-coded PLL1/3 VCI, VCO and FRACN.
2022-04-11stm32/system_stm32: Set voltage scaling level 0 for H7 Rev-V devices.iabdalkader
This enables voltage scaling level 0 for H7 Rev-V devices, which allows the CPU to run at the maximum supported operating frequency (480MHz).
2022-04-11stm32/system_stm32: Add H7 switched-mode-power-supply support.iabdalkader
- Add board-level configuration option to set the SMPS supply mode. - Wait for valid voltage levels after configuring the SMPS mode. - Wait for external supply ready flag if SMPS supplies external circuitry.
2022-04-11stm32/Makefile: Add H747 to Makefile's MCU flags.iabdalkader
2022-04-11stm32/sdram: Add function to enable SDRAM power-down mode.iabdalkader
Add power-down mode for maximum power saving while in standby mode, to be used by a board if needed. Also fix a typo in a comment.
2022-04-11stm32/mboot: Add macros for use in led_state_all().Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-11stm32/mboot: Consolidate all UI and add general state change hooks.Damien George
All user interface (LED, button) code has been moved to ui.c, and the interface to this code with the rest of the system now goes through calls to mboot_state_change(). This state-change function can be overridden by a board to fully customise the user interface behaviour. Signed-off-by: Damien George <damien@micropython.org>
2022-04-11tests/inlineasm: Add test for PUSH LR and POP PC.Christian Zietz
2022-04-11py/emitinlinethumb: Use 16 bit encodings for PUSH LR and POP PC.Christian Zietz
The Thumb instruction set has special 16 bit encodings for PUSH involving LR and POP involving PC, which are commonly used in nested functions. Using this encoding is particularly important for ARMv6-M, where the more general 32 bit encoding of PUSH and POP is unavailable.
2022-04-11docs/differences: Update Python 3.5 diff, with optional listen backlog.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-11extmod/modusocket: Provide config macro for socket.listen backlog deflt.Damien George
To make it possible to change this value for any given port or board. Signed-off-by: Damien George <damien@micropython.org>
2022-04-11extmod/modusocket: Implement optional socket.listen backlog argument.Jon Bjarni Bjarnason
This follows the CPython change: https://bugs.python.org/issue21455 Socket listen backlog defaults to 2 if not given, based on most bare metal targets not having many resources for a large backlog. On UNIX it defaults to SOMAXCONN or 128, whichever is less.
2022-04-11tools/mpremote: Add option to mount cmd to allow "unsafe" symlinks.Rob Knegjens
Specifying the option `--unsafe-links` (or `-l`) to `mpremote mount` will allow symlinks to be followed in the local directory that point outside of the base directory path. For the unsafe case the `path_check()` method of `PyboardCommand` still checks for a common path but without expanding symlinks. While this check is currently redundant, it makes the purpose of the method clearer for possible future uses or extensions.
2022-04-11tools/mpremote: Show progress indicator when copying large files.Rob Knegjens
When copying large files (> 2048 bytes) to or from a device with `mpremote cp` a progress bar and percentage counter are temporarily shown.
2022-04-11rp2/Makefile: Add mbedtls to GIT_SUBMODULES list and use it in CI func.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-11mimxrt/mphalport: Fix USB CDC RX handling to not block when unprocessed.robert-hh
Changes in this commit: - Fix USB CDC RX handling to not block when unprocessed. The fix follows 587339022689187a1acbccc1d0e2425a67385ff7. - Fix dupterm rx. - Remove some obsolete lines.
2022-04-11mimxrt/machine_spi: Improve handling of busy SPI peripheral.robert-hh
This commit changes the method of waiting for SPI being not busy. Instead of the FIFO size, the TransferBusyFlag is probed. Also, raise an error if the transfer failed.
2022-04-11mimxrt/machine_rtc: Start RTC at boot and set datetime if not set.robert-hh
Changes in this commit: - Start the RTC Timer at system boot. Otherwise time.time() will advance only if an RTC() object was created. - Set the time to a more recent date than Jan 1, 1970, if not set. That is 2013/10/14, 19:53:11, MicroPython's first commit. - Compensate an underflow in in timeutils_seconds_since_2000(), called by time.time(), if the time is set to a pre-2000 date.
2022-04-11mimxrt/modules: Append /flash/lib to the default sys.path.robert-hh
2022-04-11mimxrt/boards: Add board.json file for OLIMEX RT1010Py.robert-hh
2022-04-07stm32/machine_bitstream: Include all clobbered regs in Cortex-M0 impl.Damien George
These additional registers are used by the assembly code. Thanks to Jim Mussared for the fix. Signed-off-by: Damien George <damien@micropython.org>
2022-04-07stm32/mpconfigport.h: Let MICROPY_PY_IO_FILEIO take its default value.Damien George
This is enabled at MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES, which is the default for stm32. Not setting the value in mpconfigboard.h allows boards to optionally configure it. Signed-off-by: Damien George <damien@micropython.org>
2022-04-05rp2/mphalport: Fix USB CDC RX handling to not block when unprocessed.Martin Fischer
Prior to this commit, the USB CDC OUT endpoint got NACK'd if a character was received but not consumed by the application, e.g. via sys.stdin.read(). This meant that USB CDC was blocked and no additional characters could be sent from the host. In particular a ctrl-C could not interrupt the application if another character was pending. To fix the issue, the approach in this commit uses a callback tud_cdc_rx_cb which is called by the TinyUSB stack on reception of new CDC data. By consuming the data immediately, the endpoint does not stall anymore. The previous handler tud_cdc_rx_wanted_cb was made obsolete and removed. In addition some cleanup was done along the way: by adding interrupt_char.c and removing the existing code mp_hal_set_interrupt_char(). Also, there is now only one (stdin) ringbuffer. Fixes issue #7996.
2022-04-04esp32: Allow overriding cmake frozen manifest from the command line.iabdalkader
If MICROPY_FROZEN_MANIFEST is set from the cmake command line, then it will override the default and any manifest set by the board.
2022-04-04rp2: Enable ucryptolib, using mbedtls for backend functions.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-04-04extmod/extmod.cmake: Add micropy_lib_mbedtls component.Damien George
Signed-off-by: Damien George <damien@micropython.org>