Commit Graph

2469 Commits

Author SHA1 Message Date
Jos Verlinde
5f8eef4521 windows/README.md: Fix broken mingw link. 2022-01-23 09:19:47 +11:00
ubi de feo
ea5744fd8d esp32/boards: Provide custom deploy_c3.md for ESP32-C3 boards.
This fixes the flash address for installation on ESP32-C3.
2022-01-22 11:18:50 +11:00
Damien George
bb9d688454 esp32/main: Use heap_caps_get_info on IDF <4.1 to compute total heap.
heap_caps_get_total_size() is only available in IDF 4.1 and above.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-22 10:46:31 +11:00
marcidy
ac39960aa1 esp32/modnetwork: Fix test for WIFI_AUTH_MAX for IDF v4.3.0.
Signed-off-by: marcidy <marcidy@gmail.com>
2022-01-22 00:55:07 +11:00
Sean Coates
6a10d3ed99 esp32/README.md: Fix URL for esp-idf installation.
The current URL points to a pinned version of the document (v4.0.2) and is
currently not found (404).
2022-01-22 00:53:26 +11:00
Damien George
23b1a4e0b6 esp32/main: Allocate at most 1/2 of available IDF heap for MP heap.
So that there is some memory left for the OS, eg for ssl buffers.

See issue #7214.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-22 00:46:12 +11:00
Damien George
648656dbbd esp32/esp32_rmt: Call rmt_driver_install directly if running on core 1.
Signed-off-by: Damien George <damien@micropython.org>
2022-01-22 00:11:14 +11:00
jason
357078504d esp32: Pin MicroPython to core 1 again.
This follows up on #5489, where we changed the esp32 core pinning to core 0
in order to work around an issue with IDF < 4.2.0.  Now that IDF > 4.2.0 is
available, we allow pinning back to core 1, which eliminates some
problematic callback latency with WiFi enabled.

NimBLE is also pinned to core 1 - the same core as MicroPython - when using
IDF >=4.2.
2022-01-22 00:10:16 +11:00
Jonathan Hogg
63438a31bb esp32/machine_adcblock: Add new machine.ADCBlock class and update ADC.
Rework the ADC implementation to follow the improved ADC/ADCBlock API.
This adds support for calibrated voltage readings and the ADC2 block.  The
ADC API is backwards compatible with what it was before this change.

Resolves #6219.
2022-01-21 22:55:24 +11:00
Damien George
a707fe50b0 rp2/machine_i2c: Use soft I2C only for len=0, and increase timeout.
The RP2040 I2C hardware can do writes of length 1 and 2, just not of length
0.  So only use software I2C for writes of length 0, to improve
performance.

Also increase the software I2C timeout for zero-length writes to
accommodate the behaviour of a wider range of I2C devices.

Fixes issue #8167.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-21 15:10:29 +11:00
iabdalkader
bef26d4e3f rp2/machine_uart: Add machine.UART init/deinit methods.
Without these methods a lot of existing "portable" scripts are broken.
This change improves portability by making rp2 machine.UART more compliant
with the documented machine UART interface.
2022-01-21 15:08:47 +11:00
iabdalkader
5db278f1dd rp2/mphalport: Add optional dupterm support. 2022-01-20 16:57:03 +11:00
iabdalkader
f44fb76055 rp2/mpconfigport.h: Use internal error numbers. 2022-01-20 16:46:14 +11:00
Damien George
7b0a42374e rp2/machine_i2c: Provide more specific error codes from I2C transfer.
Signed-off-by: Damien George <damien@micropython.org>
2022-01-20 16:43:55 +11:00
Damien George
608d421752 stm32/mboot: Remove custom HAL_RCC_GetHCLKFreq and use HAL provided one.
So that a board can access other HAL_RCC functions if it needs them (this
was not possible previously by just adding hal_rcc.c to the src list for a
board because it would clash with the custom HAL_RCC_GetHCLKFreq function).

Signed-off-by: Damien George <damien@micropython.org>
2022-01-20 16:08:17 +11:00
Damien George
5e506567a3 stm32/mbedtls: Enable MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE.
This adds MBEDTLS_MD_SHA1 to the list of default hashes for TLS 1.2
handshake signatures.  Although SHA-1 is weak, this option is turned on in
the default mbedtls configuration file, and allows better compatibility
with older servers.  In particular it allows an stm32-mbedtls-based client
to connect to an axtls-based client (eg default unix port and esp8266).

Signed-off-by: Damien George <damien@micropython.org>
2022-01-17 17:35:04 +11:00
stijn
cf258c898e windows/msvc: Run qstr preprocessing phase in parallel.
Supported from VS2017 and up, this roughly halves build time.
2022-01-14 17:05:55 +11:00
Damien George
a3bbd5332b esp32/machine_bitstream: Reinstate bitstream bit-bang implementation.
The bit-bang implementation was replaced with the RMT implementation in
599b61c086.  This commit brings back that
bit-bang code, and allows it to be selected via the new static method:

    esp32.RMT.bitstream_channel(None)

