Commit Graph

11705 Commits

Author SHA1 Message Date
Dan Halbert 7e0e6fcdca Metro M4 now compiles 2023-10-03 15:03:59 -04:00
Dan Halbert 0e96ece01a
Merge pull request #8458 from SiliconLabs/dev_8.2
Change system clock to 78Mhz
2023-10-03 11:21:00 -04:00
Damien George cf490a7091 all: Fix various spelling mistakes found by codespell 2.2.6.
Signed-off-by: Damien George <damien@micropython.org>
2023-10-03 11:24:50 +11:00
iabdalkader 9d5d2e8cf7 renesas-ra: Tune lwip buffers and timing to improve network performance.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-03 10:17:51 +11:00
iabdalkader 5c8099003c renesas-ra/boards/ARDUINO_PORTENTA_C33: Update WiFi config.
Changes are:
- Enable IRQ on WiFi data ready pin.
- Fix WiFi SPI clock (an exact 30MHz is not possible).
- Update WiFi pins.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-03 10:17:28 +11:00
Scott Shawcroft a15c111d5c
Merge pull request #7718 from microdev1/watchdog-rp
Update WatchDog implementation
2023-10-02 14:17:29 -07:00
Jeff Epler 542d1571bf
Fix getenv test 2023-10-02 08:56:27 -05:00
Jeff Epler 499ea3f0e8
Restore unix Makefile functionality 2023-10-02 07:28:20 -05:00
iabdalkader da193c42f6 ports: Rename Arduino board LED pins to be consistent.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-02 11:57:46 +11:00
Wanlin Wang 2772b88f6a rp2/README: Fix name of RPI_PICO_W board.
Signed-off-by: Wanlin Wang <dgideas@outlook.com>
2023-10-02 11:46:38 +11:00
vsfos 1660c78795 unix/main: Fix memory leakage if MICROPY_USE_READLINE is disabled. 2023-10-02 11:44:12 +11:00
robert-hh 4e5611c55a mimxrt/machine_rtc: Improve the RTC init at boot.
By clearing the tamper bits and enabling access to the registers for all
code, just in case that this was set.  It keeps the clock running on
battery and the calibration setting.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-10-02 11:35:00 +11:00
robert-hh 6482eb142c mimxrt/mpbthciport: Allow disabling UART flow control for BLE.
Not all boards or BLE extensions have the flow control signals for BLE
available at suitable pins.  Actually none of the Adafruit extensions
match for flow control.

For consistency with the previous behaviour it is enabled by default.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-10-02 11:31:24 +11:00
robert-hh 51ca23e463 mimxrt/boards: Fix naming of SD-card config option.
Commit 552b0bbe12 did not define
MICROPY_PY_MACHINE_SDCARD properly, and thus building the firmware failed.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-10-02 11:29:53 +11:00
Paint Your Dragon ed4d4a6b43
Merge pull request #8436 from PaintYourDragon/main
RP2040: fix 8-bit WAV playback
2023-09-29 20:39:33 -07:00
Scott Shawcroft d179eb4f54
Merge pull request #8371 from bill88t/rpi-auto-disconnect
`stop_station` when no wifi-reconnect
2023-09-29 15:23:56 -07:00
Phillip Burgess 2fe0fa5b5c Add output_length_used check as requested 2023-09-29 14:25:54 -07:00
Dan Halbert 68a2927385 MP_REGISTER_ROOT_POINTER for port-specific root pointers 2023-09-29 15:46:42 -04:00
Dan Halbert 1c388ab315 finish converting to MP_REGISTER_ROOT_POINTER() 2023-09-29 10:49:34 -04:00
robert-hh abb44694d8 mimxrt/boards/MIMXRT1176_clock_config: Fix comments about UART clocks.
No functional change, and pretty obvious.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-09-29 23:43:31 +10:00
robert-hh 0701341e7f mimxrt/machine_uart: Set the UART clock to a fixed 40MHz value.
There is a single UART clock for all devices, so switching it for one will
affect all devices used at that time.  This commit fixes that issue by
keeping the clock at a fixed value.

