summaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAge
* shared/timeutils: Standardize supported date range on all platforms.HEADmasterYoctopuce dev47 hours
| | | | | | | | | | | | | | | | | | | | | | This is code makes sure that time functions work properly on a reasonable date range, on all platforms, regardless of the epoch. The suggested minimum range is 1970 to 2099. In order to reduce code footprint, code to support far away dates is only enabled specified by the port. New types are defined to identify timestamps. The implementation with the smallest code footprint is when support timerange is limited to 1970-2099 and Epoch is 1970. This makes it possible to use 32 bit unsigned integers for all timestamps. On ARM4F, adding support for dates up to year 3000 adds 460 bytes of code. Supporting dates back to 1600 adds another 44 bytes of code. Signed-off-by: Yoctopuce dev <dev@yoctopuce.com>
* py/obj: Add functions to retrieve large integers from mp_obj_t.Yoctopuce dev47 hours
| | | | | | | | This commit provides helpers to retrieve integer values from mp_obj_t when the content does not fit in a 32 bits integer, without risking an implicit wrap due to an int overflow. Signed-off-by: Yoctopuce dev <dev@yoctopuce.com>
* py/objcode: Implement co_lines method.Anson Mansfield2 days
| | | | Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
* tests/basics/fun_code_colines: Test decoded co_lines values.Anson Mansfield2 days
| | | | Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
* tests/basics/fun_code_full: Test code objects with full feature set.Anson Mansfield2 days
| | | | Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
* py/showbc: Use line-number decoding helper.Anson Mansfield2 days
| | | | Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
* py/bc: Factor out helper for line-number decoding.Anson Mansfield2 days
| | | | Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
* tools/mpremote: Support OSError's on targets without errno.Damien George3 days
| | | | | | | | | | Targets without the `errno` module enabled will not render `OSError`s with the name of the error. Instead they just print the numeric error code. Add support for such targets by explicitly recognising certain error codes. Signed-off-by: Damien George <damien@micropython.org>
* unix/coverage: Add missing MP_OBJ_FROM_PTR casts.Jeff Epler3 days
| | | | | | | | An attempt to build the coverage module into the nanbox binary failed, but pointed out that these sites needed explicit conversion from pointer to object. Signed-off-by: Jeff Epler <jepler@gmail.com>
* stm32/stm32.mk: Error out if compiling for cortex-m55 on old gcc.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* stm32/boards/NUCLEO_N657X0: Add new board definition files.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* stm32/boards/OPENMV_N6: Add new board definition files.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* stm32/spi: Fail spi_init if pins can't be configured.Damien George3 days
| | | | | | Follows the UART and I2C drivers. Signed-off-by: Damien George <damien@micropython.org>
* stm32/mboot: Add support for STM32N6xx MCUs.Damien George3 days
| | | | | | | | Works in the usual USB DFU mode, and can program external SPI flash. It will enable XSPI memory-mapped mode before jumping to the application firmware in the external SPI flash. Signed-off-by: Damien George <damien@micropython.org>
* stm32/boards: Add board support files for N6.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* stm32/lwip_inc: Increase lwIP memory on N6.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* stm32/main: Disable D-cache when debugging N6.iabdalkader3 days
| | | | | | See ST Errata ES0620 - Rev 0.2 section 2.1.2. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* stm32: Add support for STM32N6xx MCUs.Damien George3 days
| | | | | | | | | | | | | | | | | | | | | This commit adds preliminary support for ST's new STM32N6xx MCUs. Supported features of this MCU so far are: - basic clock tree initialisation, running at 800MHz - fully working USB - XSPI in memory-mapped mode - machine.Pin - machine.UART - RTC and deepsleep support - SD card - filesystem - ROMFS - WiFi and BLE via cyw43-driver (SDIO backend) Note that the N6 does not have internal flash, and has some tricky boot sequence, so using a custom bootloader (mboot) is almost a necessity. Signed-off-by: Damien George <damien@micropython.org>
* stm32/boards/make-pins.py: Support up to GPIO-O.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* lib/stm32lib: Update library for N6 v1.1.0.Damien George3 days
| | | | | | | Changes in this new library version are: - Add N6 HAL at v1.1.0. Signed-off-by: Damien George <damien@micropython.org>
* lib/libm_dbl: Support FLT_EVAL_METHOD == 16.Damien George3 days
| | | | | | | That's almost the same as FLT_EVAL_METHOD == 0, but indicates the presence of _Float16_t support. Signed-off-by: Damien George <damien@micropython.org>
* drivers: Support special QSPI direct-read protocol.Damien George3 days
| | | | | | | This is useful for interfaces that stay in memory-mapped mode by default. They can implement this method with a simple `memcpy()`. Signed-off-by: Damien George <damien@micropython.org>
* stm32/machine_adc: Add machine.ADC implementation for STM32L1.Yuuki NAGAO3 days
| | | | Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
* stm32/dma: Extend STM32H5 DMA use to SPI3 and SPI4.Matt Trentini3 days
| | | | | | | | Attempting to configure SPI3 and SPI4 for the STM32H5 would fail with a linker error. This patch resolves that, ensuring that appropriate DMA channels are assigned to those SPI resources. Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
* stm32/irq: Change SPI IRQ priority to be higher than DMA IRQ.Yuuki NAGAO3 days
| | | | | | | | | | On STM32H5/STM32H7, SPI flash cannot use as storage device with DMA. SPI interruption may not be genearated even if DMA transfer has been done. This is due to lower priority of SPI interruption than DMA. This commit changes SPI interrupt priority more higher than DMA's priority. Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
* tests/extmod/select_poll_eintr.py: Skip test if target can't bind.Damien George3 days
| | | | | | | Eg on PYBV10 with THREAD variant, the firmware has both the `_thread` and `socket` modules but no NIC. Signed-off-by: Damien George <damien@micropython.org>
* tests/ports/stm32: Tweak tests to run on a wider set of boards.Damien George3 days
| | | | | | | There should be no change to these tests for existing PYBV1x and PYBD_SFx boards. Signed-off-by: Damien George <damien@micropython.org>
* tests/extmod_hardware/machine_uart_irq_rxidle.py: Test multiple writes.Damien George3 days
| | | | | | | This tests that the RXIDLE callback is called correctly after a second lot of bytes are received. Signed-off-by: Damien George <damien@micropython.org>
* tests/extmod_hardware/machine_uart_irq_rxidle.py: Ignore inital IRQ.Damien George3 days
| | | | | | | On stm32, the hardware generates an RXIDLE IRQ after enabling the UART, because the RX line is technically idle. Signed-off-by: Damien George <damien@micropython.org>
* tests/extmod_hardware: Add UART config for STM32WB boards.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* tests/extmod/machine_uart_tx.py: Support STM32WB boards.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* stm32/uart: Suppress additional RX idle IRQs on F4/L1.Damien George3 days
| | | | | | | | | | | These MCUs only clear the RX idle IRQ if the data register is read, which won't occur if the only IRQ is the RX idle IRQ (because then reading and discarding the DR may lead to lost data). To work around this, explicitly suppress the RX idle IRQ so that it's only passed through to the Python callback once. Signed-off-by: Damien George <damien@micropython.org>
* stm32/machine_adc: Fix internal ADC channel reading on WB MCUs.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* stm32/adc: Fix core temperature reading on WB55.Damien George3 days
| | | | | | | It needs a divisor of 100 because the calibration temperatures are 30 and 130 degrees, similar to the H5. Signed-off-by: Damien George <damien@micropython.org>
* stm32/adc: Simplify ADC calibration settings.Damien George3 days
| | | | | | Combine the common settings for L1/L4/WB with existing G0/G4/H5 settings. Signed-off-by: Damien George <damien@micropython.org>
* stm32/adc: Apply re-read errata for WB55.Damien George3 days
| | | | | | Following 17898f8607dc4fb881e860719cc1906d304e60f4. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/machine_pin: Retry configuring gpio with just GPIO_OUTPUT.Damien George3 days
| | | | | | | | | Some targets like frdm_k64f don't support GPIO_OUTPUT|GPIO_INPUT, so just use GPIO_OUTPUT in those cases (it seems they still support reading the current output state even when configured only as GPIO_OUTPUT, unlike other targets which require both settings). Signed-off-by: Damien George <damien@micropython.org>
* zephyr/machine_timer: Make machine.Timer id argument optional.Damien George3 days
| | | | | | | | | With a default of -1, for soft timer. This matches other ports, and the `extmod/machine_timer.c` implementation. This change allows the `tests/extmod/machine_soft_timer.py` test to pass. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/mpconfigport: Enable emergency exception buffer.Damien George3 days
| | | | | | Needed to pass exception tests. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/mpconfigport: Enable sys.maxsize.Damien George3 days
| | | | | | Costs +48 bytes. Useful to introspect the target. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/boards/rpi_pico: Add board configuration for rpi_pico.Damien George3 days
| | | | | | | | | | | | | Although the rpi_pico can already build and run with the zephyr port, this configuration improves it in a number of ways: - Use the USB CDC ACM as the REPL, rather than just a UART. - Enable I2C and SPI, and add I2C1. - Enable a filesystem, which matches exactly the rp2 port's RPI_PICO configuration. So switching between zephyr and rp2 is possible and will retain the filesystem. - Make the MicroPython GC heap make the most use of the available RAM. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/boards/nucleo_wb55rg: Enable BLE, I2C, SPI and add filesystem.Damien George3 days
| | | | | | | | | | | | | | Bluetooth works well now on this board, so enable all supported features. Also increase the MicroPython GC heap size to make use of the available RAM. Unfortunately the filesystem does not match the stm32 port's NUCLEO_WB55 configuration. That's not possible to do because stm32 uses a 512 byte flash erase size, while zephyr uses 4096 bytes. But at least here in zephyr there's now a sizable and usable filesystem. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/boards/frdm_k64f: Improve board configuration.Damien George3 days
| | | | | | | | Changes: - Enable CONFIG_PWM so that `machine.PWM()` works. - Increase MicroPython GC heap size. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/mpconfigport: Enable MICROPY_NLR_THUMB_USE_LONG_JUMP.Damien George3 days
| | | | | | Needed for some ARMv6M boards, eg rpi_pico. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/mpconfigport: Enable import of mpy and a few related features.Damien George3 days
| | | | | | | | | | | | | | | | | Support for importing .mpy files is quite fundamental to MicroPython these days, eg it allows installing more efficient .mpy code via "mip install" (and installing `unittest` only works with the .mpy version because the .py version uses f-strings, which are not enabled on the zephyr port). So enable it generally for use by all boards. As part of this, also enable: - min/max: needed by `micropython/import_mpy_invalid.py`, and widely used - sys.modules: needed by `run-tests.py` to run .mpy tests with --via-mpy - io module: needed to run .mpy tests, and useful for `io.IOBase` - array slice assign: needed to run .mpy tests, and generally useful as a way to do a memory copy. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/mpconfigport: Enable machine.SoftI2C and machine.SoftSPI.Damien George3 days
| | | | | | These work now that the C-level pin HAL is implemented. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/mphalport: Implement C-level pin HAL.Damien George3 days
| | | | Signed-off-by: Damien George <damien@micropython.org>
* zephyr/machine_pin: Allow constructing a Pin with an existing Pin.Damien George3 days
| | | | | | Following other ports. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/machine_pin: Add Pin.OPEN_DRAIN constant.Damien George3 days
| | | | | | Adding this constant is all that's needed to support open-drain pins. Signed-off-by: Damien George <damien@micropython.org>
* zephyr/src: Fix USB device_next driver to work with zephyr 4.0.0.Damien George3 days
| | | | | | The blocklist argument is not available in zephyr 4.0.0. Signed-off-by: Damien George <damien@micropython.org>