Commit graph

60363 commits

Author SHA1 Message Date
wangjinjing1
7b528d903c net/can: fix compile error
variable "conn" not define if CONFIG_NET_SEND_BUFSIZE > 0

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-25 10:04:42 +08:00
zhanghongyu
31e0ec8a39 net/can: fix the typo
Otherwise, we can only manually enable NET_WRITE_BUFFERS

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-25 10:04:42 +08:00
zhanghongyu
ac3a7da8ed sim_netdriver: add addmac/rmmac support
Avoid PACKET_ADD_MEMBERSHIP calls returning errors.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-25 10:01:43 +08:00
zhanghongyu
1fd47357f7 net/packet: add PACKET_<ADD|DROP>_MEMBERSHIP support
Some third-party network libraries use PACKET_ADD_MEMBERSHIP to add MAC
addresses to devices, and this patch can add support for this.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-25 10:01:43 +08:00
wangchen
f03e4774a4 igmp_msg.c:mod check of IGMP_SCHEDMSG from assert to error log
Setting group->flags to IGMP_SCHEDMSG is a possible outcome, not unacceptable. If it occurs, an error log message will be reported

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-25 09:58:14 +08:00
wangchen
f10fc888fe net/tcp:resolve reconnection issues when connection failed due to rejection
After first connection refused happend,The user use the same connection failed,becasue the tcpstateflags is not TCP_ALLOCATED

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-25 09:56:09 +08:00
zhanghongyu
aba8cd4d86 net/net_initialize: remove the empty functions that are not needed
streamline the code structure

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-25 09:50:40 +08:00
chenzihan1
43b16fdb7c libc/search: add foreach api for hcreate_data
add foreach api for hash table

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-12-25 09:39:03 +08:00
yezhonghui
ba681d3ddf sim_uart: used wd timer to process transmit
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
276095dc77 sim_rptun: used wd timer to process transmit
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
aeda575c5b sim_hcisock: used wd timer to process transmit
used wdt thread to process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
93bf613505 sim/loop: delete sim loop theads at bringup
wdt thread replace sim loop thread

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
0e6afae4f2 usbhost: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
bb304441db foc: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
a536ea8569 usbdev: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
e2ca205f12 camera: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
954122641a audio: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
bbcf8fe30b usrsock: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
c594616e99 netdriver: used wd timer to process netdata
used wdt thread to process loop event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
c385d74669 lcd/fb: sim used wd timer to process loop event
used wdt thread to process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
6b1f484bbd input: change wd timer to precoss input device event
used wdt threads process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
gaohedong
7f9d3a055b tasking: remove no use remove excess code
Remove excess code, and add return value for function

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-24 20:09:05 +08:00
guohao15
081ff15254 Revert "romfs:extend romfs to enable write"
This reverts commit ac6fff747a7a6122e61de373350148331a94692f.
This reverts commit c83e3f651b967c64b5652a6bd2e96bcae48417b4.
This reverts commit 133db24d072457331134b683ad7b84c8a002feb9.
This reverts commit 5c1248ec38964e7886b23e65f732241c5d870d69.
This reverts commit 2cc850b6dcbad904282f1a326f52bff054251591.
This reverts commit 49cad84508e7db903068180fe4ebdfaef335efac.

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2025-12-24 07:41:28 -03:00
zhangshuai39
994a786336 netlib: Introduction to IP conflict detection functions
The documentation includes descriptions of the IP conflict function's prototype, parameters, and return value.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-24 16:53:13 +08:00
zhangshuai39
9a75fc2162 netpkt: Introduction to using netpkt example
The introduction includes an overview, the configuration items that need to be enabled, and how to use them.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-24 16:50:27 +08:00
ouyangxiangzhen
2dc2b30a6a sched/wdog: Simplify the code and correct the critical_section.
This commmit simplified the code and correct the critical_section.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-24 16:46:16 +08:00
jiangtao16
c5814ac910 sched/wdog: compatible with MISRA-C
This commit fixed the MISRA C-2004 violation rule 11.1, 10.4 and more.

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-24 16:46:16 +08:00
ouyangxiangzhen
6b63a81f54 sched/wdog: Simplify wd_timer to reduce WCET.
This commit simplified wd_timer() to reduce WCET when `noswitches` is false.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-24 16:46:16 +08:00
ouyangxiangzhen
43e0c50aa7 sched/wdog: Revert the spin-lock to big-kernel-lock (enter_critical_section).
If the wdog use the fine-grained spin-lock, and allow the callback execution without the lock held, there will be incorrect interleaving.
E.g. The first `nxsem_timeout` callback function caused the second semaphore wait to fail.

    Core 0 [nxsem_clockwait]       |  Core 1
    enter_critical_section()       |  ...
    wd_start(nxsem_timeout)        |  ...
    nxsem_wait(sem)                |  wd_expiration() --> nxsem_timeout
    wd_cancel(&rtcb->waitdog)      |  try enter_critical_section()
    leave_critical_section()       |  Failed retry...
    ....nxsem_clockwait            |  Failed retry...
    enter_critical_section()       |   Failed retry...
    wd_start(nxsem_timeout)        |  Failed retry...
    nxsem_wait(sem)                |  Core 1 enter the critical section
                                   |  nxsem_wait_irq(wtcb, ETIMEDOUT) -> incorrectly wake-up the rtcb.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-24 16:46:16 +08:00