This fixed clock still supports the common baud rates between 300 and
921600 baud.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-09-29 23:43:25 +10:00
iabdalkader 52e3da0a0b mimxrt/mbedtls: Enable certificate validity time validation.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:09:48 +10:00
iabdalkader 361ca7d5ee mimxrt/mpbthciport: Enable flow control for BT HCI UART.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:09:35 +10:00
iabdalkader 552b0bbe12 mimxrt: Remove SDCARD Makefile config option.
This is option is no longer needed as a Makefile option as the USDHC driver
is enabled for all supported series.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:09:14 +10:00
iabdalkader 9d1a1ed42d mimxrt/Makefile: Enable the FSL USDHC for supported MCU series.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:08:57 +10:00
iabdalkader 805c750164 mimxrt/mimxrt_sdram: Allow boards to override the default SDRAM config.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:08:48 +10:00
iabdalkader 4b9c459133 mimxrt/sdio: Add support for the 117x series.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:08:41 +10:00
iabdalkader 6a6a90507d stm32/boards/ARDUINO_GIGA: Update board config.
Changes are:
- Disable internal flash storage and use the external QSPI for storage.
- Disable default bootloader entry mode.  The bootloader entry function
  exists in board_init.c.
- Remove OSC enable/disable macros (this board doesn't have an OSC).

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 16:56:06 +10:00
Jim Mussared da6f1e1d1e rp2/msc_disk: Allow configuring the USB MSC inquiry response.
This was previously hard-coded to "Micropy" / "Mass Storage" / "1.0".

Now allow it to be overridden by a board.

Also change "Micropy" to "MicroPy" and "1.0" to "1.00" to match stm32.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 16:36:45 +10:00
Jim Mussared 61f331374d stm32/usbd_msc_interface: Allow configuring the MSC inquiry response.
This was previously hard-coded to "MicroPy" / "pyboard Flash" / "1.00".

Now allow it to be overridden by a board.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 16:35:48 +10:00
dotnfc d7f63f994f esp32/main: Allow a board to override the MicroPython task stack size.
This allows the MicroPython task stack size to be overridden by the
mpconfigboard.h settings.

Signed-off-by: dotnfc <dotnfc@163.com>
2023-09-29 16:14:15 +10:00
Glenn Moloney 6662d84faa esp32/boards: Add bootloader rollback support for all builds.
Add "CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y" to
ports/esp32/boards/sdkconfig.base so that all micropython esp32 images
support OTA rollback in the bootloader.  These images can then be converted
to OTA-capable images as required by user tools.

Also remove CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y from board-specific
sdkconfig files as this is now the default.

Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
2023-09-29 16:00:51 +10:00
Felix Dörre 3c2b2f7a4d rp2/modmachine: Fix lightsleep while wifi is powered off.
While cyw43 is deinitialized, an interrupt occurs.  That is handled with
these lines: ports/rp2/mpnetworkport.c#L59-L61 and as pendsv is disabled
while in network code, the poll function then just waits there.

When deinit has finished, the poll func is executed, but skipped:
src/cyw43_ctrl.c#L222-L225 this skips the `CYW43_POST_POLL_HOOK` which
would re-enable interrupts, but also reset `cyw43_has_pending`.

And in that state, the lightsleep code, will skip sleeping as it thinks
there is a network packet pending to be handled.

With this change applied, lightsleep works as expected when the wifi chip
is enabled, and when it's powered off.
2023-09-29 15:15:42 +10:00
Jim Mussared cf32c2feb5 ports: Restrict board.json to standard features.
Applies to newly-added ARDUINO_PORTENTA_C33 and UM_NANOS3.

Makes the list match the standard features defined in
24a6e951ec.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 14:15:02 +10:00
Jim Mussared 79473691f2 {mimxrt,powerpc,samd}/mpconfigport: Don't override parse chunk alloc.
This was copied from minimal/mpconfigport.h, but it doesn't make sense
for general ports.

Add a comment to minimal/mpconfigport.h to explain why it specifically
overrides it.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 14:11:26 +10:00
Seon Rozenblum 77ae0a0948 esp32/boards: Fix VBAT voltage calculation for UM S3 boards.
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2023-09-29 14:09:15 +10:00
Angus Gratton 2fcd28f713 py/mkrules.mk: Don't strip binary if STRIP variable is unset.
This provides a way to build a non-DEBUG host binary that still has symbols
and debug information.

Document this for the unix port, and update a comment in the unix port
Makefile.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-09-29 13:01:12 +10:00
Damien George 03a3af417e esp8266/boards: Make sure modespnow.o is placed in irom0.
Signed-off-by: Damien George <damien@micropython.org>
2023-09-29 12:03:00 +10:00
Jeff Epler 10aeb23789
remove console pins, that was wrong 2023-09-28 17:13:22 -05:00
Dan Halbert 76ff01452b Trinket M0 comes up; still very much wip 2023-09-28 16:22:10 -04:00
Bill Sideris c3cf7c0894
wifi_reset 2023-09-28 17:53:40 +03:00
Damien George 5dbd6fc705 stm32/dma: Remove unbalanced ).
This was added by mistake in 9e0f934cdf

