summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-16mimxrt/machine_uart: Add the UART class to the machine module.robert-hh
The implementation uses the LPUARTx devices. Up to 8 UARTs can be used, given that the pins are accessible. E.g. 8 on Teensy 4.1, 5 on MIMXRT1020_EVK. For Tennsy 4.0 and 4.1 the UART numbers are as printed on the pinout 1..N. The MIMXRT10xx-EVK boards have only one UART named, which gets the number 1. All other UART are assigned to different Pins: MIMXRT1010-EVK: D0/D1 UART 1 D6/D7 UART 2 A0/D4 UART 3 MIMXRT1020-EVK: D0/D1 UART 1 D6/D9 UART 2 D10/D12 UART 3 D14/D15 UART 4 A0/A1 UART 5 MIMXRT1050-EVK, MIMXRT1060-EVK, MIMXRT1064-EVK: D0/D1 UART 1 D7/D6 UART 2 D8/D9 UART 3 A1/A0 UART 4
2021-06-15tools/mpremote: Use signal to capture and handle ctrl-C on Windows.Damien George
Now a ctrl-C will not stop mpremote, rather this character will be passed through to the attached device. The mpremote version is also increased to 0.0.5. Signed-off-by: Damien George <damien@micropython.org>
2021-06-15tools/mpremote: Use available ports instead of auto-connect list.Damien George
Using just the list of available ports, instead of a hard-coded list of possible ports, means that all ports will be available for auto connection. And the order that they will be attempted in will match what's printed by "mpremote connect list" (and will be the same as before, trying ACMx before USBx). Auto-connect will also now work on Mac, and will allow all COM ports on Windows. Signed-off-by: Damien George <damien@micropython.org>
2021-06-15extmod/uasyncio: Add readinto() method to Stream class.Mike Teachman
With docs and a multi-test using TCP server/client. This method is a MicroPython extension, although there is discussion of adding it to CPython: https://bugs.python.org/issue41305 Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2021-06-15unix: Fix build on arm64-darwin due to integer cast.Pavol Rusnak
This fixes error: cast to smaller integer type 'int' from 'pthread_t'. pthread_t is defined as long, not as int. Signed-off-by: Pavol Rusnak <pavol@rusnak.io>
2021-06-15rp2/machine_rtc: Check return value from rtc_set_datetime.Krzysztof Adamski
The rtc_set_datetime() from pico-sdk will validate the values in the datetime_t structure and refuse to set the time if they aren't valid. It makes sense to raise an exception if this happens instead of failing silently which might be confusing (as an example, see: https://github.com/micropython/micropython/pull/6928#issuecomment-860166044 ).
2021-06-13stm32/eth: Fix eth_link_status function to use correct BSR bit.iabdalkader
Fixes #7346.
2021-06-13stm32/eth: Add low-power mode configuration option.iabdalkader
Add low power functionality configurable with: lan.config(low_power=True/False)
2021-06-13tests/cpydiff: Add test for array constructor with overflowing value.Zoltán Vörös
2021-06-12mimxrt/machine_rtc: Maintain microsecond offset.robert-hh
The supplied value for microseconds in datetime() will be treated as a starting value for the reported microseconds. Due to internal processing in setting the time, there is an offset about 1 ms.
2021-06-12mimxrt/machine_rtc: Change RTC.datetime() tuple to match other ports.robert-hh
This change moves the datetime tuple format back to the one used by all the other ports: (year, month, day, weekday, hour, minute, second, microsecond) Weekday is a number between 0 and 6, with 0 assigned to Monday. It has to be provided when setting the RTC with datetime(), but will be ignored on entry and calculated when needed. The weekday() method was removed, since that is now again a part of the datetime tuple. The now() method was updated so it continues to return a tuple that matches CPython's datetime module.
2021-06-12rp2/machine_rtc: Add initial support for RTC.Krzysztof Adamski
Initial support for machine.RTC on rp2 port. It only supports datetime() method and nothing else. The method gets/returns a tuple of 8 items, just like esp32 port, for example, but the usec parameter is ignored as the RP2 RTC only works up to seconds precision. The Pico RTC isn't very useful as the time is lost during reset and there seems to be no way to easily power up just the RTC clock with a low current voltage, but still there seems to be use-cases for that, see issues #6831, and a Thonny issue #1592. It was also requested for inclusion on v1.15 roadmap on #6832. Signed-off-by: Krzysztof Adamski <k@japko.eu>
2021-06-12docs/library/machine.RTC.rst: Document datetime method and fix ex code.Peter Hinch
This is the minimum change to fix the example code so it actually runs on the majority of ports.
2021-06-11esp32/README: Describe how to select compatible version of existing IDF.IhorNehrutsa
2021-06-11esp32/partitions-2MiB.csv: Update table so firmware fits.noslaver
The current MicroPython app size is larger than the size allocated in the partitions table.
2021-06-11esp32/makeimg.py: Load sizes from partition table and verify data fits.Damien George
Changes introduced are: - the application offset is now loaded from the partition table instead of being hard-coded to 0x10000 - maximum size of all sections is computed using the partition table - an error is generated if any section overflows its allocated space - remaining bytes are printed for each section Signed-off-by: Damien George <damien@micropython.org>
2021-06-10stm32/sdram: Prevent array-bounds warnings with GCC 11.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-10stm32/boards: Enable MICROPY_HW_SPIFLASH_ENABLE_CACHE on VCC_GND boards.Damien George
Because these boards use the SPI flash cache in their bdev.c configuration. Signed-off-by: Damien George <damien@micropython.org>
2021-06-10stm32/usb: Add USB_VCP.irq method, to set a callback on USB data RX.Damien George
Usage: usb = pyb.USB_VCP() usb.irq(lambda u:print(u, u.read()), usb.IRQ_RX) Signed-off-by: Damien George <damien@micropython.org>
2021-06-08nrf: Add more math sources to Makefile, and enable log2 implementation.Zoltán Vörös
This commit adds a few math functions to the source list in the Makefile, and implements the log2f function, so that ulab can be compiled on the nrf boards. It also addresses part of #5162.
2021-06-08extmod/uasyncio: Fix start_server and wait_closed race condition.Miguel Grinberg
This fix prevents server.wait_closed() from raising an AttributeError when trying to access server.task. This can happen if it is called immediately after start_server().
2021-06-08unix/modffi: Fix conversion between Python integers and ffi types.Abilio Marques
This commit fixes the following problems converting to/from Python integers and ffi types: - integers of 8 and 16 bits not working on big endian - integers of 64 bits not working on 32 bits architectures - unsigned returns were converted to signed Python integers Fixes issue #7269.
2021-06-06tests/unix: Add ffi test for integer types.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-06tests/multi_bluetooth/ble_gap_advertise.py: Allow to work without set.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-06tests/run-multitests.py: Allow to work without sys.stdout on target.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-06zephyr/boards: Enable ubluetooth on nucleo_wb55rg board.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-06zephyr: Add initial ubluetooth module integration.Damien George
Currently only advertising and scanning are supported, using the ring buffer for events (ie not synchronous events at this stage). The ble_gap_advertise.py multi-test passes (tested on a nucleo_wb55rg board). Signed-off-by: Damien George <damien@micropython.org>
2021-06-06zephyr: Update to Zephyr v2.6.0.Maureen Helm
Updates the zephyr port build instructions and CI to use the latest zephyr release tag. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-06zephyr: Disable CONFIG_NET_SOCKETS_POSIX_NAMES.Maureen Helm
Zephyr's default value for CONFIG_NET_SOCKETS_POSIX_NAMES was changed from false to true between Zephyr v2.5.0 and v2.6.0. This caused conflicts in MicroPython, which uses the zsock_ prefixed functions, so disable it. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-06zephyr: Update disk access configuration for Zephyr v2.6.0.Maureen Helm
Zephyr's Kconfig symbols and defaults for SDHC/SDMMC disk drivers and the disk access subsystem were reworked between Zephyr v2.5.0 and v2.6.0. Update MicroPython accordingly. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-05github/workflows: Add workflow to build and run unix port on ARM.Damien George
Following on from ef16834887de02cbddf414b560e5a2af9cae4b16, this adds a coverage build and running of the test suite on an ARM 32-bit Linux-based architecture. Signed-off-by: Damien George <damien@micropython.org>
2021-06-05unix/main: Increase stack limit on ARM architectures.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-05py/stackctrl: Prevent unused-var warning when stack checking disabled.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-05py/emitglue: Always flush caches when assigning native ARM code.Damien George
Prior to this commit, cache flushing for ARM native code was done only in the assembler code asm_thumb_end_pass()/asm_arm_end_pass(), at the last pass of the assembler. But this misses flushing the cache when loading native code from an .mpy file, ie in persistentcode.c. The change here makes sure the cache is always flushed/cleaned/invalidated when assigning native code on ARM architectures. This problem was found running tests/micropython/import_mpy_native_gc.py on the mimxrt port. Signed-off-by: Damien George <damien@micropython.org>
2021-06-04esp32/Makefile: Fix wrong target for partition-table.bin.leo chung
"$(BUILD)/partition_table/partition -table.bin" is typing mistake. Signed-off-by: leo chung <gewalalb@gmail.com>
2021-06-04mimxrt/boards: Add board configuration files for Teensy 4.1.robert-hh
These are at the moment more or less identical to the Teensy 4.0 files, except for the pins.csv file and the flash size.
2021-06-04mimxrt/machine_adc: Add the ADC class to the machine module.Philipp Ebensberger
This adds the machine.ADC class with the read_u16() method. make-pins.py and supporting files are updated to generate ADC information.
2021-06-04mimxrt: Enable many Python and some extmod features.robert-hh
Besides Python features this includes the extmod modules which make use of the Pin module, especially machine.softSPI, machine.SoftI2C and onewire.
2021-06-04mimxrt: Add floating point support.robert-hh
Since not all boards support double fp, all board specific .mk files are affected too.
2021-06-03mimxrt/machine_rtc: Add the RTC class to the machine module.robert-hh
Initial version, using the LP RTC clock. It provides setting the date and time with rtc.init() or rtc.datetime(), and reading the date and time with rtc.datetime() or rtc.now(). The method weekday() reports the weekday of the current date. It starts with 0 for Monday. The tuple order for datetime() and now() matches the CPython sequence: (year, month, day, hour, minute, second, microsecond, TZ). TZ is ignored and reported as None. Microsecond is provided at a best effort. If a battery is not supplied, the default boot date/time is 1970/1/1 0:0:0. With a battery, the clock continues to run even when the board is not powered. The clock is quite precise. If not, using rtc.calibration() may help.
2021-06-03mimxrt/machine_timer: Leave the Timer clock source at IPG clock.robert-hh
Setting it to OSC_CLK interferes the utime module's functionality. This is still an area demanding an understanding.
2021-06-03mimxrt/machine_timer: Reuse any existing timer objects.robert-hh
So there is a 1-1 mapping of hardware timer to Python object.
2021-06-03mimxrt: Remove __WFE() from MICROPY_EVENT_POLL_HOOK.robert-hh
The device is unreliable with the WFE included. This needs further investigation.
2021-06-02mimxrt: Add the Timer class to the machine module.robert-hh
It supports three hardware timer channels based on the PIT timers of the MIMXRT MCU. The timer id's are 0, 1 and 2. On soft reboot all active timers will be stopped via finalisers.
2021-06-02tools/ci.sh: Build mpy-cross as part of ci_mimxrt_build.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-01mimxrt/boards/TEENSY40: Re-create the flash FS after deploy.robert-hh
This is required since the Teensy Halfkay loader attempts to erase all of the flash but fails to do so, at least in my tests. Formatting brings it back to a known state.
2021-06-01mimxrt: Add flash storage support with VFS and littlefs filesystem.robert-hh
This commit adds full support for a filesystem on all boards, with a block device object mimxrt.Flash() and uos.VfsLfs2 enabled. Main changes are: - Refactoring of linker scripts to accomodate reserved area for VFS. VFS will take up most of the available flash. 1M is reserved for code. 9K is reserved for flash configuration, interrupts, etc. - Addition of _boot.py with filesystem init code, called from main.c. - Definition of the mimxrt module with a Flash class in modmimxrt.[ch]. - Implementation of a flash driver class in mimxrt_flash.c. All flashing related functions are stored in ITCM RAM. - Addition of the uos module with filesystem functions. - Implementation of uos.urandom() for the sake of completeness of the uos module. It uses sample code from CircuitPython supplied under MIT license, which uses the NXP SDK example code. Done in collaboration with Philipp Ebensberger aka @alphaFred who contributed the essential part to enable writing to flash while code is executing, among other things.
2021-06-01mimxrt: Enable frozen modules.robert-hh
2021-06-01mimxrt: Add custom help text and enable help("modules").robert-hh
2021-05-30esp32/espneopixel: Add support for GPIO32 and GPIO33.Joseph Chiu
Adds support for NeoPixels on GPIO32 and GPIO33 on ESP32. Otherwise, NeoPixels wired to GPIO32/33 wll silently fail without any hints to the user. With thanks to @robert-hh. Fixes issue #7221.