The ESP-IDF WiFi interface wrapper always calls `xSemaphoreTakeRecursive` and `xSemaphoreGiveRecursive` for mutexes, regardless of whether they are recursive or not. Instead of an `assert`, the fix now also checks the type of the mutex in the functions for recursive mutexes and then calls the functions for normal mutexes if the mutex is not recursive.
On a setup I have on my desk I can reliably get the I2C bus stuck. But
the current unstuck logic will not get it unstuck. Adding a full reset
of the SERCOM does fix the issue, though.
Co-authored-by: crasbe <crasbe@gmail.com>
The `setcontext()` implementation of glibc does restore the signal
mask to the target thread during the switch, libucontext [does not][1]
[1]: https://man.archlinux.org/man/libucontext.3.en#CAVEATS
Instead, we just manually enable signals again just before the call
to `setcontext()`.
With this, tests like `tests/core/mutex_canel` or `tests/core/irq` now
pass on `native64` when using libucontext.
Co-authored-by: crasbe <crasbe@gmail.com>
With this, running `make RIOT_USE_PYCORTEXMDEBUG=1 debug` for any STM32F7
based boards will directly load the correct SVD file.
Co-authored-by: crasbe <crasbe@gmail.com>
This allows I2C emulation on native architecture in the same way than
periph_gpio_mock.
All I2C functions from this driver are set as weak to be easily
overridden in each application.
Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
Fix duplicate GPIO mode values on native platform when using Linux
kernel 5.5 or later. The kernel renamed GPIOHANDLE_REQUEST_PULL_* flags
to GPIOHANDLE_REQUEST_BIAS_PULL_* in version 5.5.
Without this fix, both GPIO_IN_PU and GPIO_OD_PU would have the same
fallback value (0xFF), causing compilation errors in switch statements.
Error: "duplicate case value"
Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
XTIMER_BACKOFF and XTIMER_ISR_BACKOFF were defined in periph_conf.h
since 2016 for the legacy xtimer module, which required high backoff
values (200) on native to prevent timer underflow issues.
However, since the migration to ztimer, all code now uses
MODULE_ZTIMER_XTIMER_COMPAT which includes ztimer/xtimer_compat.h
before periph_conf.h. This means xtimer_compat.h always defines
XTIMER_BACKOFF=1 first, and the periph_conf.h definitions are never
used.
Remove these unused definitions as they serve no purpose with the
current ztimer-based implementation.
Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
When not using the Rust version of Git-Cache, the build
system clones the full NRFX repository which led to errors during
the build process due to duplicated headers and headers not
found where they were expected.
The STM32F3 requires a dedicated digital signal to emulate a disconnect
event by pulling D+ down via a 1.5 kOhm resistor. Some boards, such as
the OLIMEXINO-STM32F3, do not directly connect a GPIO but place a
transistor in between. Depending on the exact implementation, the logic
level may end up being inverted compared to directly connecting a
GPIO.
This adds a flag member to the `stm32_usbdev_fs_config_t` and a new flag
to indicate inverted logic. In addition the members in the struct are
sorted by alignment, as this is a foolproof algorithm to prevent wasting
memory on unneeded padding.
Finally, the USB driver is adapted to honor the flag.
Co-authored-by: crasbe <crasbe@gmail.com>