Signed-off-by: Damien George <damien@micropython.org>
2023-09-28 17:31:54 +10:00
Damien George 88564c1406 stm32/uart: Generalise UART source clock calculation for H5 and H7 MCUs.
This gets the calculation working properly for H5 MCUs, and fixes the
switch statement to switch on csel&7 instead of csel&3.

Signed-off-by: Damien George <damien@micropython.org>
2023-09-28 17:30:38 +10:00
Damien George 82b4ab7576 stm32/boards: Move includes to after defines in all hal_conf.h files.
The include of HAL headers should come after the HAL configuration defines,
so that the headers can see whether the defines were made or not, to
provide defaults and configure various things.

Signed-off-by: Damien George <damien@micropython.org>
2023-09-28 17:30:38 +10:00
Rene Straub 08c661c930 stm32/dac: Add STM32H5 DAC support, with dma_nohal implementation.
Integrate DAC support for STM32H5.  Implement STM32H5 GPDMA driver. The DMA
driver is largely different from other STM32 variants.  To support the DAC
circular mode, memory based linked list DMA descriptors are used.

Signed-off-by: Rene Straub <rene@see5.ch>
2023-09-28 17:11:37 +10:00
Jeff Epler a9fce6c495
qualia: fixes for revision C
* neopixel removed, could not share function with DBLTAP
 * external SPI bus definition is settled
2023-09-27 18:13:21 -05:00
Jeff Epler aa0d7aad83
Merge pull request #8440 from jepler/dotclock-overscan-rotation
Dotclock: fix overscan and rotation
2023-09-27 18:07:50 -05:00
Jeff Epler c1a98e460a
Merge pull request #8439 from tannewt/fix_for_make_quirk
Tweak for make quirk
2023-09-27 18:05:43 -05:00
Jeff Epler f80d08e207
Make dot clock displays with a masked portion on the left work 2023-09-27 15:15:32 -05:00
Scott Shawcroft 3684640ada
Merge pull request #8430 from jepler/dotclock-enhancements
Dotclock enhancements
2023-09-27 11:39:37 -07:00
Scott Shawcroft ad837d44ed
Tweak for make quirk 2023-09-27 09:17:07 -07:00
Rene Straub 72ef2e6291 stm32/machine_adc: Fix and improve STM32H5 support.
Changes are:
- Run ADC on PCLK/16.
- Verify and optimize timings (ADC_STAB_DELAY_US, ADC_SAMPLETIME_DEFAULT).
- Add support for STM32H5 VBAT and COREVDD channels on ADC2.
- Replace ADC constants in machine_adc_locals_dict_table.
- Convert STM32 literal to channel numbers in adc_config_channel with
  corresponding STM32 LL library functions (__LL_ADC_IS_CHANNEL_INTERNAL(),
  __LL_ADC_CHANNEL_TO_DECIMAL_NB()).

Reasoning for the second last point: the STM32 driver literals are uint32_t
that don't work with MP_ROM_INT() which handles signed 31 bit integers
only.  Introduce enumerator machine_adc_internal_ch_t to define external
channels (0..19), internal channels (256..) and the special channel VREF
(0xffff).  Values are converted to STM32 literals with adc_ll_channel()
when required in adc_config_and_read_u16().

