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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>