Adapt the macOS AVFoundation backend for multi-device discovery,
camera index mapping and capture startup compatibility. This enables
reliable use of multiple cameras through the SIM camera framework.
Signed-off-by: Peter Bee <bijunda@bytedance.com>
Allow the SIM camera/V4L2 capture framework to manage multiple
imgdata instances with dynamic mounting. This avoids cross-talk
between camera streams when multiple devices are used.
Signed-off-by: Peter Bee <bijunda@bytedance.com>
The host interrupt callback was incorrectly using the wrong IRQ for
disconnected. In host mode the same IRQ is used for connect/disconnected
and it must check a status bit to know which one.
When a USB device was unplugged, the host channels were free'd,
but if they happen to be mid-transfer, that transfer was never cancelled
so the USB hardware might still be trying to perfrom a transfer after
was free'd. Fixed by cancelling any transfers on free.
Signed-off-by: daniellizewski <daniellizewski@geotab.com>
After recent changes on the event handler for the RISC-V-based
Espressif SoCs, the same set of changes were ported back to xtensa
devices.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
This commit enables the ethernet driver support on ESP32-P4 based
on a common-source implementation. This required a set of changes
regargind the event handler for the Wi-Fi driver (which is now
shared with the ethernet driver).
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
Use GPIO_MODE_INPUT for STM32F1 pinmap entries that are configured as
GPIO_INPUT instead of carrying GPIO_MODE_2MHz.
For STM32F1 the MODE field selects output speed only for output or
alternate-function output pins. stm32_configgpio() forces input pins to
input mode regardless of the encoded MODE bits.
From arch/arm/src/stm32/stm32_gpio.c:
311 /* Decode the mode and configuration */
312
313 regval = getreg32(cr);
314
315 if (input)
316 {
317 /* Input.. force mode = INPUT */
318
319 modecnf = 0;
320 }
321 else
322 {
323 /* Output or alternate function */
324
325 modecnf = (cfgset & GPIO_MODE_MASK) >> GPIO_MODE_SHIFT;
326 }
Signed-off-by: raiden00pl <raiden00@railab.me>
NuttX uses Quadrature Encoder lower half driver to internal QE from
MCUs and also with Magnetic Rotary Encoder sensors. But when the
STM32 QE is not enabled, the board code will try to compile the
stm32_qencoder.c because Magnetic Rotary Encoders enables the
CONFIG_SENSORS_QENCODER. This patch fixes this issue.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
The planar copy was used even when linar mode was used (chain4 = 1)
Probably this modification could impact VGA text mode, but for now
it is not important, since the goal is get graphic mode working.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
BREAKING: In an effort to simplify NuttX initialization, NSH_ARCHINIT is
removed. board_app_initialize is also removed. BOARD_LATE_INITIALIZE now
performs all board initialization logic, and is by default enabled. All
references to these symbols are removed. BOARDIOC_INIT remains, but will
result in -ENOTTY when called. It is to be removed in a later commit.
Quick fix: Boards relying on NSH_ARCHINIT should now enable
CONFIG_BOARD_LATE_INITIALIZE instead. If the application needs
fine-grained control over board initialization from userspace, the logic
performed by BOARDIOC_INIT may be copied to the board_finalinitialize
function and used instead via BOARDIOC_FINALINIT. All
board_app_initialize logic provided by NuttX is now moved to
board_late_initialize, and the same should be done for out-of-tree
boards.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
The register index layout for D16-D31 and FPU_CONTEXT_REGS was guarded
by CONFIG_ARM_HAVE_DPFPU32 (hardware capability) in three header files,
but all save/restore code in the corresponding .S files gates on
CONFIG_ARM_DPFPU32 (software enable).
These two macros are distinct:
CONFIG_ARM_HAVE_DPFPU32 - set by chip via 'select'; means hardware
has D16-D31 registers
CONFIG_ARM_DPFPU32 - user-selectable; means software has chosen
to use D16-D31 (requires hardware support)
When ARM_HAVE_DPFPU32=y and ARM_DPFPU32=n, the header defined
REG_FPSCR at offset 64 and FPU_CONTEXT_REGS=65, while the assembly
only saved S0-S31+FPSCR (33 words), placing FPSCR at offset 32.
This mismatch causes incorrect register access and wrong xcptcontext
sizing.
Signed-off-by: yaojiaqi <yaojiaqi@lixiang.com>
In esp_espnow_pktradio.c, after ESP-NOW is successfully initialized in espnow_ifup, call netdev_carrier_on(dev).
In espnow_ifdown, call netdev_carrier_off(dev).
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Create a bidirectional dshot lower-half driver, using the flexio block.
This driver enables use of DShot protocol for Electronic Speed Controllers
(ESCs) typically used in drone motor control.
Eight channels of DShot per flexio block are supported in:
- Normal mode in all DShot speeds, with telemetry request (uart response
needs to be handled outside of this driver)
- Bidirectional mode in all DShot speeds, with telemetry request & response
- Configurable to use either independent TX timers for each channel, or to
use a common TX timer for all channels to synchronize the output
- For bidirectional RX, each channel always uses an own timer.
In normal mode, the driver operates without any interrupts.
In bidirectional mode, the driver reconfigures the FlexIO timers (as needed)
and shifters from TX to RX in the interrupt handler, and reads out the
raw response packet.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This modify just modify the function to let the user that the function
failed to initialize the VGA mode.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
DLASTSGA needs to be offest for TCM backdoor address.
Cleanup as well using inline helper for calculuation.
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
Always allocate per-file can_reader on open so write-only descriptors get msgalign / ioctl state; free that context on close when it was never linked into cd_readers (fixes leak).
Cap each drain loop (20×500 ms) so close() cannot block forever when bxCAN retries without ACK or dev_txempty never clears.
Fix stm32can_vputreg debug log to print the written value (correct parameter name).
Signed-off-by: Alexey Matveev <tippet@yandex.ru>
The simulated time ratio feature introduced a host_set_timeratio()
call in sim_head.c, but the Windows host time implementation was
missing this symbol, causing a link error. Add a no-op stub since
the time ratio feature is not implemented on Windows.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
dispatch_walltime() expects a delta in nanoseconds from now, but the
previous code subtracted CLOCK_REALTIME from a CLOCK_MONOTONIC absolute
timestamp, which have different epochs and produce a meaningless result.
Fix by subtracting the current CLOCK_MONOTONIC absolute time to get the
correct remaining duration.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Add CONFIG_SIM_WALLTIME_RATIO Kconfig option and --sim-rt-ratio=
command-line argument to control the ratio of simulated time to
real time in percent. 100 means real-time (default), 200 means
simulated time advances twice as fast, 50 means half speed.
The implementation applies the ratio in host_gettime(), host_sleepuntil()
and host_settimer() so both SIM_WALLTIME_SLEEP and SIM_WALLTIME_SIGNAL
modes are supported.
This is inspired by the --rt-ratio feature in Zephyr's native_sim board.
Tested on sim:nsh with the following sleep test:
$ echo -e "sleep 2\nexit" | time ./nuttx
real 0m2.0xxs
$ echo -e "sleep 2\nexit" | time ./nuttx --sim-rt-ratio=200
real 0m1.0xxs
$ echo -e "sleep 2\nexit" | time ./nuttx --sim-rt-ratio=50
real 0m4.0xxs
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
In sporadic cases it is possible that a SPI exchange returns stale RX data from the DCACHE.
This occurs when:
- DCACHE is enabled
- DMA is used
The impact of this can be hard to debug and vanishes when the timing even changes minimally.
This is caused by the DCACHE being invalidated before the actual DMA transaction starts which violates
the recommendations from AN4839 and also does not match the implementation of other drivers on the STM32H7/STM32F7.
Fixed by invalidating the DCACHE right before the actual read, which matches the implementation
of the STM32F7 SPI driver.
Signed-off-by: alexcekay <alexander@auterion.com>
The PR #18654 removed the Kconfig option `RMT_LOOP_TEST_MODE` used
by Espressif's RMT peripheral. This commit reintroduces it as a
lower-half driver interface used to enable internal loopback tests.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
Enable USART3 support for STM32F412 and use it as the default NUCLEO-F412ZG nsh console path.
The ST-LINK virtual COM port on this board is wired to USART3 on PD8/PD9. Restore USART2 to its header-pin routing, switch the nsh defconfig to USART3, and update the board documentation to match the shipped solder-bridge configuration described in issue #17722.
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
- Moved the creation of the `nxtmpdir` folder for third-party packages to the root `CMakeLists.txt` file.
cmake/nuttx_3rdparty.cmake
- Add the nuttx_remove_nxtmpdir function to remove the third-party cache directory under nuttx/../nxtmpdir
Signed-off-by: simbit18 <simbit18@gmail.com>
- fix a "a label can only be part of a statement and
a declaration is not a statement" compile error.
- toolchain xtensa-esp32s3-elf-gcc
(crosstool-NG esp-2021r2) 8.4.0
Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
copy logic from arm64 to fix SMP bugs in the signal trampoline
caused signals to be lost or mis-delivered in ostest signest_test
on qemu-intel64/jumbo.
Also update comments so this logic is easier to follow
Signed-off-by: raiden00pl <raiden00@railab.me>
During startup we should avoid using _info since the system is not
fully initialized. Default to use ets_printf which is safe for
this scenario.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Fix lowercase -wl to correct -Wl for GCC linker pass-through
option in LTO full configuration. The lowercase form is not
recognized by the linker, causing --print-memory-usage to be
silently ignored.
Signed-off-by: v-yanxingyu <v-yanxingyu@xiaomi.com>
Increase image slot size from ~1MB to ~1.4MB to allow more features by default.
Solves issues when enabling debug features would extrapolate the slot size.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Fixed a few bugs in the initial stm32_usbdrdhost.c implementation
when using a USB hub. Fixed fault when freeing control endpoints.
Fixed crash when disconnecting devices from hubs due ot use after free.
Signed-off-by: daniellizewski <daniellizewski@geotab.com>
fix compilation error for CONFIG_SERIAL_TERMIOS=y
chip/stm32_serial_v2.c:923:35: error: 'struct up_dev_s' has no member named 'rxftcfg'
923 | regval |= USART_CR3_RXFTCFG(priv->rxftcfg);
Signed-off-by: raiden00pl <raiden00@railab.me>