Signed-off-by: Rene Straub <rene@see5.ch>
2023-09-27 16:58:10 +10:00
Rene Straub 64d24fccd6 stm32/adc: Optimize sampling time for G4, H5, L4 and WB MCUs.
Signed-off-by: Rene Straub <rene@see5.ch>
2023-09-27 16:28:31 +10:00
Rene Straub 8f9bba0a1a stm32/adc: Add support for STM32H5 ADC2 inputs.
Select ADC instance based on pin information to support ADC2 inputs.
Display ADC instance number similar to machine_adc (STM32H5 only):
<ADC2 on Pin(Pin.cpu.F14, mode=Pin.ANALOG) channel=6>

Signed-off-by: Rene Straub <rene@see5.ch>
2023-09-27 16:28:15 +10:00
Rene Straub 13cc280eae stm32/adc: Fix STM32H5 support.
Fixed the preliminary STM32H5 ADC support for pyb.ADC:
- Run ADC on PCLK/16.
- Use STM32 ADC library channel literals (__HAL_ADC_DECIMAL_NB_TO_CHANNEL).
- Use correct temperature conversion for H5 (30C, 130C calibration points).

Signed-off-by: Rene Straub <rene@see5.ch>
2023-09-27 16:26:30 +10:00
Phillip Burgess 54322578d2 RP2040: fix 8-bit WAV "audio buffer too small" bug
Also subtly fixed 8- to 16-bit scaling math
2023-09-26 16:44:19 -07:00
Scott Shawcroft 3fdfb9bd32
Update ADC and I2S APIs for 5.1
This fixes ESP32 because the BufferedIn used the old ADC API and
I2S did too indirectly.

Fixes #8429
2023-09-26 16:06:54 -07:00
Jeff Epler 3d3061f6f7
fix qualia board definition 2023-09-26 08:33:27 -05:00
Jeff Epler 1c2362b758
bump qualia psram to 120MHz 2023-09-26 08:33:10 -05:00
Jeff Epler 3af5cbc312
bump ram to 120MHz 2023-09-26 07:49:00 -05:00
Jeff Epler 03141d40af
espressif: i2c: initialize "has_lock"
Otherwise, a stack-constructed i2c instance might get some other value
here.
2023-09-26 07:48:59 -05:00
Jeff Epler 747b6e8d2e
enable LCD_RGB_RESTART_IN_VSYNC
this "should" turn permanent tearing into temporary tearing.
2023-09-25 16:39:38 -05:00
Jeff Epler 6263f6af84
Switch to i2c init string for espressif lcd ev, expose values via board 2023-09-25 16:39:00 -05:00
Jeff Epler 65310ab615
update io expander table for rev C 2023-09-25 12:00:04 -05:00
Jeff Epler ce22edba15
On Qualia, define board.TFT_IO_EXPANDER
these arguments make it easier to call ioexpander_send_init_sequence
2023-09-25 11:33:01 -05:00
MicroDev 27fd60d739
implement suggested changes
- update the docs
- split out common `watchdog_reset`
- revert to using `None` instead of `WatchDogMode.NONE`
2023-09-24 15:23:38 +00:00
MicroDev 05812e0618
Merge branch 'main' into watchdog-rp 2023-09-24 05:13:22 +00:00
Scott Shawcroft c726e87344
Enable BLE on H2 devkit 2023-09-22 15:05:20 -07:00
Jeff Epler fb6f4c938c
tweak coverage build configuration 2023-09-22 14:26:51 -05:00
Jeff Epler d1ee906afd
fix dependency on generated header 2023-09-22 14:14:07 -05:00
Jeff Epler 2cc07aef73
dummy RUN_BACKGROUND_TASKS for unix port 2023-09-22 13:39:08 -05:00
Jeff Epler 87feeab922
fix ringbuf differences 2023-09-22 13:38:56 -05:00
Scott Shawcroft faa445e347
Three more board fixes 2023-09-22 10:03:20 -07:00
Scott Shawcroft 1480d70d17
Fix builds
* Disable bleio on C3 with 4MB flash.
* Fix gpio include path in board.c's that use it.
2023-09-22 10:03:20 -07:00
Scott Shawcroft 16d1dc2be0
Update all target sdkconfig 2023-09-22 10:03:20 -07:00
Scott Shawcroft 6649b17fb5
H2 works 2023-09-22 10:03:20 -07:00
Scott Shawcroft 39192cc896
C6 works 2023-09-22 10:02:35 -07:00
Scott Shawcroft 7bad82a219
C6 compiles, runs but wifi crashes 2023-09-22 10:02:35 -07:00
Scott Shawcroft e22eefabd7
First stab at 5.1 update 2023-09-22 10:02:30 -07:00
Scott Shawcroft d6b284ebb0
Merge pull request #8411 from tannewt/update-idf
Update to ESP-IDF 5.0
2023-09-22 09:45:35 -07:00
Jeff Epler e1fffe67a0
split heap doesn't build yet so don't test it 2023-09-22 10:40:34 -05:00
Jeff Epler 4902b76129
guard this file against being included twice 2023-09-22 10:40:21 -05:00
Luca Burelli dd58be19ee esp32: Fix Partition.writeblocks() partial write corruption.
To simulate a partial erase, the code reads a native block, erases it,
and writes back the data before and after the erased area. However, the
current logic was filling the area after the erased block with data
from the beginning of the native block-aligned data, instead of applying
the proper offset.

