The STM32F429DISC board definition did not have DAC enabled, however the
micro/board supports it so this commit enables the feature.
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
Some boards like the nrf52840dk crash immediatelly after boot when
k_yield() is executed in this function. It also makes the REPL randomly
lock up on other boards like the nucleo_wb55rg.
Signed-off-by: danicampora <danicampora@gmail.com>
So that certain tests can be skipped when running on this target. These
thread tests do not pass because the zephyr port cannot create more than 4
threads at once.
Signed-off-by: Damien George <damien@micropython.org>
So that more tests can run successfully, and so users by default have more
heap for applications. Thin minimal configuration still has a 16k GC heap.
Signed-off-by: Damien George <damien@micropython.org>
All these features are enabled at the
`MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES` level, and are required to get
more of the thread tests passing.
Signed-off-by: danicampora <danicampora@gmail.com>
The standard Zephyr console implementation doesn't make use of
`tty_set_rx_timeout()` and therefore all the functions to receive
characters block indefinitely until data is received (including
`console_read()`).
This commit also releases the GIL where it applies, e.g. the REPL and the
time sleep functions.
Signed-off-by: danicampora <danicampora@gmail.com>
This commit implements the `_thread` module on the zephyr port.
Due to the fact that we are still using a rather old version of Zephyr,
`CONFIG_DYNAMIC_THREAD` is not available and therefore the stack for
threads cannot be allocated dynamically, only at compile time. So for the
time being and for the purpose of this commit, a maximum of 4 Zephyr
threads (besides the main thread) can be created. Once we manage to update
to the latest version of Zephyr this won't be a problem anymore.
Configuration for the nrf52840dk is added as part of this change, because
this board was used to test the threading support.
The Zephyr option `CONFIG_THREAD_CUSTOM_DATA` is used to enable threading
on a per board basis. The `thread.conf` file is added as a convenient way
to enable threading.
Signed-off-by: danicampora <danicampora@gmail.com>
Set the UF2 firmware images family to Microchip SAMD21 or SAMD51. This
helps tools such as file to identify built firmware.
Signed-off-by: Alexandre Iooss <erdnaxe@crans.org>
Do NOT use `mp_hal_delay_us()` for short delays. This was initially done
to make short delays precise, but it does not allow for scheduling. Leave
using `mp_hal_delay_us()` to user code if needed.
Signed-off-by: robert-hh <robert@hammelrath.com>
The upper 32 bit of the 64 bit ticks register was taken before disabling
the interrupts. That may have caused a wrong return values. Besides that,
the function may cause trouble when called in an IRQ context, because it
unconditionally enables IRQ.
Signed-off-by: robert-hh <robert@hammelrath.com>
Fixes a compile error if STM32 port is compiled with:
make BOARD=(..) MICROPY_PY_LWIP=1 MICROPY_PY_LWIP_SLIP=1
`sio_send()` and `sio_tryread()` now use `mp_get_stream`.
Signed-off-by: Carl Treudler <cjt@users.sf.net>
As reported in #14430 the Xtensa compiler can add R_XTENSA_ASM_EXPAND
relocation relaxation entries in object files, and they were not
supported by mpy_ld.
This commit adds handling for that entry, doing nothing with it, as it
is only of real use for an optimising linker.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
- Present the default build dependencies in one place at the top, and make
a separate section about building standalone.
- Add steps for the "minimal" variant as well.
- Document that building standalone requires autoconf and libtool.
- Allow MICROPY_STANDALONE to be set as an environment variable.
Fixes issue #11313.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
The printed type for stdio streams indicates "FileIO", which is a binary IO
stream. Stdio is not binary by design, and its printed type should
indicate a text stream. "TextIOWrapper" suits that purpose, and is used
by VfsPosix files.
Signed-off-by: timdechant <timdechant.git@gmail.com>
Currently both the qemu-arm and qemu-riscv ports share a lot of code and
functionality. This commit merges the qemu-riscv port into the qemu-arm
port. The only real differences between the two are the toolchains used to
build the code, and the initialisation/startup framework. Everything else
is pretty much the same, so this brings the following benefits:
- less code duplication
- less burden on maintenance
- generalised qemu port, could in the future support other architectures
A new board `VIRT_RV32` has been added to the qemu-arm port which is the
existing RISC-V board from the qemu-riscv port. To build it:
$ make BOARD=VIRT_RV32 repl
To cleanly separate the code for the different architectures, startup code
has been moved to ports/qemu-arm/mcu/<arch>/.
Signed-off-by: Damien George <damien@micropython.org>
Now that some ports support multiple architectures (eg esp32 has both
Xtensa and RISC-V CPUs) it's no longer possible to set mpy-cross flags
based on the target, eg `./run-tests.py --target esp32`. Instead this
commit makes it so the `-march=xxx` argument to mpy-cross is detected
automatically via evaluation of `sys.implementation._mpy`.
Signed-off-by: Damien George <damien@micropython.org>
Workaround for what appears to be an upstream issue:
https://github.com/espressif/esp-idf/issues/14456
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Regression introduced by 5e692d04 now at MICROPY_HW_USB_CDC is set.
The ARDUINO_NANO_ESP32 specifically builds shared/tinyusb/mp_usb_cdc.c
for the 1200bps reset behaviour. However MicroPython esp32 doesn't yet
use the rest of the shared/tinyusb functionality.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This fixes issue of ESP32-S3 switching its config over to USB serial/JTAG
instead of native USB.
The the existing logic was hard to follow, adding this config macro makes
it easier to see which USB is in use and to have board definitions that
enable/disable different USB levels.
This commit also drops (nominal) support for manually setting
CONFIG_ESP_CONSOLE_USB_CDC in sdkconfig. No included board configs use this
and it didn't seem to work (if secondary console was set to the default USB
Serial/JTAG then there is no serial output on any port, and if secondary
console was set to None then linking fails.) Can be re-added if there's a
use case for it.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Regression in 0a11832cd in IDF 5.0.x where macro
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED is not defined.
With this patch, ESP32-S3 still USB Serial/JTAG incorrectly (now on all
ESP-IDF versions).
Closes#15701
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Allows mpremote file transfer to work correctly when mpremote is used over
the ST-link USB/UART REPL port.
Fixes issue #8386.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This allows UART RX to function while flash erase/writes operations are
under way, preventing lost serial data so long as it fits in the UART RX
buffer.
This enables (among other things) mpremote to successfully copy files to
boards that use a UART REPL.
Enable via the following option placed in `mpconfigboard.mk`:
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This allows enabling lwIP debugging output. For example, to enable PPP
debugging add the following to `mpconfigboard.h`:
#define LWIP_DEBUG 1
#define PPP_DEBUG LWIP_DBG_ON
Signed-off-by: Damien George <damien@micropython.org>
When timeout=0 (non-blocking mode) the UART should still wait for each
character to go out. Otherwise non-blocking mode with CTS enabled is
useless because it can only write one character at a time.
Signed-off-by: Damien George <damien@micropython.org>