Commit graph

57580 commits

Author SHA1 Message Date
Neo Xu
ec9b079c04 arch/x86-64: fix cmake compile error
-- Configuring done
CMake Error at cmake/nuttx_add_library.cmake:142 (add_library):
  Cannot find source file:

    /vela/nuttx/libs/libc/machine/x86_64/arch_elf.c
Call Stack (most recent call first):
  libs/libc/CMakeLists.txt:22 (nuttx_add_kernel_library)

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-01-22 16:35:32 +08:00
Jukka Laitinen
c00b5862c7 arch/risc-v/src/mpfs/mpfs_ddr.c: Fix CA training verify step
Corrections to CA training verify step. The original copied from HSS didn't
make sense in all aspects:
- The check is not per lane, so it should be out of the "for (lane_sel" loop.
- The check wasn't proper. The expected outcome is just a vector of increasing numbers
  separated enough

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-01-22 16:32:06 +08:00
Jukka Laitinen
6ca6608dea arch/risc-v/src/mpfs/mpfs_ddr.c: Clean up the TXDLY verify step
Just verify that the delay for the selected clock != 0

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-01-22 16:32:06 +08:00
Jukka Laitinen
e8cc1d3c4f arch/risc-v/src/mpfs/mpfs_ddr.c: Add read dq/dqs eye centering test
After read training, check also that the eye is centered properly. Sometimes
after the training the width is long enough, but it is not centered.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-01-22 16:32:06 +08:00
Jukka Laitinen
f695fc6884 arch/risc-v/src/mpfs: Disable external interrupts on all SMP harts
Interrupts on MPFS platform are currently served on the hart, on
which the up_enable_irq was called.

Call to up_disable_irq may execute on different hart than on which
the up_enable_irq was executed. In this case the interrupt is not
disabled currently.

While there is nothing fancy (irq affinity control or such), an
easy way to fix this is to simply disable the irq on all harts.

This also changes the prototypes of mpfs_plic_get_iebase and
mpfs_plic_get_claimbase to get the hart id as an argument, in
order to accomplish this.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-01-22 15:30:32 +08:00
chao an
9db4d327fa sim/virtio: fix typo sim_rpmsg_vritio.c -> sim_rpmsg_virtio.c
Build Error:
CMake Error at arch/sim/src/sim/CMakeLists.txt:278 (target_sources):
  Cannot find source file:

    /home/archer/code/nuttx/n3/nuttx/arch/sim/src/sim/sim_rpmsg_vritio.c

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-22 15:28:13 +08:00
wangzhi16
bed3bd0852 Use small lock to protect resources related to irq in arch avr, hc, mips and or1k.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-22 15:27:30 +08:00
wangjianyu3
72d793b26e Documentation: Add usage of Wireshark for USB monitor
For: https://github.com/apache/nuttx/issues/15595
Ref: https://wiki.wireshark.org/CaptureSetup/USB

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-22 15:17:38 +08:00
YAMAMOTO Takashi
ab9522fd23 file_readv_compat: add a comment to explain limitations 2025-01-22 14:29:35 +08:00
chao an
0ffb0b716e drivers/iovec: revert vector io implement from loop/null/zero driver
basic driver does not need such complex wrapper

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-22 11:29:39 +08:00
wangmingrong1
5918335b7f armv8m: Default open hardware stack check
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-21 11:55:10 -03:00
Yanfeng Liu
1828d09b2a boards/qemu-armv7a: revises kernel build sample config
This adjusts `qemu-armv7a:knsh` with following changes:

- use smaller flash/memory so that `-m 1024` can be omitted.
- use ELF_EXECUTABLE for apps to allow easier app debugging.
- enable graceful shutdown from NSH command.
- enable more cases of ostest (e.g. vfork, pthread_exit etc).

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-21 19:50:09 +08:00
xuxingliang
dc3ab55e6d libc/gdbstub: avoid RLE decoding special characters
Read/write special data like 0x2a2a2a2a will trigger this issue.
The current GDB implementation has this flaw. GDB processes the RLE
decoding before espaping the data, make it impossible to repeate special
characters.