Fixes #12474.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2023-09-21 17:49:48 +02:00
Scott Shawcroft d4000023d8
Fix board def mistakes and cast 2023-09-20 11:45:45 -07:00
Jeff Epler e7668ed91d
spelling 2023-09-20 11:23:34 -05:00
Jeff Epler 2b754b1f6b
spelling 2023-09-20 11:23:28 -05:00
Damien George a3862e7267 stm32/powerctrlboot: Allow PLL1 Q and R outputs to be enabled on H5.
If a board needs these outputs then it can define MICROPY_HW_CLK_PLLQ/R.

It saves power to not enable them if they are not needed.

Signed-off-by: Damien George <damien@micropython.org>
2023-09-20 18:56:52 +10:00
Dan Halbert 4d175ab41a convert to MP_DEFINED_CONST_OBJ_TYPE() 2023-09-19 21:09:29 -04:00
Dan Halbert 2c0fa0f7dc initial merge from v1.20.0; just satisifying conflicts 2023-09-19 11:10:12 -04:00
Scott Shawcroft e39fbf1b26
Merge pull request #8401 from jepler/i2c-expander-init
Fast(ish) special purpose bitbang spi over i2c
2023-09-18 13:19:49 -07:00
Scott Shawcroft c86b3ae19f
Update to merged idf changes 2023-09-18 11:18:04 -07:00
Jeff Epler faa6887050
Use faster bus & remove final delay
this pushes the LCD initialization down to about 1.3s.
2023-09-18 13:00:18 -05:00
Jeff Epler 67e15bb6a2
makerfabs_tft7: rename properties to match docs 2023-09-18 10:35:49 -05:00
Jeff Epler 75ba82cdb0
lcd_ev: add timings; rename TFT -> TFT_PINS 2023-09-18 10:35:36 -05:00
Jeff Epler 4c682262e6
lcd_ev: fix compile error 2023-09-18 10:35:05 -05:00
IhorNehrutsa 00930b213e esp32/mphalport: Add function/line/file info to check_esp_err exception.
Currently, check_esp_err() raises an exception without a location in the
source code, eg:

    Traceback (most recent call last):
      File "<stdin>", line 8, in <module>
    OSError: (-258, 'ESP_ERR_INVALID_ARG')

This commit allows additional error reporting (function, line and file) to
be enabled via detailed exceptions.  Change the error reporting config to

    #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)

and then exception messages from IDF errors look like:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: (-258, "0x0102 ESP_ERR_INVALID_ARG in function 'set_duty_u16'
    at line 342 in file './machine_pwm.c'")

Signed-off-by: Ihor Nehrutsa <IhorNehrutsa@gmail.com>
2023-09-18 11:26:43 +10:00
Scott Shawcroft 0547ef61f9
Update dotclock for IDF 5.0 2023-09-15 14:43:37 -07:00
Jeff Epler 2a78d16b54
add board.DISPLAY 2023-09-15 14:49:29 -05:00
Jeff Epler 68af5543af
set up display at reset (yayay!) 2023-09-15 14:46:28 -05:00
Jeff Epler cff65bbbe2
esp32 lcd ev: fix pin assignments 2023-09-15 14:10:32 -05:00