The bit-bang implementation may be useful if the RMT needs to be used for
something else, or if bit-banging is more stable in certain applications.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-14 16:40:01 +11:00
Damien George
e754c2e84f esp32/esp32_rmt: Install RMT driver on core 1.
MicroPython currently runs on core 0 of the esp32.  Calling
rmt_driver_install will mean that the RMT interrupt handler is also
serviced on core 0.  This can lead to glitches in the RMT output if
WiFi is enabled (for esp32.RMT and machine.bitstream).

This patch calls rmt_driver_install on core 1, ensuring that the RMT
interrupt handler is serviced on core 1.  This prevents glitches.

Fixes issue #8161.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-14 15:41:59 +11:00
Damien George
a49b51b7db zephyr/modbluetooth_zephyr: Provide dummy connect_cancel function.
Signed-off-by: Damien George <damien@micropython.org>
2022-01-13 13:45:55 +11:00
stijn
b47b245c2e windows/appveyor: Build mpy-cross only once for mingw-w64.
The main Makefile builds the mpy-cross executable automatically if
it doesn't exist since 78718fffb1,
so build it first to make sure it doesn't get needlessly rebuilt.
2022-01-10 15:01:03 +01:00
Damien George
ff0227fa0d esp32/boards/GENERIC_D2WD: Build with -Os optimisation.
This board has only 2MiB of flash so the build needs to be reduced in size
to fit.  Commit 549448e8bb made all boards
build with -O2 by default (for performance) so this overrides that default.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-09 11:25:37 +11:00
Damien George
1892d03740 mimxrt,stm32: Enable MICROPY_PY_USSL_FINALISER.
This is needed because these ports allocate mbedtls data on the MicroPython
heap, and SSL socket objects must be fully cleaned up when they are garbage
collected, to free this memory allocated by mbedtls.  As part of this,
gc_sweep_all() will now ensure that the MP_STATE_PORT(mbedtls_memory)
linked-list is fully deallocated on soft reset.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-08 00:02:04 +11:00
Damien George
df3f59ca4b ports: Update board.json files to link to new board images.
Signed-off-by: Damien George <damien@micropython.org>
2022-01-07 11:33:28 +11:00
Damien George
b96318ab61 esp32: Enable platform module with IDF version.
Output looks like this:

    >>> import platform
    >>> platform.libc_ver()
    ('newlib', '3.0.0')
    >>> platform.platform()
    'MicroPython-1.17.0-xtensa-IDFv4.2.2-with-newlib3.0.0'
    >>> platform.python_compiler()
    'GCC 8.4.0'

Signed-off-by: Damien George <damien@micropython.org>
2022-01-06 18:25:48 +11:00
Damien George
000b001fc1 rp2/boards/GARATRONIC_PYBSTICK26_RP2040: Use correct pico-sdk board cfg.
Signed-off-by: Damien George <damien@micropython.org>
2022-01-06 16:50:20 +11:00
Damien George
4693cf9081 rp2/CMakeLists.txt: Allow a board to override PICO_BOARD.
Signed-off-by: Damien George <damien@micropython.org>
2022-01-06 16:49:57 +11:00
Maureen Helm
c6d26bc524 zephyr: Upgrade to Zephyr v2.7.0.
Updates the Zephyr port build instructions and CI to use the latest
Zephyr release tag.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-01-06 14:09:39 +11:00
Maureen Helm
0cf03bd3b1 zephyr: Use CONFIG_USB_DEVICE_STACK for conditional USB device support.
CONFIG_USB was removed in Zephyr v2.7.0 after some Kconfig rework that
made it sufficient to use CONFIG_USB_DEVICE_STACK only.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-01-06 14:09:39 +11:00
Maureen Helm
1e5df0982a zephyr: Get UART console device from devicetree instead of Kconfig.
Updates the Zephyr port to get the UART console device from devicetree
instead of Kconfig. The Kconfig option CONFIG_UART_CONSOLE_ON_DEV_NAME
was removed in Zephyr v2.7.0.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-01-06 14:09:39 +11:00
Maureen Helm
080a9e906d zephyr: Update include path to reboot.h.
The reboot header was moved to a different path in Zephyr v2.6.0. The
old path was deprecated for two releases (v2.6.0 and v2.7.0) and will no
longer be supported after Zephyr v2.7.0.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-01-06 14:09:39 +11:00
Maureen Helm
ddbbfbed75 zephyr: Increase minimum CMake version to 3.20.0.
As a prerequisite to upgrading to Zephyr v2.7.0, upgrade the minimum
CMake version required for the Zephyr port to 3.20.0.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-01-06 14:09:39 +11:00
iabdalkader
908e4cf5c3 rp2: Add support for DHT11 and DHT22 sensors. 2022-01-06 14:00:03 +11:00
robert-hh
01d9b7adde rp2/machine_pwm: Keep duty value when changing the frequency.
The duty is saved and set whenever the frequency is changed, unless the
duty rate was not set yet.
2022-01-06 13:52:45 +11:00
robert-hh
9e56e630ca rp2/machine_pwm: Fix PWM frequency setting.
The top value was off by 1: in order to count n ticks it has to be set to
n-1.

