summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-25mimxrt/dma_channel: Fix the DMA channel management.robert-hh
The MIMXRT1011 has only 16 channels, so size the channel list accordingly.
2021-10-25mimxrt/hal: Remove duplicate definitions from flexspi_hyper_flash.h.robert-hh
2021-10-25mimxrt/boards: Fix the D14/D15 pin assignment of MIMXRT1050/60/64_EVK.robert-hh
There are several PCB layouts in the market under the same name.
2021-10-25mimxrt/modmachine: Implement machine.WDT() and machine.reset_cause().robert-hh
The API follows that of rp2, stm32, esp32, and the docs. wdt=machine.WDT(0, timeout) Timeout is given in ms. The valid range is 500 to 128000 (128 seconds) with 500 ms granularity. Values outside of that range will be silently aligned. wdt.feed() Resets the watchdog timer (feeding). wdt.timeout_ms(value) Sets a new timeout and feeds the watchdog. This is a new, preliminary method which is not yet documented. reset_cause = machine.reset_cause() Values returned: 1 Power On reset 3 Watchdog reset 5 Software reset: state after calling machine.reset() More elaborate API functions are supported by the MCU, like an interrupt called a certain time after feeding. But for port cosistency that is not implemented.
2021-10-25mimxrt/eth: Add LAN support and integrate the network module.robert-hh
This commit implements 10/100 Mbit Ethernet support in the mimxrt port. The following boards are configured without ETH network: - MIMXRT1010_EVK - Teensy 4.0 The following boards are configured with ETH network: - MIMXRT1020_EVK - MIMXRT1050_EVK - MIMXRT1060_EVK - MIMXRT1064_EVK - Teensy 4.1 Ethernet support tested with TEENSY 4.1, MIMRTX1020_EVK and MIMXRT1050_EVK. Build tested with Teensy 4.0 and MIMXRT1010_EVK to be still working. Compiles and builds properly for MIMXRT1060_EVK and MIMXRT1064_EVK, but not tested lacking suitable boards. Tested functions are: - ping works bothway - simple UDP transfer works bothway - ntptime works - the ftp server works - secure socker works - telnet and webrepl works The MAC address is 0x02 plus 5 bytes from the manifacturing info field, which can be considered as unique per device. Some boards do not wire the RESET and INT pin of the PHY transceiver. For operation, these are not required. If they are defined, they will be used.
2021-10-22mimxrt/sdram: Add SDRAM support.Philipp Ebensberger
Adds support for SDRAM via `SEMC` peripheral. SDRAM support can be enabled in the mpconfigboard.mk file by setting `MICROPY_HW_SDRAM_AVAIL` to `1` and poviding the size of the RAM via `MICROPY_HW_FLASH_SIZE`. When SDRAM support is enabled the whole SDRAM is currently used used for MicroPython heap. Signed-off-by: Philipp Ebensberger
2021-10-21github/workflows: Use Python 3.8 for macos workflow.Damien George
Otherwise it gets a more recent version which fails some of the test suite. Signed-off-by: Damien George <damien@micropython.org>
2021-10-21tests/basics: Add tests for type-checking subclassed exc instances.Mike Wadsten
2021-10-21py/runtime: Fix crash when exc __new__ doesn't return an exc instance.Mike Wadsten
See CPython bug https://bugs.python.org/issue39091 for more details.
2021-10-20stm32/pendsv: Allow a board to add entries for pendsv_schedule_dispatch.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-10-20stm32/mpbthciport: Allow a board to hook BT HCI poll functions.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-10-20stm32/usbd_cdc_interface: Allow a board to hook into USBD CDC RX events.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-10-19unix/modusocket: Support MP_STREAM_POLL in unix socket_ioctl.Andrew Leech
Allows asyncio reading of network sockets when MICROPY_PY_USELECT is used in the build configuration.
2021-10-19extmod/vfs_posix_file: Support MP_STREAM_POLL in vfs_posix_file_ioctl.Andrew Leech
Allows asyncio reading of sys.stdin when MICROPY_PY_USELECT is used in the build configuration.
2021-10-16esp32/usb: Improve speed of USB CDC output.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-10-16esp32: Enable optimisations and move code to iRAM to boost performance.Damien George
This commit enables some significant optimisations for esp32: - move the VM to iRAM - move hot parts of the runtime to iRAM (map lookup, load global/name, mp_obj_get_type) - enable MICROPY_OPT_LOAD_ATTR_FAST_PATH - enable MICROPY_OPT_MAP_LOOKUP_CACHE - disable assertions - change from -Os to -O2 for compilation It's hard to measure performance on esp32 due to external flash and hardware caching. But this set of changes improves performance compared to master by (on a TinyPICO with the GENERIC build, using IDF 4.2.2, running at 160MHz): diff of scores (higher is better) N=100 M=100 esp32-master -> esp32-perf diff diff% (error%) bm_chaos.py 71.28 -> 268.08 : +196.80 = +276.094% (+/-0.04%) bm_fannkuch.py 44.10 -> 69.31 : +25.21 = +57.166% (+/-0.01%) bm_fft.py 1385.27 -> 2538.23 : +1152.96 = +83.230% (+/-0.01%) bm_float.py 1060.94 -> 3900.62 : +2839.68 = +267.657% (+/-0.03%) bm_hexiom.py 10.90 -> 32.79 : +21.89 = +200.826% (+/-0.02%) bm_nqueens.py 1000.83 -> 2372.87 : +1372.04 = +137.090% (+/-0.01%) bm_pidigits.py 288.13 -> 664.40 : +376.27 = +130.590% (+/-0.46%) misc_aes.py 102.45 -> 345.69 : +243.24 = +237.423% (+/-0.01%) misc_mandel.py 1016.58 -> 2121.92 : +1105.34 = +108.731% (+/-0.01%) misc_pystone.py 632.91 -> 1801.87 : +1168.96 = +184.696% (+/-0.08%) misc_raytrace.py 76.66 -> 281.78 : +205.12 = +267.571% (+/-0.05%) viper_call0.py 210.63 -> 273.17 : +62.54 = +29.692% (+/-0.01%) viper_call1a.py 208.45 -> 269.51 : +61.06 = +29.292% (+/-0.00%) viper_call1b.py 185.44 -> 228.25 : +42.81 = +23.086% (+/-0.01%) viper_call1c.py 185.86 -> 228.90 : +43.04 = +23.157% (+/-0.01%) viper_call2a.py 207.10 -> 267.25 : +60.15 = +29.044% (+/-0.00%) viper_call2b.py 173.76 -> 209.42 : +35.66 = +20.523% (+/-0.00%) Five tests have more than 3x speed up (200%+). The performance of the tests bm_fft, bm_pidigits and misc_aes now scale with CPU frequency (eg changing frequency to 240MHz boosts the performance of these by 50%), which means they are no longer influenced by timing of external flash access. (The viper_call* tests did previously scale with CPU frequency, and they still do.) Turning off assertions reduces code size by about 80k, and going from -Os to -O2 costs about 100k, so the net change in code size (for the GENERIC board) is about +20k. If a board wants to enable assertions, or use -Os instead of -O2, that's still possible by overriding the sdkconfig parameters. Signed-off-by: Damien George <damien@micropython.org>
2021-10-15py: Add wrapper macros so hot VM functions can go in fast code location.Damien George
For example, on esp32 they can go in iRAM to improve performance. Signed-off-by: Damien George <damien@micropython.org>
2021-10-15stm32/sdram: Enforce gcc opt, and use volatile and DSB in sdram_test.iabdalkader
Ensures consistent behaviour and resolves the D-Cache bug (the "exhaustive" argument being lost due to cache being turned off) when O0 is used. The changes in this commit are: - Change -O0 to -Os because "gcc is considered broken at -O0" according to https://github.com/ARM-software/CMSIS_5/issues/620#issuecomment-550235656 - Use volatile for mem_base so the compiler doesn't optimise away reads or writes to the SDRAM, which is being tested. - Use DSB to prevent any other compiler optimisations that would change the testing logic. - Use alternating pattern/antipattern in exhaustive test to catch more hardware/configuration errors. Implementation adapted by @andrewleech, taken directly from investigation by @iabdalkader and @dpgeorge. See #7841 and #7869 for further discussion.
2021-10-14docs/esp32/tutorial: Add an example of peripheral control via regs.NitiKaur
2021-10-14docs/library/stm.rst: Document the stm module.NitiKaur
2021-10-14docs/reference/manifest.rst: Add docs for manifest.py files.NitiKaur
2021-10-14docs/reference/mpremote.rst: Add docs for mpremote.NitiKaur
2021-10-13docs/library/random.rst: Document the random module.NitiKaur
2021-10-13docs/rp2: Add reference for PIO assembly instructions, and PIO tutorial.NitiKaur
2021-09-24extmod/moduplatform: Improve implementation for PC ports.stijn
Fix identification of 32/64 bit and of the Windows platform and add a platform string mimicking CPython for the latter.
2021-09-24py/builtinimport: Forward all debug printing to MICROPY_DEBUG_PRINTER.stijn
2021-09-24esp32: Split out WLAN code from modnetwork.c to network_wlan.c.Damien George
To match network_lan.c and network_ppp.c, and make it clear what code is specifically for WLAN support. Also provide a configuration option MICROPY_PY_NETWORK_WLAN which can be used to fully disable network.WLAN (it's enabled by default). Signed-off-by: Damien George <damien@micropython.org>
2021-09-24esp32/main: Add option for a board to hook code into startup sequence.Damien George
To do this the board must define MICROPY_BOARD_STARTUP, set MICROPY_SOURCE_BOARD then define the new start-up code. For example, in mpconfigboard.h: #define MICROPY_BOARD_STARTUP board_startup void board_startup(void); in mpconfigboard.cmake: set(MICROPY_SOURCE_BOARD ${MICROPY_BOARD_DIR}/board.c ) and in a new board.c file in the board directory: #include "py/mpconfig.h" void board_startup(void) { boardctrl_startup(); // extra custom startup } This follows stm32's boardctrl facilities. Signed-off-by: Damien George <damien@micropython.org>
2021-09-24esp32/mpthreadport: Fix TCB cleanup function so thread_mutex is ready.leo chung
Because vPortCleanUpTCB is called by the FreeRTOS idle task, and it checks thread, but didn't check the thread_mutex. And if thread is not NULL, but thread_mutex not ready then it will crash with an error when calling mp_thread_mutex_lock(&thread_mutex, 1). As suggested by @dpgeorge, move the thread = &thread_entry0 line to the end of mp_thread_init(). Signed-off-by: leo chung <gewalalb@gmail.com>
2021-09-24esp32/machine_pin: Block out IO16 and IO17 when using SPIRAM on ESP32.Seon Rozenblum
Fixes issue #7819.
2021-09-22esp32/usb: Add USB host connection detection for CDC serial output.Seon Rozenblum
This callback allows detecting if there is a USB host connected to the CDC or not, in which case the stdout_tx should skip CDC TX writing and flushing or the system will block. Fixes issue #7820.
2021-09-22esp32/README: Updated readme with req IDF vers for ESP32-S2, C3 and S3.Seon Rozenblum
2021-09-21docs/esp32: Explain ESP32 PWM modes, timers, and channels.IhorNehrutsa
2021-09-21esp32/machine_pwm: Add support for all PWM timers and channels.IhorNehrutsa
This commit allows using all the available PWM timers (up to 8) and channels (up to 16), without affecting the PWM API. If a new frequency is set, first it checks if another timer is using the same frequency. If yes, then it uses this timer, otherwise, it creates a new one. If all timers are used, the user should set an already used frequency, or de-init a channel. This work is based on #6276 and #3608.
2021-09-21esp32/boards: Add LOLIN_S2_MINI ESP32-S2 board.Stewart Bonnick
To support Lolin S2 Mini ESP32-S2 Variant board. More information about this board can be found at https://www.wemos.cc/en/latest/s2/s2_mini.html
2021-09-21stm32/machine_i2c: Use hardware I2C for STM32H7.iabdalkader
2021-09-21stm32/boards: Add PF11-BOOT0 to stm32f091_af.csv.roland van straten
PF11 is added so it can be used as GPIO.
2021-09-21stm32/boards/NUCLEO_H743ZI: Enable VfsLfs2 on NUCLEO_H743ZI(2) boards.Ned Konz
2021-09-21stm32: Extended flash filesystem space to 512K on H743 boards.Ned Konz
The H743 has equal sized pages of 128k, which means the filesystem doesn't need to be near the beginning. This commit moves the filesystem to the very end of flash, and extends it to 512k (4 pages). Signed-off-by: Damien George <damien@micropython.org>
2021-09-19stm32: Enable platform module.iabdalkader
The HAL version is based on the stm32lib version.
2021-09-19extmod: Add platform module.iabdalkader
It contains the compiler version, and underlying system HAL/SDK version.
2021-09-19rp2: Add framework for networking.iabdalkader
MICROPY_PY_NETWORK and MICROPY_PY_USOCKET need to be enabled by a board to get networking. No NICs have yet been defined.
2021-09-19rp2: Add support for bluetooth module using NimBLE.iabdalkader
2021-09-19extmod/nimble: Add nimble CMake fragment file.iabdalkader
2021-09-19extmod/mpbthci.h: Add mp_bluetooth_hci_uart_any prototype.iabdalkader
This allows drivers to use mpbthciport functions to read/write/poll UART.
2021-09-19stm32/boards: Add OLIMEX H407 board definition.Chris Fiege
This change adds the OLIMEX H407 support to the STM32 port. The H407 (https://www.olimex.com/Products/ARM/ST/STM32-H407/) is simliar to the already existing E407 (https://www.olimex.com/Products/ARM/ST/STM32-E407) but does not support Ethernet and has a full-size USB-A port instead of a Mini-USB socket. Both boards use the STM32F407ZGT6 CPU. This port is basically a copy of the E407 but with changed pinmux: * Removed Ethernet pin definition * Removed UART1 (pins are used for other functions) * Removed UART3 flow control pins (pins are used for other functions) * Removed SD-Card detect pin (since it is not connected on the H407) A REPL on UART3 is connected to the U3BOOT-header, a 3-pin header with RX, TX and GND that is intended for the serial terminal. Tested: * Micro-SD Card is detected when inserted on RESET * REPL on UART3 works * Serial port on the mini USB socket Signed-off-by: Chris Fiege <cfi@pengutronix.de>
2021-09-19esp32/boards: Add board definition for ESP32-S2-WROVER module.patrick
2021-09-19esp32/machine_hw_spi: Fix hardware SPI DMA channels for S2/S3.Seon Rozenblum
2021-09-16tools/ci.sh: Use IDF v4.4 as part of esp32 CI and build GENERIC_S3.Damien George
IDF v4.4 does not have an official release so for now use the latest master. Also remove building GENERIC with no options (all the other boards are no-option builds), to keep CI time reasonable. Signed-off-by: Damien George <damien@micropython.org>
2021-09-16esp32/boards: Add new GENERIC_S3 board definition.Damien George
Thanks to Seon Rozenblum aka @UnexpectedMaker for the work. Signed-off-by: Damien George <damien@micropython.org>