summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-30stm32/network_wiznet5k: Fix build error with wiznet5k and lwip enabled.iabdalkader
Commit 4dba04a50fea01f6f8fec83d64f958f8d14e285a refactored the network code but the combination of MICROPY_PY_WIZNET5K=5500 and MICROPY_PY_LWIP=1 broke.
2021-12-29tools/upip.py: Skip '.frozen' entry in sys.path for install path.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-29ports: Move '.frozen' to second entry in sys.path.Damien George
In commit 86ce4426079b1b368881c22f46d80045e2f720b0 the '.frozen' entry was added at the start of sys.path, to allow control over when frozen modules are searched during import, and retain existing behaviour whereby frozen was searched before the filesystem. But Python semantics of sys.path require sys.path[0] to be the directory of the currently executing script, or ''. This commit moves the '.frozen' entry to second place in sys.path, so sys.path[0] retains its correct value (described above). Signed-off-by: Damien George <damien@micropython.org>
2021-12-29tools/mpremote: Add link to mpremote docs URL in help message.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-29tools/mpremote: Add help command.Sergei Silnov
Fixes issue #7480
2021-12-22tools/mpremote: Add mkdir and rmdir to RemoteFS.Michael Bentley
This allows the remote MicroPython instance to create and delete directories from the mounted host filesystem in addition to the already existing functionality of reading, creating, and modifying files. Signed-off-by: Michael Bentley <mikebentley15@gmail.com>
2021-12-22esp32/machine_bitstream: Replace bit-bang code with RMT-based driver.Jim Mussared
This aims to solve glitching issues on long neopixel strips. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-22esp32/machine_pwm: Keep duty constant when changing frequency.IhorNehrutsa
Save and restore the same duty cycle when the frequency (or frequency resolution) is changed. This allows a smooth frequency change. Also update the esp32 PWM quickref to be clearer.
2021-12-21esp32/modnetwork: Synchronize WiFi AUTH_xxx constants with IDF values.IhorNehrutsa
2021-12-21tests/basics/int_big_cmp.py: Add more tests for big-int comparison.Damien George
To improve coverage of mpz_cmp and mpn_cmp. Signed-off-by: Damien George <damien@micropython.org>
2021-12-21py/mpz: Fix bugs with bitwise of -0 by ensuring all 0's are positive.Damien George
This commit makes sure that the value zero is always encoded in an mpz_t as neg=0 and len=0 (previously it was just len=0). This invariant is needed for some of the bitwise operations that operate on negative numbers, because they cannot handle -0. For example (-((1<<100)-(1<<100)))|1 was being computed as -65535, instead of 1. Fixes issue #8042. Signed-off-by: Damien George <damien@micropython.org>
2021-12-21esp8266/etshal.h: Remove unneeded function declarations.Damien George
These removed ones are either unused by MicroPython or provided by osapi.h in the SDK. In particular ets_delay_us() has different signatures for different versions of the SDK, so best to let it provide the declaration. Fixes issue #8095. Signed-off-by: Damien George <damien@micropython.org>
2021-12-20stm32/boards/OLIMEX_H407: Fix typo in OLIMEX H407 board.json.Matt Trentini
Appears incorrectly as E407 in the download manager.
2021-12-20stm32/boards/make-pins.py: Generate empty ADC table if needed.iabdalkader
If ADCx pins are hidden, print an empty table to prevent linker errors.
2021-12-19stm32/qspi: Fix typo in address comment.iabdalkader
2021-12-19stm32/factoryreset: Init vfs flags before calling pyb_flash_init_vfs.iabdalkader
The vfs flags could have any random value from stack. This bug was introduced back in 7723dac3371ccf081c2490b33b69492dc42818bd
2021-12-19py/mpstate.h: Only include sys.path/argv objects in state when enabled.Damien George
The mp_sys_path_obj and mp_sys_argv_obj objects are only used by the runtime and accessible from Python if MICROPY_PY_SYS is enabled. So exclude them from the runtime state if this option is disabled. Signed-off-by: Damien George <damien@micropython.org>
2021-12-18py/runtime: Allow initialising sys.path/argv with defaults.Damien George
If MICROPY_PY_SYS_PATH_ARGV_DEFAULTS is enabled (which it is by default) then sys.path and sys.argv will be initialised and populated with default values. This keeps all bare-metal ports aligned. Signed-off-by: Damien George <damien@micropython.org>
2021-12-18docs/library/sys.rst: Add note about '.frozen' as an entry in sys.path.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-18ports: Add '.frozen' as the first entry in sys.path.Jim Mussared
Frozen modules will be searched preferentially, but gives the user the ability to override this behavior. This matches the previous behavior where "" was implicitly the frozen search path, but the frozen list was checked before the filesystem. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-18py/mkrules.cmake: Set frozen preprocessor defs early.Jim Mussared
This ensures MICROPY_QSTR_EXTRA_POOL and MICROPY_MODULE_FROZEN_MPY are set if necessary before the CFLAGS are extracted for QSTR generation. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-18py: Only search frozen modules when '.frozen' is found in sys.path.Jim Mussared
This changes makemanifest.py & mpy-tool.py to merge string and mpy names into the same list (now mp_frozen_names). The various paths for loading a frozen module (mp_find_frozen_module) and checking existence of a frozen module (mp_frozen_stat) use a common function that searches this list. In addition, the frozen lookup will now only take place if the path starts with ".frozen", which needs to be added to sys.path. This fixes issues #1804, #2322, #3509, #6419. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-17tools/makemanifest.py: Merge make-frozen.py.Jim Mussared
Takes the functionality from tools/make-frozen.py, adds support for multiple frozen directories, and moves it to tools/makemanifest.py. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-17all: Remove support for FROZEN_DIR and FROZEN_MPY_DIR.Jim Mussared
These have been deprecated for over two years in favour of FROZEN_MANIFEST and manifest.py. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-17teensy: Switch to use manifest.py instead of FROZEN_DIR.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-17py/modio: Remove io.resource_stream function.Jim Mussared
This feature is not enabled on any port, it's not in CPython's io module, and functionality is better suited to the micropython-lib implementation of pkg_resources.
2021-12-15py/showbc: Fix printing of raw bytecode header on nanbox builds.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-15tools/makemanifest.py: Make str conversion compatible with Python 2.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-15esp32/boards: Remove SPI pin defaults from GENERIC S2/S3 boards.Tomas Vanek
Default SPI pins are now correctly assigned by machine_hw_spi.c even for S2 and S3. mpconfigboard.h files define defaults with flipped SPI(1) and SPI(2) to workaround a bug in machine_hw_spi.c - the bug is fixed. Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
2021-12-15esp32/machine_hw_spi: Set proper default SPI(id=2) pins on S2 and S3.Tomas Vanek
Use IO_MUX pins as defined by ESP IDF in soc/esp32/include/soc/spi_pins.h ESP32S2 and S3 don't have IO_MUX pins for SPI3, GPIO matrix is always used. Choose suitable defaults for S2 and S3. ESP32C3 does not have SPI3 at all. Don't define pin mappings for it. Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
2021-12-15esp32/machine_hw_spi: Set proper default SPI(id=1) pins on S2,S3 and C3.Tomas Vanek
Use IO_MUX pins as defined by ESP IDF in soc/esp32*/include/soc/spi_pins.h Alternatively use now deprecated HSPI_IOMUX_PIN_NUM_xxx (or FSPI_IOMUX_PIN_NUM_xxx for ESP32S2) for compatibility with IDF 4.2 and older. Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
2021-12-15esp32/machine_hw_spi: Fix SPI default pins reordering on ESP32-S2/S3.Tomas Vanek
The index of machine_hw_spi_obj and machine_hw_spi_default_pins arrays is assigned to 0 for ARG_id==HSPI_HOST and 1 for another SPI. On ESP32S2 and S3 HSPI_HOST=2 so the first set (idx=0) of default pins is used for SPI(id=2) aka HSPI/SPI3 and the second set (idx=1) for SPI(id=1) aka FSPI/SPI2. This makes a misleading mess in MICROPY_HW_SPIxxxx definitions and it is also in contradiction to the comments around the definitions. Change the test of ARG_id to fix the order of machine_hw_spi_default_pins. This change might require adjusting MICROPY_HW_SPIxxxx definitions in mpconfigboard.h of S2/S3 based boards. Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
2021-12-15esp32/machine_pin: Make GPIO 26 usable for S2,S3 if SPIRAM not config'd.Tomas Vanek
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
2021-12-15tools/upip.py: Support == to specify exact package version.Christian Decker
2021-12-15docs: Remove trailing spaces and convert tabs to spaces.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-14mimxrt: Tidy up the board flash related files.robert-hh
- Move the qspi_xxxx_flash_config.c files to hal. It turned out that they are less board than flash type specific. - Change to a common flexspi_flash_config.h header file.
2021-12-14mimxrt: Use -Og instead of -O0 for DEBUG builds.robert-hh
Thanks for the hint, Damien. The DEBUG build got very large recently. The major difference is, that inline function are now inlined and not included as a function. That's good and maybe bad. The good thing is, that the code speed si now close to the final code. It could be worse in single step debugging. I'll see. Setting this option caused a new warning and a formatting error to pop up at different places. Fixed as well.
2021-12-14mimxrt: Enable ticks_cpu at boot time for NDEBUG builds only.robert-hh
Otherwise, it get's in trouble with a Debugger. Reason to be found. Also: Increase code segment to 2 MB for the MIMXRT1050_EVK build.
2021-12-14mimxrt: Refactor the reading of the machine id.robert-hh
The ID is read in a single function and used for: - machine.unique_id() - Ethernet MAC addresses. - ... That facilitates use of other MCU using a different access method for the ID (e.g. i.MX RT1176).
2021-12-14mimxrt: Add a driver for the DP83848 PHY device.robert-hh
Just another choice for the PHY interface. Added: Keyword option phy_clock=LAN.IN or LAN.OUT to define the source of the 50MHZ clock for the PHY interface. The RMII clock is not enabled if it is generated by a PYH board. Constants: LAN.IN The clock is provided by the PHY board. LAN.OUT The clock is provided by the MCU board. The default is LAN.OUT or the value set in mpconfigboard.h, which is currently set to IN only for the SEEED ARCH MIX board. Usage etc: lan = LAN(phy_type=LAN.PHY_DP83848, phy_clock=LAN.IN)
2021-12-14mimxrt: Fix a tiny unnoticed bug in sdcard.c.robert-hh
This code line will hardly ever be compiled and executed, but since it is there, it must be correct.
2021-12-14mimxrt: Re-Enable eth checksum creation by HW.robert-hh
The initial problem with a wrong ICMP checksum was caused by the test code setting a checksum and the HW taking that probably as the start value and ending up with 0xffff. With a checksum field of 0 set by the test code the HW creates the proper checksum.
2021-12-14mimxrt: Support selection of PHY type and address.robert-hh
Useful for boards without a PHY interface, where that has to be attached. Like the Seed ARCH MIX board or Vision SOM. Phy drivers supported so far are: - KSZ8081 - DP83825 - LAN8720 More to come. Usage e.g.: lan = LAN(phy_type=LAN.PHY_LAN8720, phy_addr=1) The default values are those set in mpconfigboard.h.
2021-12-14mimxrt: Define UART 0 on MIMXRT boards.robert-hh
UART 0 is attached to the Debug USB port. The settings are 115200 Baud, 8N1. For MIMXRT1010_EVK this is identical to UART1. For the other boards, this is an additional UART.
2021-12-14extmod/network_ninaw10: Fix config of AP mode.iabdalkader
* Fix missing call to connect to configure module in AP mode. * Use enum for config/connect args indices.
2021-12-14rp2/machine_uart: Handle and clear UART RX timeout IRQ.iabdalkader
The pico-sdk 1.3.0 update in 97a7cc243b028833bdcb8ce0bc19b2bce7545851 introduced a change that broke RP2 Bluetooth UART, and possibly UART in general, which stops working right after UART is initialized. The commit raspberrypi/pico-sdk@2622e9b enables the UART receive timeout (RTIM) IRQ, which is asserted when the receive FIFO is not empty, and no more characters are received for a period of time. This commit makes sure the RTIM IRQ is handled and cleared in uart_service_interrupt.
2021-12-14esp32,esp8266: Extract qstr from object when comparing keys in config().Damien George
Following on from a previous fix for the same problem made in 3a431fba50c96cc47d8273a6934e200993197b14. Fixes issue #8052. Signed-off-by: Damien George <damien@micropython.org>
2021-12-14stm32/sdcard: Add config option to force MM card capacity.Damien George
The current ST HAL does not support reading the extended CSD so cannot correctly detect the capacity of high-capacity cards. As a workaround, the capacity can be forced via the MICROPY_HW_MMCARD_LOG_BLOCK_NBR config option. Signed-off-by: Damien George <damien@micropython.org>
2021-12-14stm32/sdcard: Support 8-bit wide SDIO bus.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-14stm32/main: Call sdcard_init when only MICROPY_HW_ENABLE_MMCARD enabled.Damien George
Otherwise, if MMCARD is enabled and not SDCARD, then the GPIO will not be configured for SDIO. Signed-off-by: Damien George <damien@micropython.org>