Fixes issue #8122.
2022-01-06 13:51:19 +11:00
iabdalkader
f4487a0049 rp2/boards/ARDUINO_NANO_RP2040_CONNECT: Set default I2C pins. 2022-01-06 13:35:20 +11:00
Simon Baatz
79ae7098ca esp32/machine_bitstream: Fix signal duplication on output pins.
After changing the bitstream implementation to use the RMT driver in
commit 72d86158121e32bbabaeade08f449d507bf40f9a
("esp32/machine_bitstream.c: Replace with RMT-based driver."), using
multiple `Neopixel` instances shows signal duplication between the
instances (i.e. a `write()` on one instance is written to all instances).

On invocation, the rmt driver configures the GPIO matrix to route the
output signal to the respective GPIO pin.  When called for a different
`NeoPixel` instance using a different pin, the new route is established,
but the old route still exists.  Now, the RMT output signal is sent to both
pins.

Fix this by setting the standard GPIO output function for the current pin
after uninstalling the RMT driver.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
2022-01-06 13:21:37 +11:00
MikeTeachman
49d8ae3ecc esp32/machine_i2s: Add support for ESP-IDF 4.4.
- Add default values for I2S features added in ESP-IDF 4.4.
- Add workaround for bug introduced in ESP-IDF 4.4
  (https://github.com/espressif/esp-idf/issues/8121).
2022-01-06 13:10:38 +11:00
Chris Boudacoff
802ef271b8 mimxrt/hal: Allow readSampleClkSrc to be configured by a board.
Via the MICROPY_HW_FLASH_DQS flag.
2022-01-04 15:42:12 +11:00
stijn
3f16719888 windows/appveyor: Build both standard and dev variants.
This makes sure changes from previous related commits actually work.
2022-01-04 15:07:45 +11:00
stijn
7955734aca windows: Run tests via Makefile.
The application isn't necessarily called 'micropython' especially
not When using variants, i.e. the tests need to be ran using $(PROG).
2022-01-04 15:07:45 +11:00
Andrew Leech
05ed19e73e windows: Add support for build variants to windows port.
Following the unix port.

Support for building variants with msvc was done by @stinos.
2022-01-04 15:06:26 +11:00
Damien George
a29c70c9b4 esp8266: Allow building a board to any dest directory.
Signed-off-by: Damien George <damien@micropython.org>
2021-12-30 15:47:49 +11:00
iabdalkader
8af9dbbde1 stm32/network_wiznet5k: Fix build error with wiznet5k and lwip enabled.
Commit 4dba04a50f refactored the network code
but the combination of MICROPY_PY_WIZNET5K=5500 and MICROPY_PY_LWIP=1
broke.
2021-12-30 11:54:19 +11:00
Damien George
aac5a97d08 ports: Move '.frozen' to second entry in sys.path.
In commit 86ce442607 the '.frozen' entry was
added at the start of sys.path, to allow control over when frozen modules
are searched during import, and retain existing behaviour whereby frozen
was searched before the filesystem.

But Python semantics of sys.path require sys.path[0] to be the directory of
the currently executing script, or ''.

This commit moves the '.frozen' entry to second place in sys.path, so
sys.path[0] retains its correct value (described above).

Signed-off-by: Damien George <damien@micropython.org>
2021-12-29 23:55:36 +11:00
Jim Mussared
599b61c086 esp32/machine_bitstream: Replace bit-bang code with RMT-based driver.
This aims to solve glitching issues on long neopixel strips.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-22 12:04:13 +11:00
IhorNehrutsa
09fe80d091 esp32/machine_pwm: Keep duty constant when changing frequency.
Save and restore the same duty cycle when the frequency (or frequency
resolution) is changed.  This allows a smooth frequency change.

Also update the esp32 PWM quickref to be clearer.
2021-12-22 00:05:58 +11:00
IhorNehrutsa
4189c64869 esp32/modnetwork: Synchronize WiFi AUTH_xxx constants with IDF values. 2021-12-21 23:56:23 +11:00
Damien George
05bea70979 esp8266/etshal.h: Remove unneeded function declarations.
These removed ones are either unused by MicroPython or provided by osapi.h
in the SDK.  In particular ets_delay_us() has different signatures for
different versions of the SDK, so best to let it provide the declaration.

Fixes issue #8095.

Signed-off-by: Damien George <damien@micropython.org>
2021-12-21 14:37:16 +11:00
Matt Trentini
f2b5c99fde stm32/boards/OLIMEX_H407: Fix typo in OLIMEX H407 board.json.
Appears incorrectly as E407 in the download manager.
2021-12-20 12:32:46 +11:00