The details can be seen in GDB source code remote.c
remote_target::read_frame function.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-01-21 18:26:42 +08:00
xuxingliang
03765a6a1e libc/gdbstub: add memory binary read support
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-01-21 18:26:42 +08:00
xuxingliang
b1d0b5a4d6 libc/gdbstub: support binary data sent from stub
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-01-21 18:26:42 +08:00
Tim Kan(SSS)
4dd042d00b fix(libc): lib_strftime %F month number off-by-one
Corrects the month number output for the %F format specifier in lib_strftime.
2025-01-21 18:24:35 +08:00
chenwen@espressif.com
1fb09dbb7f xtensa/esp32s3: Fix wrong dummy length in mode register reading
1. Corresponding link: 54a9386b2e
2025-01-21 16:25:33 +08:00
Yanfeng Liu
4fa7ab87ed boards/qemu-armv7r: fix typo in comment
This fixes the typo imx_bringup as qemu_bringup to match function
name.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-21 16:25:05 +08:00
Huang Qi
de4135afdd Documentation: Update supported platforms for Rust guide
Summary:
Please refer to https://github.com/rust-lang/rust/pull/135757

- Updated the supported platforms list in the Rust guide to reflect that ARMv7-A and AArch64 are ready
- Removed the "WIP" (Work In Progress) label from ARMv7-A and AArch64 in the supported platforms section

Impact:
- Provides accurate information to developers about the current state of Rust support for ARMv7-A and AArch64 platforms
- Aligns the documentation with the latest developments in the Rust ecosystem
- No functional changes to the codebase, only documentation updates

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-21 10:59:08 +08:00
dongjiuzhu1
9711323208 Documentation/uorb: remove uncalibrated member
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-01-21 09:43:14 +08:00
Eren Terzioglu
33ebfe1a17 .github/ISSUE_TEMPLATE: Add host_info command section into bug report template 2025-01-21 09:11:17 +08:00
Matteo Golin
1d205e9ae2 sensors/mcp9600: Converted MCP9600 legacy driver to UORB driver as per suggestions on PR #15525. 2025-01-21 09:09:43 +08:00
xuxingliang
e5a7f55d9f libc/gdbstub: use rawsyslog for debug log
To avoid new line for every character.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-01-21 01:59:35 +08:00
xuxingliang
ef27bcb34f libc/gdbstub: fix typos
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-01-21 01:59:35 +08:00
paolo
11e3b8167c This patch fix mcp23x08 support. Issue #15592 2025-01-21 01:59:25 +08:00
Ville Juven
bb85ad849e pthread_cond_wait: Use atomic_t to protect the waiter count
The load/compare and RMW to wait_count need protection. Using atomic
operations should resolve both issues.

NOTE:
The assumption that the user will call pthread_cond_signal /
pthread_cond_broadcast with the mutex given to pthread_cond_wait held is
simply not true. It MAY hold it, but it is not forced. Thus, using the
user space lock for protecting the wait counter as well is not valid!

The pthread_cond_signal() or pthread_cond_broadcast() functions may be called by a thread whether or not it currently owns the mutex that threads calling pthread_cond_wait() or pthread_cond_timedwait() have associated with the condition variable during their waits; however, if predictable scheduling behaviour is required, then that mutex is locked by the thread calling pthread_cond_signal() or pthread_cond_broadcast().

