summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-13lib/lwip: Switch to use GitHub mirror repo.Damien George
It is hopefully more reliable. Signed-off-by: Damien George <damien@micropython.org>
2021-05-13py/objarray: Implement more/less comparisons for array.stijn
2021-05-13py/objarray: Prohibit comparison of mismatching types.stijn
Array equality is defined as each element being equal but to keep code size down MicroPython implements a binary comparison. This can only be used correctly for elements with the same binary layout though so turn it into an NotImplementedError when comparing types for which the binary comparison yielded incorrect results: types with different sizes, and floating point numbers because nan != nan.
2021-05-13tests/run-multitests.py: Flush stdout for each line of trace output.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-12stm32/mboot: Make LEDs and reset-mode selection more configurable.Damien George
A board can now customise mboot with: - MBOOT_LED1, MBOOT_LED2, MBOOT_LED3, MBOOT_LED4: if it needs to have different LEDs for mboot compared to the application - MBOOT_BOARD_LED_INIT: if it needs a fully customised LED init function - MBOOT_BOARD_LED_STATE: if it needs a fully customised LED state-setting function - MBOOT_BOARD_GET_RESET_MODE: if it needs a fully customised function to get the reset mode With full customisation, the only requirement is a single LED to show the status of the bootloader (idle, erasing, flashing, etc), which can be configured to do nothing if needed. Signed-off-by: Damien George <damien@micropython.org>
2021-05-12stm32/mboot: Add MBOOT_LEAVE_BOOTLOADER_VIA_RESET option.Damien George
It is enabled by default to get the standard behaviour of doing a reset after it is finished, but can be disabled by a board to jump straight to the application (likely the board needs to use MBOOT_BOARD_CLEANUP to make this work). The application is passed a reset mode of BOARDCTRL_RESET_MODE_BOOTLOADER if the bootloader was active and entered via a jump. Signed-off-by: Damien George <damien@micropython.org>
2021-05-12stm32/boardctrl: Adjust logic for running boot.py, main.py.Damien George
This new logic is equivalent to the old logic when the only possibilities for reset_mode are NORMAL, SAFE_MODE and FILESYSTEM, which is the standard case. But the new logic also allows other reset_mode values (eg BOOTLOADER) to run boot.py and main.py. Signed-off-by: Damien George <damien@micropython.org>
2021-05-12stm32/powerctrl: Add MICROPY_HW_ENTER_BOOTLOADER_VIA_RESET option.Damien George
When disabled the bootloader is entered via a direct jump. When enabled the bootloader is entered via a system reset then a jump. It's enabled by default to retain the existing behaviour, which is the recommended way. Signed-off-by: Damien George <damien@micropython.org>
2021-05-12py/mkenv.mk: Don't emit info about BUILD_VERBOSE if it's set.Damien George
If the user sets V or BUILD_VERBOSE then they don't need to see this message. Signed-off-by: Damien George <damien@micropython.org>
2021-05-12docs/library/rp2.rst: Fix typo overriden->overridden.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-11tests/run-perfbench.py: Fix native feature check.Damien George
This was broken by 8459f538eb45fd8e1e4d614298449cf18de84d75 Signed-off-by: Damien George <damien@micropython.org>
2021-05-11lib/utils: Add ARM semihosting utility functions.Ayke van Laethem
This can be a replacement for a UART in custom ports.
2021-05-11rp2/CMakeLists.txt: Include tinyusb_common in PICO_SDK_COMPONENTS.Damien George
So the TinyUSB headers can be found during qstr processing. Fixes issue #7236. Signed-off-by: Damien George <damien@micropython.org>
2021-05-11esp32/boards/UM_TINYPICO: Fix include of sdkconfig fragment.Chris Greening
This was broken by 32ec07a3504d6dcbfc53997197a3c53e8c03497f
2021-05-10esp32/boards: Add UM_FEATHERS2 and UM_TINYS2 board definitions.Damien George
Based on original commit made by Seon Rozenblum aka @UnexpectedMaker. Signed-off-by: Damien George <damien@micropython.org>
2021-05-10esp32/boards: Rename TINYPICO board to UM_TINYPICO.Seon Rozenblum
And add default hardware SPI 0 pins in mpconfigboard.h, and CONFIG_LWIP_LOCAL_HOSTNAME in sdkconfig.board.
2021-05-10esp32: Extend support for S2 series, and S3 where applicable.Damien George
Improvements made: - PSRAM support for S2 - partition definition for 16MiB flash - correct ADC and DAC pins - correct GPIO and IRQ pins - S3 components in CMakeLists Based on original commit made by Seon Rozenblum aka @UnexpectedMaker. Signed-off-by: Damien George <damien@micropython.org>
2021-05-10tests/thread: Make exc1,exit1,exit2,stacksize1,start1 tests run on rp2.Damien George
The RP2040 has 2 cores and supports running at most 2 Python threads (the main one plus another), and will raise OSError if a thread cannot be created because core1 is already in use. This commit adjusts some thread tests to be robust against such OSError's. These tests now pass on rp2 boards. Signed-off-by: Damien George <damien@micropython.org>
2021-05-10py/gc: Make gc_lock_depth have a count per thread.Damien George
This commit makes gc_lock_depth have one counter per thread, instead of one global counter. This makes threads properly independent with respect to the GC, in particular threads can now independently lock the GC for themselves without locking it for other threads. It also means a given thread can run a hard IRQ without temporarily locking the GC for all other threads and potentially making them have MemoryError exceptions at random locations (this really only occurs on MCUs with multiple cores and no GIL, eg on the rp2 port). The commit also removes protection of the GC lock/unlock functions, which is no longer needed when the counter is per thread (and this also fixes the cas where a hard IRQ calling gc_lock() may stall waiting for the mutex). It also puts the check for `gc_lock_depth > 0` outside the GC mutex in gc_alloc, gc_realloc and gc_free, to potentially prevent a hard IRQ from waiting on a mutex if it does attempt to allocate heap memory (and putting the check outside the GC mutex is now safe now that there is a gc_lock_depth per thread). Signed-off-by: Damien George <damien@micropython.org>
2021-05-09rp2/mpthreadport: Add mp_thread_deinit to reset core1 on soft reset.Damien George
Any code running on core1 should be stopped on soft-reset (the GC heap is reset so if code continues to run on core1 it will see corrupt memory). Signed-off-by: Damien George <damien@micropython.org>
2021-05-08tests/thread: Make stress_aes.py test run on bare-metal ports.Damien George
This is a long-running test, so make it run in reasonable time on slower, bare-metal ports. Signed-off-by: Damien George <damien@micropython.org>
2021-05-08tests/thread: Make stress_create.py test run on esp32.Damien George
The esp32 port needs to be idle for finished threads and their resources to be freed up. Signed-off-by: Damien George <damien@micropython.org>
2021-05-08esp32/mpthreadport: Use binary semaphore instead of mutex.Damien George
So a lock can be acquired on one Python thread and then released on another. A test for this is added. Signed-off-by: Damien George <damien@micropython.org>
2021-05-08esp32/mpthreadport: Don't explicitly free thread struct in TCB cleanup.Damien George
Because vPortCleanUpTCB runs on the FreeRTOS idle task and cannot execute any VM or runtime related code like freeing memory. Signed-off-by: Damien George <damien@micropython.org>
2021-05-08docs/library: Add initial API reference for rp2 module and its classes.Tim Radvan
All the method signatures from rp2_pio.c and friends have been taken and converted to RST format, then explanatory notes added for each signature. Signed-off-by: Tim Radvan <tim@tjvr.org>
2021-05-06drivers/display/ssd1306.py: Add rotate method.Mike Causer
And clean up (make more efficient) display set-up commands.
2021-05-06esp32/esp32_rmt: Clear config struct before filling it out.mishafarms
Or unset entries will have garbage in them. Signed-off-by: mishafarms <github@mishafarms.us>
2021-05-06docs/esp8266: Add WDT to quickref.Mike Causer
2021-05-06docs/esp32: Add SDCard to quickref.Mike Causer
2021-05-06docs/esp32: Add WDT to quickref.Mike Causer
2021-05-06docs/esp32: Add UART to quickref.Mike Causer
2021-05-06extmod/moductypes: Fix size and offset calculation for ARRAY of FLOAT32.Damien George
uctypes.FLOAT32 has a special value representation and uctypes_struct_scalar_size() should be used instead of GET_SCALAR_SIZE(). Signed-off-by: Damien George <damien@micropython.org>
2021-05-06extmod/moductypes: Replace numbers with macro constants.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-06extmod/moductypes: Remove double blank lines and debugging printf's.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-06extmod: Remove old comments used for auto-doc generation.Damien George
They are no longer used, and the text in the docs is more up to date. Signed-off-by: Damien George <damien@micropython.org>
2021-05-06unix/modffi: Use a union for passing/returning FFI values.Damien George
This fixes a bug where double arguments on a 32-bit architecture would not be passed correctly because they only had 4 bytes of storage (not 8). It also fixes a compiler warning/error in return_ffi_value on certian architectures: array subscript 'double[0]' is partly outside array bounds of 'ffi_arg[1]' {aka 'long unsigned int[1]'}. Fixes issue #7064. Signed-off-by: Damien George <damien@micropython.org>
2021-05-04rp2: Move manifest.py to boards directory.Damien George
To match other ports. Signed-off-by: Damien George <damien@micropython.org>
2021-05-04docs/pyboard: Fix typo in pyb.Switch tutorial.Gabriel M Schuyler
2021-05-04docs: Fix some spelling mistakes.Mike Causer
2021-05-04gitignore: Ignore macOS desktop metadata files.Nicko van Someren
2021-05-04stm32/boards: Change default LSI_VALUE to 32000 for F4 MCUs.David Lechner
In the STM32 HAL libraries, the default value for LSI_VALUE for F4 MCUs is 32 kHz. Signed-off-by: David Lechner <david@pybricks.com>
2021-05-04docs/esp8266: Clarify limitations of SSL in esp8266 and fix typos.Mordy Ovits
2021-05-04docs/esp8266: Add instructions on entering programming mode manually.Damien George
This adds to the ESP8266 tutorial instructions explaining which pins to pull low to enter programming mode. Commit made originally by @ARF1 in #2910. Signed-off-by: Damien George <damien@micropython.org>
2021-05-04docs/esp8266: Add note about simultaneous use of STA_IF and AP_IF.Chris Liechti
See also https://github.com/esp8266/Arduino/issues/1624
2021-05-02rp2/tusb_port: Add the device unique-id to the USB id.robert-hh
The number shown in the USB id is now the same as that returned by machine.unique_id(). All 8 bytes are inserted as hex into the USB id. A usb id at /dev/serial/by-id then looks like: usb-MicroPython_Board_in_FS_mode_e469b03567342f37-if00
2021-05-02rp2/boards: Add board definition for SparkFun Pro Micro board.Jan Jurgen Griesfeller
2021-05-02rp2/boards: Add board definition for SparkFun Thing Plus RP2040.Jan Jurgen Griesfeller
2021-05-02py/repl: Autocomplete builtin modules.Artyom Skrobov
Doing "import <tab>" will now complete/list built-in modules. Originally at adafruit#4548 and adafruit#4608 Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>
2021-05-02py/repl: Refactor autocomplete, extracting reusable parts.Artyom Skrobov
Originally at adafruit#4548 Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>
2021-05-02py/repl: Refactor autocomplete to reduce nesting.Artyom Skrobov
Originally at adafruit#4548 Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>