ouyangxiangzhen
164b075d3f sched/wdog: Remove workaround for wdog latency.
This commit removed the workaround for wdog latency.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-24 16:46:16 +08:00
ouyangxiangzhen
476e02c7e0 sched/wdog: Faster wdog deleting.
This commit reduced 1 write operation for wdog deleting and decoupled
the WDOG_ISACTIVE with the list implementation.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-24 16:46:16 +08:00
ouyangxiangzhen
694dfc7a0c sched/wdog: Remove wd_recover.
This commit Removed wd_recover.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-24 16:46:16 +08:00
anjiahao
28298b9d5e armv-m/syscall:use cfi to debug syscall
armv8m:use ip save pc
armv7m:use ip save pc, r11 save sp

nsh_main backtrace before:
```
0  nxsem_wait_slow (sem=0x10001e0 <g_uart0port+32>) at semaphore/sem_wait.c:202
1  0x0000882c in nxsem_wait (sem=0x10001e0 <g_uart0port+32>) at semaphore/sem_wait.c:270
2  0x0000e7e2 in uart_read (filep=0x608037d4, buffer=0x60c013eb " h\024\300`", buflen=1)
   at serial/serial.c:1203
3  0x0001aad4 in file_readv_compat (filep=0x608037d4, uio=0x60c01344) at vfs/fs_read.c:81
4  0x0001abae in file_readv (filep=0x608037d4, uio=0x60c01344) at vfs/fs_read.c:165
5  0x0001ac2e in nx_readv (fd=0, iov=0x60c01388, iovcnt=1) at vfs/fs_read.c:256
6  0x0001ac84 in readv (fd=0, iov=0x60c01388, iovcnt=1) at vfs/fs_read.c:318
7  0x0001acca in read (fd=0, buf=0x60c013eb, nbytes=1) at vfs/fs_read.c:352
8  0x000100ea in STUB_read (nbr=56, parm1=0, parm2=1623200747, parm3=1) at stubs/STUB_read.c:9
9  0x000014d2 in dispatch_syscall () at armv8-m/arm_svcall.c:82
```

nsh_main backtrace after:

```
0  nxsem_wait_slow (sem=0x10001f0 <g_uart0port+32>) at semaphore/sem_wait.c:202
1  0x000088c0 in nxsem_wait (sem=0x10001f0 <g_uart0port+32>) at semaphore/sem_wait.c:270
2  0x0000e882 in uart_read (filep=0x6080380c, buffer=0x60c013eb " h\024\300`", buflen=1)
   at serial/serial.c:1203
3  0x0001ab74 in file_readv_compat (filep=0x6080380c, uio=0x60c01344) at vfs/fs_read.c:81
4  0x0001ac4e in file_readv (filep=0x6080380c, uio=0x60c01344) at vfs/fs_read.c:165
5  0x0001acce in nx_readv (fd=0, iov=0x60c01388, iovcnt=1) at vfs/fs_read.c:256
6  0x0001ad24 in readv (fd=0, iov=0x60c01388, iovcnt=1) at vfs/fs_read.c:318
7  0x0001ad6a in read (fd=0, buf=0x60c013eb, nbytes=1) at vfs/fs_read.c:352
8  0x0001018a in STUB_read (nbr=56, parm1=0, parm2=1623200747, parm3=1) at stubs/STUB_read.c:9
9  0x00001ece in dispatch_syscall () at armv8-m/arm_dispatch_syscall.S:111
10 0x2000a874 in read (parm1=0, parm2=0x60c013eb, parm3=1) at proxies/PROXY_read.c:9
11 0x20001152 in readline_getc (vtbl=0x60c01468) at readline_fd.c:73
12 0x20003994 in readline_common (vtbl=0x60c01468, buf=0x60c017f8 "\n", buflen=80)
   at readline_common.c:513
13 0x200012ec in readline_fd (buf=0x60c017f8 "\n", buflen=80, infd=0, outfd=1) at readline_fd.c:236
14 0x200010a8 in nsh_session (pstate=0x60c01540, login=1, argc=1, argv=0x60c00548)
   at nsh_session.c:229
15 0x20000eb0 in nsh_consolemain (argc=1, argv=0x60c00548) at nsh_consolemain.c:75
16 0x20000e4c in nsh_main (argc=1, argv=0x60c00548) at nsh_main.c:74
17 0x20000062 in nxtask_startup (entrypt=0x20000e11 <nsh_main>, argc=1, argv=0x60c00548)
   at sched/task_startup.c:72
