summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-02-04tools/mpremote: Accept both --help and help to show usage.Andrew Leech
2022-02-04tools/mpremote: During soft reboot wait long enough for 115200 data.Andrew Leech
2022-02-04tools/mpremote: Make ConsolePosix work without .raw attribute.Andrew Leech
When running mpremote in the vscode terminal on OSX the sys.stdout.buffer does not have the raw attribute. It works fine without it.
2022-02-04tools/mpremote: Fix "fs cp -r" on Windows.Andrew Leech
A backslash in the directory name will end up being passed through to the device and becoming a backslash in a filename, rather than being interpreted as directories. This makes "cp -r" problematic on Windows. Changing to simply "/",join() fixes this.
2022-02-04stm32/boards/NUCLEO_L432KC: Disable MICROPY_OPT_COMPUTED_GOTO.Damien George
To save space, after recent fixes to L4 ADC made it overflow flash. Signed-off-by: Damien George <damien@micropython.org>
2022-02-04docs/reference/isr_rules.rst: Describe uasyncio-IRQ interface.Peter Hinch
2022-02-04docs/esp32/quickref: Update ADC documentation.Jonathan Hogg
Update ADC documentation now that the new API is described in the main docs.
2022-02-04docs/reference/isr_rules.rst: Fix inconsistent variable name in example.Luiz Brandao
Fixed to be conistent with the code example above it.
2022-02-04docs/develop/porting.rst: Fix build and import problems in the example.Cem Eliguzel
2022-02-04rp2/modutime: Fix time.localtime day-of-week value.Damien George
The correct day-of-week is stored in the RTC (0=Monday, 6=Sunday) so there is no need to adjust it for the return value of time.localtime(). Fixes issue #7889. Signed-off-by: Damien George <damien@micropython.org>
2022-02-04stm32/adc: Remove obsolete FIRST/LAST GPIO channel macros.iabdalkader
2022-02-04stm32/adc: Fix L4 ADC channel numbers.iabdalkader
Use HAL macro to map decimal numbers to channel numbers. This is needed since updating L4 HAL v1.17.0 in a0f5b3148a5c276aa1abf7b77b0964eec80cda16. Fixes issue #8233.
2022-02-04stm32/system_stm32: Make SystemClock_Config() a weak symbol.Peter D. Gray
This allows boards to override as needed.
2022-02-04stm32/boards/NUCLEO_WL55: Add new board definition.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-02-04stm32: Add initial support for STM32WL MCUs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-02-04stm32/Makefile: Make stm32lib configurable.Damien George
The default stm32lib remains lib/stm32lib, but it can now be easily overriden at build time by specifying STM32LIB_DIR, or STM32LIB_CMSIS_DIR and STM32LIB_HAL_DIR. Signed-off-by: Damien George <damien@micropython.org>
2022-02-04stm32/rtc: Use LL_RTC functions to simplify some MCU-specific code.Damien George
This also fixes a possible race condition when exiting initialisation mode: reading then writing to ISR (via ISR &= ~RTC_ISR_INIT) will clear any flags that were set by the hardware between the read and the write. The correct way to clear just the INIT bit is to just do a single write via ISR = ~RTC_ISR_INIT, which will not clear any other flags (they must be written to 0 to clear), and that is exactly what LL_RTC_DisableInitMode does. Signed-off-by: Damien George <damien@micropython.org>
2022-02-03stm32/mboot: Add support for F469/479 MCUs in fwupdate.py.Damien George
And don't assert on the sector number in sector_erase, so it can support erasing arbitrary sectors. Signed-off-by: Damien George <damien@micropython.org>
2022-02-03stm32/mboot: Add MBOOT_BOARD_ENTRY_INIT for a board to add entry code.Damien George
Also change the signature of stm32_main to uint32_t, which is what it should be. Signed-off-by: Damien George <damien@micropython.org>
2022-02-03stm32/mboot: Allow HSI to be used as the main clock source.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-02-03ports: Consolidate inclusion of umachine module in built-ins.Damien George
The inclusion of `umachine` in the list of built-in modules is now done centrally in py/objmodule.c. Enabling MICROPY_PY_MACHINE will include this module. As part of this, all ports now have `umachine` as the core module name (previously some had only `machine` as the name). Signed-off-by: Damien George <damien@micropython.org>
2022-02-02tools/autobuild: Provide .uf2 images for esp32 builds when available.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-02-02esp32: Create .uf2 binaries for S2 and S3 chips.Damien George
The name of the filesystem partition is updated to support "ffat", as used by TinyUF2. Signed-off-by: Damien George <damien@micropython.org>
2022-02-02tools/uf2conv.py: Update to latest version.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-02-02top: Update .git-blame-ignore-revs for latest Black formatting commits.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-02-02all: Update Python formatting to latest Black version 22.1.0.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-02-02docs: Remove reference to obsolete neopixel_write function.Damien George
It has been replaced by machine.bitstream. Signed-off-by: Damien George <damien@micropython.org>
2022-02-02esp32: Remove unneeded modesp.h.Damien George
Made redundant by 71f4faac2732d932dcc03bdbc9f80434e5757edb Signed-off-by: Damien George <damien@micropython.org>
2022-02-02esp32/adc: Fix wrong mapping between ADC2 channel and GPIO number.Emil Kondayan
According to the IO_MUX table in the ESP32 datasheet, the ADC2 channels are mapped to different GPIO numbers.
2022-02-02esp32/main: Automatically size SPIRAM heap when allocated using malloc.Michael O'Cleirigh
This change allows the same heap allocation rules to be used when using malloc regardless if the board has SPRAM or normal RAM. Integrating with the esp32-camera for example requires that ESP32 SPRAM be allocatable using the esp-idf capabilities aware allocation functions. In the case of esp32-camera it's for the framebuffer. Detect when CONFIG_SPIRAM_USE_MALLOC is in use and use the standard automatic configuration of leaving 1/2 of the SPRAM available to other FreeRTOS tasks.
2022-02-01esp32/esp32_rmt: Select correct last RMT channel on S2, S3, C3 variants.Damien George
For example the ESP32-C3 has 2 TX channels and 2 RX channels in total, and in this case channel 1 must be the default for bitstream. Signed-off-by: Damien George <damien@micropython.org>
2022-02-01esp32/machine_pwm: Clean up macro names and their use.IhorNehrutsa
- Remove UI_RES_SHIFT macro. - Rename PWFREQ to PWM_FREQ. - Rename PWRES to PWM_RES_10_BIT. - Use UI_RES_16_BIT flag instead of HIGHEST_PWM_RES.
2022-02-01esp32/machine_pwm: Fix PWM not allowing frequencies < 611 Hz.IhorNehrutsa
Fixes issue #8189.
2022-02-01gitmodules: Update branch for stm32lib submodule.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-02-01stm32: Add support for G4 MCUs, and add NUCLEO_G474RE board defn.Herwin Grobben
This commit adds support for the STM32G4 series of MCUs, and a board definition for NUCLEO_G474RE. This board has the REPL on LPUART1 which is connected to the on-board ST-link USB-UART.
2022-01-31stm32/mboot: Compute and check CRC32 of dfu file in fwupdate.py.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-01-31stm32/mboot: Support H7 MCUs in fwupdate.py.Damien George
And optimise the speed of flash writing. Signed-off-by: Damien George <damien@micropython.org>
2022-01-31stm32/mboot: Include hal_rcc_ex.c in source file list.Damien George
It's needed at least on F4 because this file overrides the weak function HAL_RCC_DeInit() from hal_rcc.c. Signed-off-by: Damien George <damien@micropython.org>
2022-01-31stm32/mboot: Use PLL3 for USB clock source on H7 MCUs.Damien George
PLL3-Q is more reliable than PLL1-Q for the USB clock source when entering mboot from various reset states (eg power on vs MCU reset). (It was found that if the main application used PLL3-Q then sometimes the USB clock source would stay stuck on PLL3-Q and not switch to PLL1-Q after a reset.) Other related changes: - SystemCoreClockUpdate() should be called on H7 because the calculation can be involved in some cases. - __set_PRIMASK(0) should be called because on H7 the built-in ST DFU bootloader exits with IRQs disabled. Signed-off-by: Damien George <damien@micropython.org>
2022-01-31stm32/powerctrl: Write bootloader-state as 64-bit word to work on H7.Damien George
H7 MCUs have ECC and writes do not go through to SRAM until 64-bits have been written (on another location is written). So use 64-bit writes for the bootloader-state variable so it is committed before the system reset. As part of this change, the lower byte of the bootloader address in BL_STATE must now be the magic number 0x5a5 for the state to be valid (previously this was 0x000 which is not as robust). Signed-off-by: Damien George <damien@micropython.org>
2022-01-31stm32/powerctrlboot: Set HAL uwTickPrio variable when needed.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-01-31stm32/usbd_conf: Set lpm_enable and battery_charging_enable on all MCUs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-01-27stm32/fdcan: Fix naming with regards to G4 series.Herwin Grobben
2022-01-27stm32/fdcan: Fix FIFO1 usage and handling of error interrupts.Herwin Grobben
The original code used a independent state with regards to the interrupt. During heavy bus error conditions the internal state could become out-of-sync with the interrupts. Further explanation: during the development of an application using CAN communication, a interrupt-run-away was found in some situations. It was found that the error interrupt triggered (Warning, Passive or Bus-Off, all triggered it) the run-away. The only recovery was a reset. Two problems were found: - the error interrupt is enabled but not cleared in the interrupt routine; - an internal variable 'State' that was used to track the message received state (empty, new, full, overflow) that was not directly related to interrupt that indicated the state. In this commit these issues are fixed by adding more values for the interrupt reason (warning, passive, bus off) and clearing the error interrupts, and making the internal state directly dependent on the interrupt state for received messages. Furthermore, introducing the FIFO1 in the CAN receive stage, another issue existed. Even if the messages are received into the FIFO1 (by selecting message filtering for FIFO0 and FIFO1), the interrupt firing was indicating FIFO0 Rx. The configuration of the interrupts for this is now also fixed. The CAN peripheral has 2 interrupt lines going into the NVIC controller. The assignment of the interrupt reasons to these 2 interrupt lines was missing. Now the reception of FIFO1 messages triggers the second interrupt line. Other interrupts (Rx FIFO0 and bus error) are assigned to the first interrupt line. Tested on a Nucleo-G474, and also checked the HAL function to work with the H7 family.
2022-01-27stm32/dac: Deinit all DACs on soft reset.iabdalkader
DAC timed functions continue to run after a soft reset cycle, using collected memory in the case of write_timed.
2022-01-27mimxrt: Simplify Makefile in selection of flash type.robert-hh
Simplify it a little bit by combining two sections regarding the flash type. Thanks to @alphaFred for suggesting it.
2022-01-27mimxrt: Add support for the Olimex RT1010 board.robert-hh
The board.json file is intentionally excluded, until the board will be sold. But including it into the mimxrt series make it easier to keep the build up-to-date.
2022-01-27mimxrt: Add USB ID elements.robert-hh
- Manufacturer, set by MICROPY_HW_USB_STR_MANUF; default "MicroPython" - Board name, as set by MICROPY_HW_BOARD_NAME - Unique-ID, same as returned by machine.unique_id() - USB Vendor ID, as set by MICROPY_HW_USB_VID; default 0xf055 - USB Product ID, as set by MICROPY_HW_USB_PID; default 0x9802
2022-01-27mimxrt: Allow to select cs0 or cs1 for SPI.robert-hh
Using the keyword argument cs=nnn in the constructor. The cs1 pin has to be defined in mpconfigboard.h. Note: Only a few boards have the CS1 pin exposed to the connectors.
2022-01-27mimxrt: Replace Pin-config constants by a function call.robert-hh
The Pin config setting by IOMUXC_SetPinConfig() is supplied by a bit pattern. That pattern is specific for a MCU family. In preparation for supporting the MIMXRT117x family, the constant bit pattern is replaced by a function call, such that the bit pattern is created at a single place. The code for this functions was taken from machine_pin.c. Note: A working port for the MIMXRT1176 exists already.