summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-19all: Make all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE.Jim Mussared
In preparation for upcoming rework of mp_obj_type_t layout. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-19py/obj: Add macro to declare ROM mp_obj_type_t instances.Jim Mussared
This will allow the structure of mp_obj_type_t to change while keeping the definition code the same. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-19all: Standardise mp_obj_type_t initialisation.Jim Mussared
Remove setting unused slots. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-19all: Simplify buffer protocol to just a "get buffer" callback.Jim Mussared
The buffer protocol type only has a single member, and this existing layout creates problems for the upcoming split/slot-index mp_obj_type_t layout optimisations. If we need to make the buffer protocol more sophisticated in the future either we can rely on the mp_obj_type_t optimisations to just add additional slots to mp_obj_type_t or re-visit the buffer protocol then. This change is a no-op in terms of generated code. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-15rp2/Makefile: Add link to build troubleshooting on failure.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-15esp32/Makefile: Add link to build troubleshooting on failure.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-15py/mkrules.mk: Add link to build troubleshooting on failure.Jim Mussared
Also update the submodules help text to match. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-14esp32/mphalport: Fix calculation of large sleep by using 64-bit arith.Damien George
Fixes issue #9304. Signed-off-by: Damien George <damien@micropython.org>
2022-09-13py/objpolyiter: Fix comment about finaliser method.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-09-13mimxrt/machine_uart: Fix a bug in UART.write().robert-hh
Causing an incomplete send if the data size was longer than the buffer size.
2022-09-13mimxrt/machine_uart: Set the UART ioctl write poll flag properly.robert-hh
It was always set to True. The change adds a check to the tx status flag which is set when all data is transferred.
2022-09-13mimxrt/machine_spi: Allow a setting of -1 for cs in the constructor.robert-hh
In that case, no Pin will be configured for the CS signal, even if it is internally still generated. That setting allows to use any pin for CS, which then must be controlled by the Python script. Also make the default cs=-1 to match other ports (software CS).
2022-09-13mimxrt: Format the firmware image to match the new teensy loader.robert-hh
The new teensy loader keeps the file system under certain conditions: - The file size is properly set in the file header. - The header version is 4.3 These changes are implemented here, requiring a backport of fsl_flexspi_nor_boot.c. There is still a problem with the command line version of the teensy loader, which fails on the first attempt. At the second attempt it works. The GUI version of the teensy loader is fine.
2022-09-13mimxrt/machine_uart: Drop a few commented lines about TX ring buffer.robert-hh
2022-09-13tests/extmod/uasyncio_heaplock.py: Force SKIP on stackless.Jim Mussared
This is a latent issue that wasn't caught by CI because there was no configuration that had both stackless+uasyncio. The previous check to skip with stackless builds only worked when the bytecode emitter was used by default. Force the check to use the bytecode emitter. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13unix: Refactor mpconfigvariant.mk.Jim Mussared
All variants (except minimal) enable text compression and fat/lfs, so move them to the common mpconfigport.mk. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13py/mpconfig: Add "everything" features from unix coverage.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13unix: Refactor mpconfigport.h and mpconfigvariant.h.Jim Mussared
This is a no-op for coverage and minimal. The standard and dev variants have been merged and enable the same feature set as a typical bare-metal board. And remove the CI for the dev build. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13unix/variants: Remove freedos and fast variants.Jim Mussared
The freedos variant is untested by CI and is difficult to maintain. The fast variant is not a good name for what it does. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13py/mpconfig: Make feature levels available to mpconfigport.h.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13py/mpconfig: Add LFS1/LFS2 options to match FAT/posix.Jim Mussared
Also fixes the #ifndef for FAT & posix. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13tools/pyboard.py: Support Windows pathname separators.Wind-stormger
Addresses issue #9132.
2022-09-13samd/mpconfigport: Enable MICROPY_ENABLE_FINALISER when VFS is used.Andrew Leech
2022-09-13zephyr/mpconfigport: Enable MICROPY_ENABLE_FINALISER when VFS is used.Andrew Leech
2022-09-13unix/mpconfigport: Enable MICROPY_ENABLE_FINALISER when VFS is used.Andrew Leech
2022-09-13extmod/vfs: Add finaliser to ilistdir to close directory handle.Andrew Leech
When iterating over filesystem/folders with os.iterdir(), an open file (directory) handle is used internally. Currently this file handle is only closed once the iterator is completely drained, eg. once all entries have been looped over / converted into list etc. If a program opens an iterdir but does not loop over it, or starts to loop over the iterator but breaks out of the loop, then the handle never gets closed. In this state, when the iter object is cleaned up by the garbage collector this open handle can cause corruption of the filesystem. Fixes issues #6568 and #8506.
2022-09-13py/objpolyiter: Add a new polyiter type with finaliser support.Andrew Leech
2022-09-09tools/makemanifest.py: Force the repo version of the mpy_cross package.Jim Mussared
In case the version from pypi is installed or some other version is available in sys.path, prepend `$(TOP)/mpy-cross` to sys.path instead. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-09zephyr/boards: Add config for bbc_microbit_v2.Damien George
This enables the bluetooth module. GAP scanning and advertising works. Signed-off-by: Damien George <damien@micropython.org>
2022-09-09extmod/modbluetooth: Replace def_handle with end_handle in char IRQ.Jim Mussared
This is technically a breaking change, but: a) We need the end handle to do descriptor discovery properly. b) We have no possible use for the existing definition handle in the characteristic result IRQ. None of the methods can use it, and therefore no existing code should be using it in a way that changing it to a different integer value should break. Unfortunately NimBLE doesn't make it easy to get the end handle, so also implement a mechanism to use the following characteristic to calculate the previous characteristic's end handle. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-09extmod/modbluetooth: Fix descriptor registration with empty tuple.Jim Mussared
Incorrect use of "continue" when the tuple was length zero meant it broke the rest of the argument handling. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-08stm32/boards/PYB: Fix handling of BOARD_VARIANT selection.Jim Mussared
The matches should not have been quoted. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-08tools/autobuild: Use distinct directory for building stm32 variants.Jim Mussared
Previous the build directory just used the board name, now make it use the variant name too. This shouldn't have any change because the existing directory should not exist (all builds run by these scripts remove their build directory after completion), but it makes debugging easier. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-08rp2/boards: Remove all I2C,SPI pin defs that already match pico-sdk.Jim Mussared
I.e. for whichever SPI/I2C instance is PICO_DEFAULT_I2C, there's no need to set MICROPY_HW_SPIn_SCK. The only ones remaining are for the non-default instance. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-08rp2/machine_i2c: Use pico-sdk's default pins for I2C.Jim Mussared
Inherits the default values for whichever instance is PICO_DEFAULT_I2C. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-08rp2/machine_spi: Use pico-sdk's default pins for SPI.Jim Mussared
Rather than hardcoding the defaults, use pico-sdk's board definition. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-08rp2/boards: Set PICO_BOARD correctly for each board.Jim Mussared
In most cases, it's calculated automatically from the board name, and so doesn't need to be set at all. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-08rp2/rp2_flash: Add start/len support to rp2.Flash() constructor.Phil Howard
This allows support for partitioned flash on rp2 boards. See issue #9208. Signed-off-by: Phil Howard <phil@gadgetoid.com>
2022-09-08drivers: Remove drivers that are now in micropython-lib.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-08ports: Use micropython-lib version of drivers in manifests.Jim Mussared
2022-09-08lib/micropython-lib: Update submodule to latest.Jim Mussared
This brings in the drivers and libraries that were previously in this repo. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-06extmod/modure: Convert byte offsets to unicode indices when necessary.Jeff Epler
And add a test. Fixes issue #9202. Signed-off-by: Jeff Epler <jepler@gmail.com>
2022-09-06stm32/boards: Add alternate function list for STM32F446RE.yn386
Signed-off-by: Damien George <damien@micropython.org>
2022-09-06stm32/timer: Fix use of timer channel callback() method on L4 MCUs.yn386
Since L4 HAL version 1.17.0, HAL_TIM_IC_Start_IT() checks whether specified channel of timer is busy or not, which is the case if this function is called more than once without first calling HAL_TIM_IC_Stop_IT(). The fix in this commit is to call the stop function before calling start. The PWM and OC modes have the same issue with the same fix. Fixes issue #8732.
2022-09-06stm32/pyb_i2c: Fix pyb.I2C to work with dma=True on F4 MCUs.yn386
Prior to this commit, excuting this code: i2c = I2C(1, I2C.CONTROLLER, dma=True) i2c.send(data, addr=i2c_addr) the call to i2c.send() does not return and the board needs a reset. This code works when dma=False. According to the specification, I2Cx_EV_IRQHandler should: - Write DR to address when Start condition generated. - Clear ADDR by reading SR2 after reading SR2 when address sent. These processes are included in HAL_I2C_EV_IRQHandler(), however the firmware size increses about 2KB if HAL_I2C_EV_IRQHandler is called. This commit adds above processes to i2c_ev_irq_handler, and increases firmware by less than 100 bytes. Fixes issue #2643.
2022-09-06stm32/adc: Make ADCAll.read_channel reject invalid channels.yn386
pyb.ADC(channel) checks whether specified channel is valid or have ADC capability but pyb.ADCAll().read_channel() does not. This change adds checking whether specified channel is valid and throw ValueError if channel is invalid. This is same as pyb.ADC().
2022-09-06stm32/boards: Only freeze LCD160CR driver in PYB board firmware.Damien George
Although this driver and associated hardware can be used on any board, it makes to only freeze it for PYB and PYBD boards. It can be easily copied to any board if needed. Fixes issue #8056. Signed-off-by: Damien George <damien@micropython.org>
2022-09-06drivers/display: Don't include tests by default.Damien George
The tests can be copied to the board if needed. Also update the docs to reflect this change. Signed-off-by: Damien George <damien@micropython.org>
2022-09-06stm32/boards/LEGO_HUB_NO6: Update manifest to new format.Jim Mussared
This was added after 203dae41f and missed in the rebase. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-05all: Update all manifest.py files to use new features.Jim Mussared
Changes in this commit: - Manifest include's now use the directory path where possible (no longer necessary to include the manifest.py file explicitly). - Add manifest.py for all drivers and components that are referenced by port/board manifests. - Replace all uses of freeze() with package()/module(), except for port and board modules. - Use opt=3 everywhere, for consistency and to reduce code size. - Use require() instead of include() for all micropython-lib references. - Remove support for optional board-level manifest.py in mimxrt port, to make it behave the same as other ports (the board must set FROZEN_MANIFEST to a custom manifest.py, which can optionally include the default, port-level manifest). - Also reinstates modules that were accidentally removed from the esp8266 512k build in fbe9417b90474dd1a08749b3a79311a8007a98fb. Signed-off-by: Jim Mussared <jim.mussared@gmail.com> Signed-off-by: Damien George <damien@micropython.org>