Commit Graph

374 Commits

Author SHA1 Message Date
Andrew Leech
fffaf8a41f extmod/modnetwork: Consolidate definition of common drivers.
Most extmod network drivers were being defined on a per-port basis,
duplicating code and making enabling a driver on a new port harder.

This consolidates extmod driver declarations and removes the existing
per-port definitions of them.

This commit has been verified to be a no-op in terms of firmware change.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-06-10 11:20:38 +10:00
Matt Trentini
3e33d0567f ports: Update board.json files for vendor/product consistency.
The vendor and product fields in the `board.json` files were somewhat
inconsistent.  Remove any duplication of the vendor name in the product
field so that `f"{vendor} {product}"` reads well.

In addition to that, update most of the URL's for `board.json` files that
are modified here, and match case and spacing used by the manufacturers for
the vendor and product names.

Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
2025-06-04 01:47:59 +10:00
Alessandro Gatti
f47e214cdc all: Rename the "NORETURN" macro to "MP_NORETURN".
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This commit renames the NORETURN macro, indicating to the compiler
that a function does not return, into MP_NORETURN to maintain the same
naming convention of other similar macros.

To maintain compaitiblity with existing code NORETURN is aliased to
MP_NORETURN, but it is also deprecated for MicroPython v2.

This changeset was created using a similar process to
decf8e6a8b ("all: Remove the "STATIC"
macro and just use "static" instead."), with no documentation or python
scripts to change to reflect the new macro name.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-05-13 10:36:47 +10:00
Angus Gratton
b2cda6c604 extmod,alif,mimxrt,rp2,stm32: Create common cyw43 driver config header.
This is only a surface level refactor, some deeper refactoring would be
possible with (for example) the SDIO interface in mimxrt and stm32, or the
BTHCI interface which is is similar on supported ports. But sticking to
cases where the macros are the same across all ports.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-05-08 15:32:05 +10:00
iabdalkader
3bbed952fd mimxrt/cyw43_configport: Update cyw43 config to use new BTHCI UART.
Update the cyw43 configuration to use the new BTHCI UART backend provided
by cyw43-driver.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-22 12:49:14 +10:00
iabdalkader
399c10dc28 mimxrt/machine_uart: Enable CTS SION so it can be read.
The new CYW43 BTHCI UART backend requires CTS pin to be defined and
readable.  This patch enables the CTS pin SION bit to allow it to be read
regardless of mux mode.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-22 12:39:01 +10:00
Damien George
0b3ad98ea9 mimxrt/Makefile: Fix dependencies for generation of flexram_config.s.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Prior to this fix the following would fail:

    $ make build-TEENSY40/flexram_config.s

because it didn't create the build directory before generating the file.

Also, make `hal/resethandler_MIMXRT10xx.S` have an explicit dependency on
`flexram_config.s` rather than the latter just being forced to be built
before everything else.

Signed-off-by: Damien George <damien@micropython.org>
2025-04-10 13:56:51 +10:00
Damien George
a9384c71c5 extmod/extmod.mk: Switch from drivers/cyw43/cywbt to lib/cyw43-drivers.
The cyw43-driver now provides the Bluetooth initialisation code, making
`drivers/cyw43/cywbt.c` obsolete.  To use the new code a port must enable
the `CYW43_ENABLE_BLUETOOTH_OVER_UART` option.

Some ports have yet to migrate to the new code, so in the meantime they can
explicitly add the old source to their source list and continue to use it
without change.

Signed-off-by: Damien George <damien@micropython.org>
2025-04-08 23:52:16 +10:00
robert-hh
274c8c419c mimxrt/boards: Update deploy instructions.
Make the final step of the deploy more detailed.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25 12:45:17 +11:00
robert-hh
cdcc70d4f8 mimxrt: Enable default devices for I2C, SPI and UART.
Since all boards are configured to have a I2C(0), SPI(0) and UART(1), these
can be set as default devices, allowing the instantiation of I2C(), SPI(),
UART() without an id argument.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25 12:44:20 +11:00
robert-hh
1e7328ca28 mimxrt/machine_i2c: Support the timeout keyword argument.
Set the default timeout to 50000 us.  The default used to be 0, causing the
NXP I2C driver to silently stop working in case of a non-responding device.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25 12:42:26 +11:00
robert-hh
b85ad4bd41 mimxrt/machine_uart: Fix rx/tx buffer allocation bug.
The buffer would be reset on every call to `uart.init()`.  If no sizes were
given, the buffer would be set to the default size 256.  That made problems
e.g. with PPP.  Also, the RX buffer was not stored at the UART object and
not visible to GC as being in use.  Then a `gc.collect()` would eventually
free the buffer.

This commit fixes those issues, keeping the buffer size if not deliberately
changed and allocating new buffers only if the size was changed.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25 12:41:21 +11:00
robert-hh
1398e7fd20 mimxrt/hal/qspi_nor_flash_config: Use a safe common CS timing.
The flash devices used by the MIMXRT board are specified either with 3ns or
5 ns CS setup and hold time.  Since a single configuration file is used for
all boards, use 5ns instead of 3ns to be safe, even if there were no
problems so far.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25 12:40:41 +11:00
robert-hh
2d20dbce2c mimxrt/machine_uart: Remove duplicate init and make IRQ optional.
Changes:
- The duplicate LPUART_Init call was not needed, just an edit fail.
- Allow a port to disable UART.irq().  Some code for configuration stays,
  but the respective UART IRQ is not enabled.  Calling uart.irq() will
  cause an exception by extmod/machine_uart.c.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25 12:40:02 +11:00
robert-hh
2a5b97beae mimxrt/mpconfigport: Enable PPP for boards with lwIP.
PPP is now enabled on all boards with Ethernet support.  PPP could be
enabled for other boards without Ethernet like the Teensy 4.0 as well in a
second step.  Enabling for MIMXRT101x boards is hardly possible due to the
large RAM demand of lwIP.

Tested with a Teensy 4.1 board and a SimCom A7608 GPRS/LTE modem.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25 12:38:56 +11:00
robert-hh
d8edae040f mimxrt/mpconfigport: Enable support for exFAT.
There is plenty of room in the MIMXRT board flash, so it can be enabled.

Tested with:
- MIMXRT1176_EVK
- MIMXRT1061 (Teensy 4.1)
- MIMXRT1010 (Olimex RT1010)

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25 12:38:42 +11:00
robert-hh
58f1ade318 mimxrt/machine_adc: Add ADC.read_uv() method.
Matching the generic documentation.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25 12:38:00 +11:00
robert-hh
f1018ee5c2 mimxrt/boards/MAKERDIARY_RT1011_NANO_KIT: Add new Makerdiary board.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This is a board based on the i.MX RT1011 in breadboard-friendly shape.  A
good basic board with 16M flash and regular pinout, providing access to
many GPIO_nn and GPIO_AD_nn Pins.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-17 13:59:32 +11:00
Damien George
0ec496a98c lib/cyw43-driver: Update driver to latest version v1.1.0.
Includes various fixes and improvements to the WLAN driver, in particular:
- Add WPA3 STA and AP support.
- Attempt to reconnect to AP in response to validation error.
- Update 43439 BT firmware for Data Length Extension fix.

Signed-off-by: Damien George <damien@micropython.org>
2025-03-12 13:17:02 +11:00
Christian Clauss
5e206fdeb5 all: Upgrade codespell to v2.4.1.
This commit upgrades from codespell==2.2.6 to the current codespell==2.4.1,
adding emac to the ignore-words-list.

Signed-off-by: Christian Clauss <cclauss@me.com>
2025-02-25 16:11:33 +11:00
robert-hh
4364d9411a mimxrt/hal/flexspi_nor_flash: Fix typo in comment about frequency.
Some checks are pending
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-23 17:42:58 +11:00
robert-hh
1e3cce1397 mimxrt/boards/ADAFRUIT_METRO_M7: Reduce flash freq to 100MHz.
It was set to 133Mhz, but that is not stable.  Reduce to 100MHz.

The UF2 bootloader runs at 100MHz, so no need for a change of the
bootloader.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-23 17:42:36 +11:00
iabdalkader
cb417505f3 mimxrt/boards: Reduce stack size for 1011 and 1015 MCUs.
Reduced to 16KBs to allow enabling MSC.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-02-10 12:53:32 +11:00
iabdalkader
2f646f93d3 mimxrt: Add optional MSC support.
Add MSC support using internal flash storage or SD card.

Note this is disabled by default, and can be enabled by boards if needed.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-02-10 12:52:45 +11:00
robert-hh
0a433a02e1 mimxrt/hal: Set the flexspi flash CLK frequency on boot.
The flash clock frequency may have been set to a different value by a
bootloader.  Set the frequency according to the configured value.  Use a
table of pre-calculated dividers to get the closest value for the flash
frequency, achieving for MIMXRT10xx:

  30 -> 30.85 MHz
  50 -> 49.65 MHz
  60 -> 60 MHz
  75 -> 75.13 MHz
  80 -> 80 MHz
  100 -> 99.31 Mhz
  133 -> 132.92 MHz
  166  -> 166.15 MHz

for MIMXRT1176:

  30 -> 31 MHz
  50 -> 52.8 MJz
  60 -> 58.7 MHz
  75 -> 75.4 MHz
  80 -> 75.4 MHz
  100 -> 105.6 MHz
  133 -> 132 MHz
  166 -> 176 MHz

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-10 11:32:26 +11:00
robert-hh
d40849d07d mimxrt/boards: Add flash configuration constants to mpconfigboard.mk.
And use these to initialize the LUT table properly for the various flash
types.  The different flash types differ by 3 parameters.  Thus it is
easier to just keep one copy of the qspiflash_config structure with the LUT
table and update it during flash initialisation as needed.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-10 11:31:58 +11:00
robert-hh
9eb9451d83 mimxrt/boards: Update the deploy instructions for the UF2 bootloader.
Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-10 11:31:50 +11:00
robert-hh
2a80d5c68b mimxrt/flash: Swap the order of disabling IRQ and disabling the cache.
This change stopped problems with USB IRQ happening during flash writes.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-10 11:31:28 +11:00
robert-hh
b251aec0fc mimxrt/hal: Update the LUT and re-enable PAGEPROGRAM_QUAD.
Changes:
- Change the LUT table ordering to be similar to the order of the
  UF2-Bootloader and fsl_romapi.h.
- Rewrite the LUT entry for PAGEPROGRAM_QUAD and update the LUT.  That
  enabled QUAD program again.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-10 11:30:44 +11:00
robert-hh
e574f68820 mimxrt: Add support for a UF2 bootloader.
Allowing to use e.g. the Adafruit bootloaders with MicroPython.  The .uf2
file is created in addition to the .bin and .hex files allowing to use the
latter ones without the bootloader for debugging and testing.

Changes:

- Set the location of the ISR Vector and .text segment to 0x6000C000 and
  0x6000C400.
- Reserve an area at the start of ITCM for a copy of the interrupt vector
  table and copy the table on reset to this place.
- Extend `machine.bootloader()` by setting the magic number to enable the
  bootloader on reset.
- Create a .uf2 file which skips the segments below 0x6000C000.

The bootloader has to be installed as a preparation step using the board
specific methods, but then the firmware's .uf2 file version can be
installed using the bootloader.  The bootloader can be invoked with:

- double reset
- calling machine.bootloader()
- Using the touch1200 method

Double reset is hard to achieve on MIMXRT boards, since there is no clean
reset pin.  Some MIMXRT boards provide it by switching the power.

Some boards are excluded from the .uf2 build:

- MIMXRT1050_EVK: The uf2 bootloader is built for the QSPI version of the
  board.  MicroPython supports the Hyperflash version.
- MIMXRT1176_EVK: No support for this board yet, but it should be possible.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-10 11:28:39 +11:00
iabdalkader
d76733d058 mimxrt/mpconfigport: Remove hard-coded CMSIS header.
Some checks are pending
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-02-07 22:39:45 +11:00
iabdalkader
67ebc537c3 mimxrt/machine_rtc: Fix build with new SDKs.
In more recent SDKs, this feature is actually disabled for the MIMXRT1062.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-02-07 22:39:37 +11:00
iabdalkader
e176fea95c mimxrt/irq: Add CSI IRQ.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-02-07 22:39:32 +11:00
Damien George
abb13b1e1e extmod/lwip-include: Factor common lwIP config into lwipopts_common.h.
This lwIP configuration file has options that are common to all ports, and
the ports are updated to use this file.  This change is a no-op, the lwIP
configuration remains the same for the four ports using this common file.

This reduces code duplication, keeps the ports in sync, and makes it easier
to update the configuration for all ports at once.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-29 12:36:27 +11:00
robert-hh
f4e4599523 ports: Fix machine.RTC.init() method so argument order matches the docs.
This commit makes the argument ordering of `machine.RTC.init()` the same
for all the ports that implement arguments to this method: cc3200, esp32,
mimxrt and samd.  The cc3200 argument ordering is used, which matches the
documentation.

Also document the availability and the differing semantics for the stm32
and renesas-ra port.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-12-19 16:04:47 +11:00
robert-hh
0302cd65e8 mimxrt/machine_rtc: Drop machine.RTC.now() method.
This is not part of the common machine API.  It's dropped on the mimxrt
port and kept only on the cc3200 port for legacy.

Also show the port availability of `RTC.now()` in the documentation.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-12-19 16:00:41 +11:00
Alessandro Gatti
e8c3f31ba2 mimxrt/machine_rtc: Deprecate RTC.cancel in MicroPython v2.
The current documentation for the `machine.RTC` class contains information
about the `RTC.cancel` method for cancelling pending alarms.

However only two ports (cc3200 and mimxrt) implement this functionality
but under a different name: `RTC.alarm_cancel`.  The mimxrt port also
implements `RTC.cancel` but it is aliased to `RTC.alarm_cancel` anyway.

To maintain naming consistency, this commit updates the documentation to
officially define `RTC.alarm_cancel` as the method to call to cancel
pending alarms and deprecates mimxrt's `RTC.cancel` implementation.
`RTC.cancel` in the mimxrt port is thus scheduled for removal in
MicroPython v2.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-12-10 12:16:03 +11:00
iabdalkader
2bee8e1b8c mimxrt/mpconfigport: Update FATFS config to align with other ports.
Make this port use the same FATFS config as stm32, rp2, renesas-ra.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-12-10 11:05:05 +11:00
iabdalkader
67b4e6236b mimxrt: Switch to shared TinyUSB descriptor.
This removes duplicated TinyUSB configuration and port-specific code.

Tested on RT1062, CDC+MSC still working.  @robert-hh tested CDC with 1011,
1015, 1020 and 1176.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-12-10 10:29:21 +11:00
robert-hh
e2532e0f72 mimxrt/machine_pwm: Fix a few inconsistencies with PWM output.
Changes in this commit:
- When setting PWM parameters of a FLEXPWM AB channel twice within a PWM
  cycle, the second setting was ignored. Now the second setting persists.
- With `duty_u16(0)` a FLEXPWM X channel was set to high impedance.  Now it
  is set to low impedance with value 0 for `invert=False`, and 1 for
  `invert=True`.
- The align parameter requires a duty rate and frequency to be set.  Align
  will now be ignored if freq or duty are missing.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-11-18 16:11:13 +11:00
robert-hh
898407defb ports: Make PWM duty_u16 have an upper value of 65535 across all ports.
The following ports used 65536 as the upper value (100% duty cycle) and are
changed in this commit to use 65535: esp8266, mimxrt, nrf, samd.

Tested that output is high at `duty_u16(65535)` and low at `duty_u16(0)`.
Also verified that at `duty_u16(32768)` the high and low pulse have the
same length.

Partially reverts #10850, commits 9c7ad68165
and 2ac643c15b.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-11-18 16:05:56 +11:00
Damien George
d50e36e7e4 ports: Include py/mphal.h instead of mphalport.h.
The `mphalport.h` header should not be included directly, rather
`py/mphal.h` should be used.

Signed-off-by: Damien George <damien@micropython.org>
2024-10-09 14:39:34 +11:00
Andrew Leech
548f88d2bd shared/tinyusb: Wake main task if needed at end of USB ISR.
Some checks are pending
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
Signed-off-by: Andrew Leech <andrew@alelec.net>
2024-10-07 11:06:57 +11:00
Damien George
40048f0f25 ports: Fix lwIP config setting to disable DHCP ARP check.
lwIP was recently updated in a89ac9e24a
to STABLE-2_2_0_RELEASE, and this introduced a change in the configuration
variable `DHCP_DOES_ARP_CHECK`, renaming it to `LWIP_DHCP_DOES_ACD_CHECK`.

This commit fixes the ports lwIP settings to use the new configuration
option.

Without this option, connecting to a WiFi access-point takes about 12.5
seconds.  With this option (ie disabling DHCP ARP checks) connecting takes
about 4 seconds.

Tested on an RPI_PICO_W and PYBD_SF2.

Signed-off-by: Damien George <damien@micropython.org>
2024-09-26 23:00:42 +10:00
robert-hh
b7fa4e2fc8 mimxrt/machine_uart: Implement a Python UART IRQ handler.
Supported triggers are: IRQ_RXIDLE and IRQ_TXIDLE.

When IRQ_RXIDLE is set, the handler will be called 3 character times after
the data in burst stopped.

When IRQ_TXIDLE is set, the handler will be called immediately after the
data has been sent.

This commit requires a change to fsl_lpuart.c, because the existing code
does not support under-run appropriately.

The irq.flags() value is cleared only at an expected event.  Do not change
it otherwise.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-08-29 16:27:43 +10:00
robert-hh
87adf11dd2 mimxrt/machine_pin: Clear IRQ flag when enabling or disabling IRQ.
Preventing already pending IRQs to fire when not expected.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-08-20 12:06:25 +10:00
robert-hh
36108a41d0 mimxrt/mimxrt_sdram: Fix pin config and comments.
Signed-off-by: robert-hh <robert@hammelrath.com>
2024-08-20 12:05:59 +10:00
iabdalkader
91f4a6b9e9 mimxrt/mpmetalport: Use mp_event_handle_nowait() for metal_poll.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-08-08 18:02:21 +10:00
Andrew Leech
8809ae7161 shared/tinyusb: Buffer startup CDC data to send to host on connection.
At startup, buffer initial stdout / MicroyPthon banner so that it can be
sent to the host on initial connection of the USB serial port.  This
buffering also works for when the CDC becomes disconnected and the device
is still printing to stdout, and when CDC is reconnected the most recent
part of stdout (depending on how big the internal USB FIFO is) is flushed
to the host.

This change is most obvious when you've first plugged in a MicroPython
device (or hit reset), when it's a board that uses USB (CDC) serial in the
chip itself for the REPL interface.  This doesn't apply to UART going via a
separate USB-serial chip.

The stm32 port already has this buffering behaviour (it doesn't use
TinyUSB) and this commit extends such behaviour to rp2, mimxrt, samd and
renesas-ra ports, which do use TinyUSB.

Signed-off-by: Andrew Leech <andrew@alelec.net>
2024-06-04 17:49:19 +10:00
Felix Dörre
1f23ab1e3d esp32,mimxrt,stm32: Implement ipconfig() for more network interfaces.
Implements:
- esp32: network.ipconfig()
- esp32: network.LAN.ipconfig()
- esp32: network.WLAN.ipconfig()
- mimxrt: network.LAN.ipconfig()
- stm32: network.LAN.ipconfig()

Signed-off-by: Felix Dörre <felix@dogcraft.de>
2024-06-04 12:45:01 +10:00