summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-02drivers/cyw43: Use a different baudrate for BT firmware download.iabdalkader
Allow boards to define a specific firmware for Bluetooth firmware download, or none at all.
2023-03-01stm32/cyw43_configport: Fix build for boards without an RF switch.iabdalkader
Check if an RF switch is enabled before defining the RF switch pin.
2023-03-01extmod/network_cyw43: Use CYW43_CHANNEL_NONE for default arg in connect.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-03-01stm32: Add a default implementation of pyb.country.Jim Mussared
This is for boards without networking support so that the default boot.py continues to work. Also update boot.py to use network.country and network.hostname instead. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-03-01docs/library/network: Update docs for network.country, network.hostname.Jim Mussared
Also marks wlan.config(hostname) as deprecated. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-03-01stm32/boards: Update linker scripts now that big_const is gone.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-03-01stm32: Update to use the open-source lib version of cyw43-driver.Jim Mussared
This removes the previous WiFi driver from drivers/cyw43 (but leaves behind the BT driver), and makes the stm32 port (i.e. PYBD and Portenta) use the new "lib/cyw43-driver" open-source driver already in use by the rp2 port. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-03-01esp8266: Use extmod/modnetwork.c instead of port-specific version.Jim Mussared
Rather than duplicating the implementation of `network`, this allows ESP8266 to use the shared one in extmod. In particular this gains access to network.hostname and network.country. Other than adding these two methods, there is no other user-visible change. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-03-01esp32: Use extmod/modnetwork.c instead of port-specific version.Jim Mussared
Rather than duplicating the implementation of `network`, this allows ESP32 to use the shared one in extmod. In particular this gains access to network.hostname and network.country. Set default hostnames for various ESP32 boards. Other than adding these two methods and the change to the default hostname, there is no other user-visible change. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-03-01extmod/modnetwork: Allow more extensive port-specific customisation.Jim Mussared
This allows for a port (e.g. esp8266/esp32) to use extmod/modnetwork.c and provide the globals dict, rather than just a list of interfaces. When this is used, the default implementation of `network.route` and the NIC list is not enabled. Also splits out the LWIP-specific helpers from modnetwork.c into network_lwip.c. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-03-01extmod/modnetwork: Add network.hostname() and network.country().Jim Mussared
This provides a standard interface to setting the global networking config for all interfaces and interface types. For ports that already use either a static hostname (mimxrt, rp2) they will now use the configured value. The default is configured by the port (or optionally the board). For interfaces that previously supported .config(hostname), this is still supported but now implemented using the global network.hostname. Similarly, pyb.country and rp2.country are now deprecated, but the methods still exist (and forward to network.hostname). Because ESP32/ESP8266 do not use extmod/modnetwork.c they are not affected by this commit. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-02-27github/workflows: Bump actions/upload-artifact from 2 to 3.dependabot[bot]
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27github/workflows: Bump actions/checkout from 2 to 3.dependabot[bot]
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27github/workflows: Bump actions/setup-python from 1 to 4.dependabot[bot]
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 1 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v1...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27py/emitnative: Explicitly compare comparison ops in binary_op emitter.Pepijn de Vos
Without this it's possible to get a compiler error about the comparison always being true, because MP_BINARY_OP_LESS is 0. And it seems that gcc optimises these 6 equality comparisons into the same size machine code as before.
2023-02-24py/modmath: Fix two-argument math function domain check.Damien George
Prior to this fix, pow(1.5, inf) and pow(0.5, -inf) (among other things) would incorrectly raise a ValueError, because the result is inf with the first argument being finite. This commit fixes this by allowing the result to be infinite if the first or second (or both) argument is infinite. This fix doesn't affect the other three math functions that have two arguments: - atan2 never returns inf, so always fails isinf(ans) - copysign returns inf only if the first argument x is inf, so will never reach the isinf(y) check - fmod never returns inf, so always fails isinf(ans) Signed-off-by: Damien George <damien@micropython.org>
2023-02-24tools/pyboard.py: Use '/' exclusively when dealing with paths.Damien George
Currently, certain mpremote filesystem operations can fail on Windows due to a mixing of '/' and '\' for path separators. Eg if filesystem_command() is called with a destination that ends in / then dest.endswith(os.path.sep) will return False, which gives the wrong behaviour (it does end in a path separator). For similar reasons to 7e9a15966acf80ff50fdf5c52553dd56de164bb3, it's best to use '/' everywhere in pyboard.py and mpremote, because the target device understands only '/'. mpremote already does this, so the remaining place to fix it is in pyboard.y, to convert all incoming paths to use '/' instead of '\'. This effectively reverts 57fd66b80f8352e4859e6b71536b6083f9d7279c which tried to fix the problem in a different way. See also related 1f84440538a017e463aaad9686831ce9527122b5. Signed-off-by: Damien George <damien@micropython.org>
2023-02-24drivers/cyw43: Use board-defined BLE UART secondary baudrate.iabdalkader
The secondary baudrate was defined by boards but never used in this driver.
2023-02-24github/workflows: Add workflow to build mpremote wheel.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-02-24tools/mpremote: Use hatch to build mpremote package.Jim Mussared
This allows the entire configuration to be defined in a single file, including the logic for including pyboard.py and automatically versioning based on the git tag. Building the package works both via `python -m build` as well as `hatch build`. `python -m build ` has the advantage of automatically fetching all dependencies, you don't need to manually install any hatch packages. In order to make the versioning work, and also keep things simpler for end users, mpremote releases will now be the same as MicroPython releases and use the same tag. The version strings for mpremote will look like: - X.Y.Z -- clean build at the tag - X.Y.Z.postN+gHASH -- clean build, N revisions from the most recent tag - X.Y.Z.postN+gHASH.dYYYYMMDD -- dirty build, N revisions from out This commit extends on the idea from #8404. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-02-23stm32/Makefile: Clean up nested if-else to chained if-else-if.Damien George
Makefile's support "else ifdef", so use it to make the logic clearer. Also dedent some associated lines for consistency. Signed-off-by: Damien George <damien@micropython.org>
2023-02-23rp2/Makefile: Allow specifying BOARD_DIR on make command line.Jim Mussared
This matches the behavior of the makefile ports but implemented for CMake, making it easy to specify custom board definitions. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-02-23esp32/Makefile: Allow specifying BOARD_DIR on make command line.Jim Mussared
This matches the behavior of the makefile ports but implemented for CMake, making it easy to specify custom board definitions. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-02-23ports: Make BOARD default from BOARD_DIR in Makefile's.Jim Mussared
This allows: $ make BOARD_DIR=path/to/board to infer BOARD=board, rather than the previous behavior that required additionally setting BOARD explicitly. Also makes the same change for VARIANT_DIR -> VARIANT on Unix. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com> Signed-off-by: Damien George <damien@micropython.org>
2023-02-21samd/moduos: Add uos.urandom() using the phase-jitter rng.robert-hh
This RNG passes many of the Diehard tests and also the AIS31 test suite. The RNG is quite slow, delivering 200bytes/s. Tested on boards with and without a crystal.
2023-02-21samd/mcu: Set the SAMD21 us-counter to 2 MHz for better resolution.robert-hh
It turned out that the result of calling ticks_us() was always either odd or even, depending on some internal state during boot. So the us-counter was set to a 2 MHz input and the result shifted by 1. The counting period is still long enough, since internally a (now) 63 bit value is used for us.
2023-02-21samd/mcu: Implement a hardware seed for the SAMD21 random module.robert-hh
By using the phase jitter between the DFLL48M clock and the FDPLL96M clock. Even if both use the same reference source, they have a different jitter. SysTick is driven by FDPLL96M, the us counter by DFLL48M. As a random source, the us counter is read out on every SysTick and the value is used to accumulate a simple multiply, add and xor register. According to tests it creates about 30 bit random bit-flips per second. That mechanism will pass quite a few RNG tests, has a suitable frequency distribution and serves better than just the time after boot to seed the PRNG.
2023-02-21samd/mcu: Use the FDPLL96M clock for the SAMD21 CPU.robert-hh
Allowing to increase the clock a little bit to 54Mhz. Not much of a gain, but useful for generating a RNG entropy source from the jitter between DFLL48M and FDPLL96M.
2023-02-21samd/mcu: Rework the comments in clock_config.c.robert-hh
For more clarity. clock_config.c is not overly readable, so comments are important.
2023-02-21samd/boards: Clean up comments and some pins in pins.csv files.robert-hh
Remove two SPARKFUN_SAMD51_THINGS_PLUS pin definitions. There were definitions of TXD and RXD, but these pins do not exist on the board. They were only shown in the schematics. Also remove any reference to LED_. This is just a text change, no functional change.
2023-02-21extmod/modbtree: Move system includes within MICROPY_PY_BTREE guard.Damien George
Since commit d6d87225585a9494093d791c807bce652e4c82d8, modbtree.c is included unconditionally in the build (if SRC_EXTMOD_C is used). So guard the includes of system headers files in case a target doesn't have them. Signed-off-by: Damien George <damien@micropython.org>
2023-02-20tools/ci.sh: Add unix, stm32 and rp2 ports to code size check.Damien George
Now that the code-size-check CI action gives a nice report (as a comment) on the code size difference, it's possible to have a few more ports reported there. In this commit, unix, stm32 and rp2 are added. Unix represents non-MCU builds, and stm32 and rp2 represent ARM-based builds, for ports that have lots of features enabled. Signed-off-by: Damien George <damien@micropython.org>
2023-02-20minimal: Increase heap size for Linux builds.manobendro
Otherwise use of the REPL is quite limited. Fixes issue #10644.
2023-02-17samd: Add Pin.board and Pin.cpu classes to Pin.robert-hh
For compatibility with other ports. Code increase up to ~1250 bytes for SAMD21. The feature is configurable via MICROPY_PY_MACHINE_PIN_BOARD_CPU in case flash memory is tight.
2023-02-17mimxrt/Makefile: Move the FROZEN_MANIFEST setting after board config.robert-hh
Such that a respective statement in mpconfigboard.mk is executed first.
2023-02-17rp2/cyw43_configport: Specify the chipset firmware include file.Damien George
Required by the latest version of cyw43-driver. Signed-off-by: Damien George <damien@micropython.org>
2023-02-17lib/pico-sdk: Update to version 1.5.0.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-02-17lib/cyw43-driver: Update driver to latest version.Damien George
Changes since the previous version: - add an API to get the BSSID - support auto channel selection when using BSSID for join - improve performance for the Murata 1DX module and SDIO - return EINVAL for invalid auth type - add support for Bluetooth over SPI - convert 4343WA1-7.45.98.50.combined to C header files
2023-02-17rp2/mpconfigport: Enable os.dupterm and hashlib.sha1 on all boards.Damien George
This further aligns the features available on Pico and Pico W boards. os.dupterm is generally useful, but can still be disabled by a board if needed. hashlib.sha1 requires mbedtls for the implementation, but that's always available (due to ucryptolib's requirements). The entire hashlib module can still be disabled by an individual board if needed. Fixes issue #7881. Signed-off-by: Damien George <damien@micropython.org>
2023-02-17tools/ci.sh: Install pkg-config for macos builds.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-02-17github/workflows: Add "shared/**" to list of paths that trigger CI.Damien George
All ports use code from shared/ so should rebuild when it changes. Signed-off-by: Damien George <damien@micropython.org>
2023-02-17shared/runtime/softtimer: Fix ticks range when computing ticks diff.Jim Mussared
The previous computation incorrectly assumed that the uint32_t ticks counter MICROPY_SOFT_TIMER_TICKS_MS was in the range [0,0x80000000) where its actually [0,0xffffffff]. This means the diff calculation can be simplified compared to the original implementation copied from utime_mphal.c, which has to deal with a ticks range constrained by the small int range. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-02-16shared/runtime/softtimer: Use consistently the same clock source.robert-hh
Before, both uwTick and mp_hal_ticks_ms() were used as clock source. That assumes, that these two are synchronous and start with the same value, which may be not the case for all ports. If the lag between uwTick and mp_hal_ticks_ms() is larger than the timer interval, the timer would either rush up until the times are synchronous, or not start until uwTick wraps over. As suggested by @dpgeorge, MICROPY_SOFT_TIMER_TICKS_MS is now used in softtimer.c, which has to be defined in a port's mpconfigport.h with the variable that holds the SysTick counter. Note that it's not possible to switch everything in softtimer.c to use mp_hal_ticks_ms() because the logic in SysTick_Handler that schedules soft_timer_handler() uses (eg on mimxrt) the uwTick variable directly (named systick_ms there), and mp_hal_ticks_ms() uses a different source timer. Thus it is made fully configurable.
2023-02-16nrf/Makefile: Add support for BOSSAC flasher.iabdalkader
Used by Arduino boards.
2023-02-16stm32/boards/ARDUINO_PORTENTA_H7: Use default aioble.Jim Mussared
The default now includes all sub-components (security, l2cap, etc) and using the kwarg options is no longer supported. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-02-16rp2/boards/ARDUINO_NANO_RP2040_CONNECT: Use default aioble.Jim Mussared
The default now includes all sub-components (security, l2cap, etc) and using the kwarg options is no longer supported. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-02-16stm32/boards/ARDUINO_PORTENTA_H7: Fix macro value check for QSPI.iabdalkader
QSPI deepsleep should be enabled only when the internal flash storage is not used.
2023-02-16stm32/boards/STM32F769DISC: Fix building with USE_QSPI_XIP=1.Andrew Leech
Signed-off-by: Damien George <damien@micropython.org>
2023-02-16tests/float: Make output of math function tests more readable.Damien George
By explicitly naming the function, its arguments, and result. Signed-off-by: Damien George <damien@micropython.org>
2023-02-16tests/float: Add domain checks for log and also -inf.Damien George
Signed-off-by: Damien George <damien@micropython.org>