The sim_bthcisock_interrupt() handler for Bluetooth HCI sockets in the simulatorwas using
an if statement to check for available data on the HCI socket. Thismeant that only a single
packet would be read and processed per interrupt trigger,even if multiple packets were waiting
in the socket buffer.
This led to incomplete data processing: unread packets would remain in the bufferuntil the next
interrupt tick, causing delayed handling of Bluetooth HCI events/commands,packet backlogs,
or missed data in high-throughput scenarios.
This fix replaces the if with a while loop to:
1. Continuously check for and read available data from the HCI socket until no more
packets are present in the buffer.
2. Ensure all pending HCI packets are processed in a single interrupt handler invocation.
3. Eliminate packet backlogs and reduce latency in Bluetooth HCI communication.
The change maintains the same core data reception logic (bthcisock_receive()) butensures it runs
for all available packets, improving the reliability and responsivenessof the simulator's Bluetooth HCI socket implementation.
Signed-off-by: chao an <anchao.archer@bytedance.com>
Changes the default value for CONFIG_BOARD_LOOPSPERMSEC to -1, which is
invalid. All boards that forget to configure this value will encounter a
static assertion at compile time, enforcing that configurations
upstreamed to NuttX have calibrated values for correct delay timings.
Boards which implement ALARM_ARCH or TIMER_ARCH do not rely on the
busy-loop delay implementation and thus only have a run-time check to
ensure proper delay-timings (in the case where delays are used before
the alarm/timer driver is registered).
Some boards already in the NuttX upstream do not have calibrated values,
but there are no users who currently own the board to submit a
calibrated value for the configurations to use. In this scenario, the
value is temporarily set to 0 and a warning is displayed so that users
of these boards are informed of the calibration process.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
When using a key that is longer than the block size of the hashing
algorithm used, the key must be hashed before it is used.
Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
Mainline Linux doesn't use data encapsuation or flow control in its
tty_rpmsg driver. Create a NuttX counterpart which matches this
implementation.
This driver uses the static "rpmsg-tty" name to connect with the
remote service.
Signed-off-by: Maarten Zanders <maarten@zanders.be>
- Fix byte count calculation for 16-bit SPI words
using shift-by-1 instead of shift-by-2
- Use word count instead of byte count for DMA
iteration config on both RX and TX channels
Signed-off-by: Atsunori Saito <sai@yedo.com>
This is the nominal speed according to the TRM, and using higher
root clock gives more frequency selections (possible dividers) for
the SD card clock configuration.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
- Change the board's sd-card speed configuration to just specify the wanted frequency
- Calculate the proper divisors in the driver
- If the sd card frequency exceeds 25 MHz, set the card to high-speed mode
This makes it easier to adjust the operating speed of the sd cards and fixes an error
where cards are being operated in standard mode at over 25MHz speeds. If the speed
is higher than 25MHz, the card needs to be set into high-speed mode.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
All combinations of CONFIG_IMX9_USDHC_DMA and CONFIG_ARM64_DCACHE_DISABLE
are valid. Only the required alignment of the DMA buffers are different,
If the cache is enabled, cacle-line aligned buffers need to be used.
Otherwise, the USDHC DMA alignment requirement is just 32-bits.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Intermediate files of make depend like .ddc and .dds may remain
when make is interrupted. Remove them using make distclean.
Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
Add explicit spin_lock_init in tricore_systimer_initialize() for the lock used by tricore systimer.
Signed-off-by: Haokun Dong <donghaokun@lixiang.com>
Fix three issues in the STM32H7 FDCAN SocketCAN driver:
1. Clock configuration: Allow board.h to override STM32_FDCANCLK.
Previously the driver hardcoded STM32_HSE_FREQUENCY, ignoring
any board-specific clock configuration.
2. ILS register bug: Fix putreg32 call that was writing FDCAN_ILS_TCL
constant instead of the computed regval, causing interrupt routing
issues.
3. Extended ID filter size: Increase n_extid from 64 to 128. Despite
the reference manual (RM0433) suggesting 64 max, testing shows
that 128 is required for reliable extended ID frame reception.
With 64, some extended ID frames were silently dropped.
Signed-off-by: Vinicius May <vmay.sweden@gmail.com>
With CONFIG_PAGING enabled and the RISC-V SV39 MMU active, the page fault
handler incorrectly tracked page table levels: `ptprev` pointed to the L1
page table while `ptlevel` indicated L2. This inconsistency caused faulty
virtual address resolution.
This commit fixes the traversal logic to ensure consistent level tracking
across all three page table levels (L1–L3), enabling reliable page fault
handling and on-demand paging.
Additional changes:
- Set PGT_L3_SIZE to 2048 to enable mapping up to 8MB of address space.
- Update knsh_paging config to avoid crashes caused by excessive memory
alignment requirements.
- Add knsh64_paging config to verify this commit works as expected.
Signed-off-by: liang.huang <liang.huang@houmo.ai>
Delete the specified --config, clang can automatically find the library file through the set -march, -mcpu, and -mfpu
Otherwise, different versions of clang support different special cfg settings.
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
Include nuttx/kmalloc.h in arm64_arch_timer.c to fix missing header
dependency. This ensures proper memory allocation functions are
available for the architecture timer implementation.
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
Replace CONFIG_SYSTEM_TIME64 conditional atomic64 operations with a unified
seqlock-based approach for managing the system tick counter. This simplifies
code by eliminating architecture-specific branches and provides more robust
thread-safe access patterns.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This change enables performance monitoring unit (PMU) access from userspace
on ARMv7-R architecture by adding CONFIG_ARCH_HAVE_PERF_EVENTS_USER_ACCESS
support and building PMU code for userspace when needed.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
The benefits of doing this are:
1. It makes the code logic clearer, with different resources protected by different locks.
2. It improves system responsiveness and avoids contention issues caused by acquiring the same large lock.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
Replace critical_section with spinlock.
The benefits of doing this are:
1. It makes the code logic clearer, with different resources protected by different locks.
2. It improves system responsiveness and avoids contention issues caused by acquiring the same large lock.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
The benefits of doing this are:
1. It makes the code logic clearer, with different resources protected by different locks.
2. It improves system responsiveness and avoids contention issues caused by acquiring the same large lock.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
Replace critical_section with spinlock or mutex.
The benefits of doing this are:
1. It makes the code logic clearer, with different resources protected by different locks.
2. It improves system responsiveness and avoids contention issues caused by acquiring the same large lock.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
since the judgment for network card selection was changed from IS_UP to
IS_RUNNING, drivers that lack carrier_on need to add the carrier_on
operation; otherwise, network access issues will occur.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
<nuttx/irq.h> will use the macros defined in <arch/chip/irq.h>, so the include order should be after it
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
Currently, the SCTLR register is only used to switch the thread MTE state and has no other uses. Because saving this register is special, it will take a long time after testing, so the default saving behavior is deleted.
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
Refactor heap pointer storage by moving us_heap field from userspace_s
to the nested userspace_data_s structure, enabling future extensibility
of user-space data without modifying the core userspace_s interface across
all board-specific implementations.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
INT32_C(x) is currently defined as x ## ll on Xtensa, which
produces a long long int constant. However, int32_t is
defined as long int on this architecture.
This mismatch can break C++ template overload resolution
and causes build failures in downstream projects such as PX4.
Fix the macro by using x ## l so INT32_C expands to the same
underlying type as int32_t.
Signed-off-by: Adwait Godbole <adwaitngodbole@gmail.com>
Fix a compilation error in stm32f10xxf30xx_flash.c where the variable
`page` is used without being declared in up_progmem_write().
The issue appears when STM32_FLASH_DUAL_BANK is enabled.
The page is now derived locally from the flash base address and
page size macros, avoiding any dependency on PROGMEM helpers when
selecting the flash bank.
Signed-off-by: Adwait Godbole <adwaitngodbole@gmail.com>
Move the board-specific phy initialization from early boot into ifup phase. The
board specific phy initialization may need to implement delays, or bus
communication, for example via i2c bus.
These OS services are not necessarily available yet in arm64_netinitialize, and
PHY initialization is not necessary until the driver actually starts using it.
In addition, this allows the board to reset the ethernet phy at every ifup,
if needed for error recover.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
The function is for any ethernet interface, given as paramter to the function,
it is not for ENET1 only. The correct name is already used
in the code, but the Kconfig had it wrong.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>