18 0x00009ac4 in nxtask_start () at task/task_start.c:106
19 0x60c00548 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
```

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-24 09:49:52 +08:00
rongyichang
3d0f6fcbad boards/risc-v: Add lvgl64_vector configuration for RISC-V QEMU
Add new RISC-V 64-bit QEMU configuration with:
- 64-bit RISC-V (RV64) architecture support
- RISC-V Vector Extension (RVV/V-extension) enabled
- LVGL graphics framework integration
- VirtIO GPU and input device support
- NSH shell with built-in applications

This configuration enables developers to build and test LVGL graphical
applications on 64-bit RISC-V targets with Vector extension support,
providing a foundation for future SIMD optimization work.

Includes:
- defconfig: Complete configuration file with all necessary options
- Updated index.rst: Build and run instructions with QEMU launch command

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-12-24 09:44:01 +08:00
guohao15
029a5f5383 node/driver: make SIZEOF_NOTE_START return the right size
The value returned by sizeof(struct note_start_s) is larger
than the actual memory footprint of struct note_start_s.

This causes the length calculated in sched_note_start to be larger
than the actual memory size,which further leads to out-of-bounds reads in note_common.

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2025-12-23 11:26:24 -05:00
Luchian Mihai
172dd3959a docs/guides/lwl: move lwl's README.txt to lwl.rst
This PR moves the lwl's READEME.txt file to Documentation/guides/lwl.rst

Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
2025-12-23 15:20:06 +01:00
zhangshuai39
8198d6992c defconfig: Change the default gateway address
Ensure the default IP address and default gateway address are in the same network segment.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-23 15:18:23 +01:00
wangchen
fac6c2a82c loopback:setting loopback network driver sending task to the HPWORK queue
The loopback network driver sending task is placed in the LPWORK queue, which may result in delayed scheduling when the CPU usage reaches 100%, leading to the timely sending of cached messages from the loopback network driver and causing issues with post waitsem being too late​.we decied to set loopback sending task to the HPWORK queue.

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-23 09:27:20 -03:00
zhengyu9
491ce83508 drivers/mtd: add MTDIOC_ISBAD ioctl
add an ioctl item MTDIOC_ISBAD
used for flashtool command to check bad blocks

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2025-12-23 09:26:34 -03:00
zhanghongyu
37381a9e7d net/pkt: add SOCK_DGRAM support
According to the definitions of PF_PACKET and SOCK_DGRAM,
extend the current protocol stack pkt protocol to support SOCK_DGRAM mode.

Some third-party network libraries use AF_PACKET, SOCK_DGRAM type sockets
to construct packets and send/receive data, This patch can add support
for this.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-23 09:21:18 -03:00
wangchen
07247be9f6 wifi_sim.c:resolve issue in wapi save_config & wapi reconnect command
resolve issue in wapi save_config & wapi reconnect command in qemu

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-23 09:06:11 -03:00
wangchen
d59cf4a91c sim_wifidriver.c:resolve issue in wapi save_config & wapi reconnect command
resolove issue wapi save_config & wapi reconnect command in sim

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-23 09:06:11 -03:00
zhengyu16
2b30ab2d0c Documentation: add flashtool utility
Add documentation for flashtool utility.

Signed-off-by: zhengyu16 <zhengyu16@xiaomi.com>
2025-12-23 08:48:26 -03:00
Alin Jerpelea
b5cb1f65a5 Documentation: add NuttX-12.12.0 release notes
Add release notes for 12.12.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-12-23 18:35:17 +08:00
guohao15
fe7201245b tmpfs:fix memoryleak of tmpfs_opendir
fix the memory leak in tmpfs_opendir

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2025-12-22 11:02:10 -05:00
wangchen
0d1eb67f20 pkt: Fix DHCP transmission failure by updating d_sndlen/d_len lengths
on some device, the wifi driver uses dev->d_len as the length of the sent packet. However, due to the lack of update in d_len, the sent packet is not considered a normal packet and is not processed by the other end

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-22 21:27:06 +08:00
ouyangxiangzhen
b5eae7d774 Documentation: Add documentation for seqcount.
This commit added ducumentation for seqcount.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 10:22:06 -03:00
ouyangxiangzhen
e5f46cb92b seqlock: Fix struct name and constants.
This commit fixed struct name and constant.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 10:22:06 -03:00
ouyangxiangzhen
5c5872dbac seqlock: Remove atomic_init to fix compilation error.
Since the adafruit-kb2040:smp do not support the `atomic_init`, we have
to remove the function.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 10:22:06 -03:00
hujun5
23e985b5ba seqlock: Move the header files to decouple compilation dependencies.
Move the header files to decouple compilation dependencies.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-22 10:22:06 -03:00