[1] https://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_cond_signal.html
2025-01-20 23:55:26 +08:00
Ville Juven
1a9241ca1c pthread_barrier_destroy: Fix return value, if sem_getvalue fails
sem_getvalue returns ERROR and sets errno if it fails, we don't want to
return OK in this case, we want to return the non-negated error number.
2025-01-20 23:55:26 +08:00
Ville Juven
516d1c069a pthread_conddestroy: Fix return value, if sem_getvalue fails
sem_getvalue returns ERROR and sets errno if it fails, we don't want to
return OK in this case, we want to return the non-negated error number.
2025-01-20 23:55:26 +08:00
Ville Juven
c3b2910178 drivers/video/fb.c: Replace sem_getvalue with nxsem_getvalue
Because sem_getvalue modifies errno.
2025-01-20 23:55:26 +08:00
Ville Juven
ddd279d700 mpfs_i2c.c: Replace sem_getvalue with nxsem_getvalue
Because sem_getvalue modifies errno.
2025-01-20 23:55:26 +08:00
Xiang Xiao
92e884bee2 libc: Rename LIBC_STRING_OPTIMIZE to LIBC_NEWLIB_OPTSPEED
and correct the dependence

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-20 22:27:19 +08:00
wangzhi16
ecaddbb0aa Use small lock to protect resources related to timers in arch risc-v, xtensa and tricore.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-20 09:57:01 -03:00
lipengfei28
4b91d76869 warning: #include outside of 'Included Files' section
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
lipengfei28
656db16ff1 arch/tricore:use UP_DSB, UP_DMB, UP_ISB as barrier standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
lipengfei28
565b0e6eaf arch/ceva:use UP_DSB, UP_DMB, UP_ISB as barrier standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
lipengfei28
e39cb350f1 arch/x86_64:use UP_DSB, UP_DMB, UP_ISB as barrier standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
lipengfei28
6949c82310 arch/arm:use UP_DSB, UP_DMB, UP_ISB as barrier standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
lipengfei28
d3e3993682 arch/riscv: use UP_DSB, UP_DMB, UP_ISB as barrier standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
lipengfei28
82cf59bff5 arch/arm64: use UP_DSB, UP_DMB, UP_ISB as barrier standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
lipengfei28
2d1af01d44 mem barrier: use UP_DMP UP_DSP as barriers standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
Neo Xu
afe90db5c4 gdbstub: change send buffer to const char
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-01-20 20:07:13 +08:00
wangzhi16
8b5ea40a2b Use small lock to protect resources related to cpufifo.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-20 20:03:24 +08:00
dongjiuzhu1
e7f38fe6fa drivers/sensor: add new sensot type to align android sensor type
new sensor type:
SENSOR_TEMPERATURE
SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED
SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
SENSOR_TYPE_MAGNETIC_FILED_UNCALIBRATED

refs:
https://cs.android.com/android/_/android/platform/hardware/libhardware/+/
0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors-base.h

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-01-20 19:57:42 +08:00
chao an
0e1214d89a syslog/intbuffer: fix spinlock deadlock
just read the code, still have the deadlock after below change:

| commit 3b6f463ce2
| Author: chenrun1 <chenrun1@xiaomi.com>
| Date:   Tue Dec 31 14:31:46 2024 +0800
|
|     syslog_inbuffer:Fixed the lock reentry issue in single core + spinlock scenario
|
|     Summary:
|       When spinlock.h is enabled in a single-core scenario, spinlock reentry and exceptions may occur when spin_lock_irqsave_wo_note is used in syslog_add_intbuffer
|
|     Signed-off-by: chenrun1 <chenrun1@xiaomi.com>

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-20 17:42:40 +08:00
Huang Qi
685f3ab20c Documentation: Fix typo and list format in Rust guide
Summary:
- Fixed a typo in the Rust guide ("Pleae" -> "Please")
- Improved list formatting for better readability and consistency

Impact:
- Improves documentation quality and readability
- Ensures users have complete and accurate configuration information
- Maintains consistency with the actual requirements for Rust development in NuttX

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-20 17:41:52 +08:00
chenrun1
2375a55517 v9fs:add Documentation
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-20 17:12:14 +08:00
chenrun1
99a1f0dc65 inet_sockif:support multiple iov recv
Summary:
  Implement multiple iovlen recvmsg in inet_sockif, only TCP mode
  support at current.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-20 17:12:14 +08:00
Zhe Weng
87a7714103 net: Split msg_iovlen check in recvmsg into each protocol
To prepare for supporting multiple iov in each protocol.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-20 17:12:14 +08:00
chenrun1
4d17c353dd v9fs:socket driver
Summary:
  1.Add new api for socket parsing header - v9fs_parse_size
  2.Add socket driver for 9pfs

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-20 17:12:14 +08:00
wangzhi16
5f77da4c51 Use small lock to protect timer related resources in arch ARM.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-20 17:02:30 +08:00