Commit Graph

60197 Commits

Author SHA1 Message Date
liaoao a41c2cb741 rpmsg_port_spi: add support for peer's shutting down notify
Shutdown mean peer's want to disconnect the connection untial
peer want connect with local side again.

After receive shutdown command, local will clear the state until
reconnecting and clear the gpio status to avoid the leak current.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-07 22:47:00 +08:00
liaoao 01b022fdd0 rpmsg_port_spi_slave: only drop tx queue used buffer when unconnecting
because rxq may have received peer's reconnection data, so we can
connect with peer again.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-07 22:47:00 +08:00
liaoao 972dae38a2 rpmsg_port_spi: add connecting/disconnecting status for port spi
to make sure the connecting process will not be interrupted

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-07 22:47:00 +08:00
liaoao d4a787aebf rpmsg_port_spi: only drop tx queue used buffer when unconnecting
Because rxq may have received reconnection data, when connect state
changed to unconnected but the reconnect data has not been processed,
and during that time there is a tx buffer to be sent, the
drop_packets may drop the reconnect data and two sides can not
reconnected anymore.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-07 22:47:00 +08:00
liaoao 39ff211469 rpmsg_port_spi: add log to know spi complete callback not called
1. add error log when transferring keeps rasing because of no spi
exchange complete callback;
2. this log can also be used to check if there is an interrupt has
been caught when peer side keeps trying to send data;

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-07 22:47:00 +08:00
liaoao 880160bfca rpmsg_port_spi: add more detail debug info for transfer failed
Add log to know the error command and aviable buffer number

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-07 22:47:00 +08:00
yintao ad08484cdb rpmsg: fix rpmsg_router_hub_unbind crash when reconnect
0x106b9ad2 in metal_list_del (node=<optimized out>) at /home/yintao/O61/nuttx/include/metal/list.h:85
rpmsg_unregister_endpoint (ept=0x1857ba30) at open-amp/lib/rpmsg/rpmsg.c:296
rpmsg_destroy_ept (ept=0x1857ba30) at open-amp/lib/rpmsg/rpmsg.c:389
0x102b871a in rpmsg_router_hub_unbind (ept=0x1857b330) at rpmsg/rpmsg_router_hub.c:139
0x102b7fec in rpmsg_device_destory (rpmsg=rpmsg@entry=0x1859e4e8) at rpmsg/rpmsg.c:486
0x102b9928 in rpmsg_port_unregister (port=port@entry=0x1859e4e8) at rpmsg/rpmsg_port.c:749
0x102b9bca in rpmsg_port_spi_process_packet (rxhdr=0x185ba718, rpspi=<optimized out>) at rpmsg/rpmsg_port_spi.c:408
rpmsg_port_spi_thread (argc=<optimized out>, argv=<optimized out>) at rpmsg/rpmsg_port_spi.c:452
0x102aa96e in nxtask_start () at task/task_start.c:111

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-07 22:41:48 +08:00
yintao 773db122a3 drivers/rpmsg: fix double free at rpmsg_router_hub_unbind
/home/yintao/o61-2800/nuttx/libs/libc/assert/lib_assert.c:36
mempool_release
/home/yintao/o61-2800/nuttx/mm/mempool/mempool.c:431 (discriminator 1)
mempool_multiple_free
/home/yintao/o61-2800/nuttx/mm/mempool/mempool_multiple.c:637
mm_free
/home/yintao/o61-2800/nuttx/mm/mm_heap/mm_free.c:248
free
/home/yintao/o61-2800/nuttx/mm/umm_heap/umm_free.c:49
rpmsg_router_hub_unbind
/home/yintao/o61-2800/nuttx/drivers/rpmsg/rpmsg_router_hub.c:127
rpmsg_virtio_ns_callback
/home/yintao/o61-2800/nuttx/openamp/open-amp/lib/rpmsg/rpmsg_virtio.c:684
rpmsg_virtio_rx_callback
/home/yintao/o61-2800/nuttx/openamp/open-amp/lib/rpmsg/rpmsg_virtio.c:599
virtqueue_notification
/home/yintao/o61-2800/nuttx/openamp/open-amp/lib/virtio/virtqueue.c:600
rproc_virtio_notified
/home/yintao/o61-2800/nuttx/openamp/open-amp/lib/remoteproc/remoteproc_virtio.c:394
remoteproc_get_notification
/home/yintao/o61-2800/nuttx/openamp/open-amp/lib/remoteproc/remoteproc.c:1059
rptun_worker
/home/yintao/o61-2800/nuttx/drivers/rptun/rptun.c:324
rptun_worker
/home/yintao/o61-2800/nuttx/drivers/rptun/rptun.c:324
nxtask_start
/home/yintao/o61-2800/nuttx/sched/task/task_start.c:111

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-07 22:41:48 +08:00
gaohedong 863c20544c net/vlan: add a documentation for vconfig
Users can add or delete Vlan interfaces through the vconfig tool. This document describes the usage of vconfig.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-07 22:25:47 +08:00
zhanghongyu 6a6bc58e07 net/udp_sendto_unbuffered.c: fix udp message cannot be sent to the network card
UDP message cannot be sent to the network card, and case a stuck issue.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-07 13:27:11 +01:00
zhanghongyu 1c65d71488 usrsock_rpmsg_server.c: replace net_lock with conn_lock
Protect usrsock_rpmsg_server resources through conn_lock, avoid lack
of protection for usrsock_rpmsg_server after net_lock modification.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-07 09:17:49 -03:00
zhangshuai39 6b4bb6b20f netlib: Supplement the netlib_check_ifconnectivity documentation
Build Documentation / build-html (push) Has been cancelled
A brief introduction to the interface functions, parameters, and return values.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-07 17:26:35 +08:00
OceanfromXiaomi f53b986fb2 can: propagate iob_tryadd_queue() failure in can_datahandler
The can_datahandler() function calls iob_tryadd_queue() to enqueue
received CAN data. Since iob_tryadd_queue() may return a negative
value on failure, the error was previously not properly handled.

Update can_datahandler() to propagate the return value so callers
can detect and handle queueing failures correctly.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2026-01-07 08:31:06 +01:00
Bowen Wang e3403709f8 virtio/virtio-gpu: fbmem should transfer to pa
When using the virtio-gpu-pci device, we need to use physical address

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-06 15:09:34 -03:00
ligd cf4a9d7241 drivers/serial/pty: fix memory leak when pty_destroy
1. ptmx_open -> pty_register2 -> master register i_crefs 1
                              -> salve  register i_crefs 1
2. ptmx_open -> master unregister i_crefs 0
3. master open i_crefs 1
   salve  open i_crefs 2

4. in pty_close() master close with i_crefs 1
                  salve  close with i_crefs 2

So, if correct the i_crefs judgement in pty_close()

Signed-off-by: ligd <liguiding1@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-06 15:08:23 -03:00
zhaohaiyang1 eee0d813a2 can: ctucanfd: initialize CAN message header on receive
The CAN message header was not fully initialized in
ctucanfd_chardev_receive(), which could result in uninitialized
fields and incorrect message contents being delivered to
upper-layer applications.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2026-01-06 23:20:18 +08:00
wangchengdong 24651af90c [EXPERIMENTAL]sched/hrtimer: update hrtimer document
Update the hrtimer documentation to describe the hrtimer state machine,
    which is introduced to handle safe cancellation and execution in SMP
    environments.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-06 23:14:04 +08:00
wangchengdong 1020bc74e8 [EXPERIMENTAL]sched/hrtimr: Allow running/armed hrtimer to be restarted
Allow running/armed hrtimer to be restarted to
  fix hrtimer bug: #17567

Co-authored-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-06 23:14:04 +08:00
ouyangxiangzhen 2a1f24b817 compiler: Add PRAGMA and unroll_loop.
This commit added PRAGMA and unroll_loop to support compiler
loop-unrolling.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-06 19:46:30 +08:00
zhanghongyu fa6c8579dd driver/net: replace net_lock with netdev_lock
modify the code of the adapted protocol stack to avoid deadlocks and the
logic that cannot be protected by locks after modification.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-06 16:08:30 +08:00
zhanghongyu 5e1410ecab net/local: replace net_lock with local_lock
remove the use of net_lock in the local module and decouple it from
other network modules.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-06 16:08:30 +08:00
wangchen c2774ba1ec netdev:When running, proto stack can exchange packets with device
netdev:when network device is running status,the network protocol stack is allowed to send packet to the network device and to receive from the network device

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2026-01-06 16:04:03 +08:00
zhaohaiyang1 2a60b7e747 can: strict TX priority ordering to avoid priority inversion
Introduce a single configuration option to provide strict transmit
priority ordering based on CAN ID.

The intention is to expose the user-visible behavior (strict TX
priority ordering) rather than the underlying implementation details.
Strict priority ordering is only meaningful when hardware transmit
buffer cancellation is available, so splitting this functionality into
separate configuration options was misleading and could result in
partially effective or incorrect configurations.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2026-01-06 16:03:14 +08:00
Matteo Golin 9baf67c9d4 docs/platforms/raspberrypi-4b: Document testing configurations
Adds documentation for the two new testing configurations, ostest and
coremark.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-01-06 16:00:52 +08:00
Matteo Golin cdf5118b62 boards/raspberrypi-4b: Add testing configurations
Adds ostest and coremark configurations. Also removed LED example from
regular NSH example.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-01-06 16:00:52 +08:00
chenzihan1 3c7999f996 drivers/sensors: fix mpu9250 register function comments
fix wrong function comments

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2026-01-06 08:36:59 +01:00
simbit18 bfa7025c28 arch/xtensa: Fix Kconfig style
- Replace help => ---help---

- Remove TAB

- Add comments

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-01-06 06:35:08 +08:00
simbit18 35c7aa214e arch/risc-v: Fix Kconfig style
- Replace help => ---help---

- Remove TAB

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-01-06 06:35:08 +08:00
simbit18 0fd5feeab5 arch/rp23xx: Fix Kconfig style
- Remove TAB

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-01-06 06:35:08 +08:00
simbit18 ebacd9d0d5 arch/rp2040: Fix Kconfig style
- Remove TAB

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-01-06 06:35:08 +08:00
ENJOU1224 73b9bced17 boards/risc-v: Enable VPU initialization for QEMU RV
The riscv_vpuconfig() was defined but never called in qemu_rv_start. This caused mstatus.VS to remain disabled, leading to Illegal Instruction exceptions when the OS attempted to use vector registers. This patch adds the missing initialization call.

Signed-off-by: ENJOU1224 <enjou1224@outlook.com>
2026-01-06 02:32:48 +08:00
Tomasz 'CeDeROM' CEDRO 3ab698c734 docs/security: Add Security section to the documentation.
* Each Apache project should have its own security guide.
* Security section is added to the NuttX documentation.
* Information about reported and fixed CVEs.
* Information and hints on how to report and handle security issues
  in accordance with The Apache Security Team [1] and Committers Guide [2].
* Information on what is and is not considered a vulnerability.
* List of existing NuttX CVEs added.

[1] https://www.apache.org/security
[2] https://www.apache.org/security/committers.html

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2026-01-06 02:17:20 +08:00
Bowen Wang 7dfc62bac5 qemuv7a/v8a-rpserver/proxy: remove "_ivshmem" suffix and update documents
Now the qemu-armv7a:rpserver_ivshmem, qemu-armv7a:rpproxy_ivshmem and
qemu-armv8a:rpserver_ivshmem, qemu-armv8a:rpproxy_ivshmem are not
only based on the ivshmem device but also the virtio-serial, so
remove the "_ivshmem" suffix and update documents.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-06 02:15:43 +08:00
Bowen Wang 0ff7014f75 qemu-armv7a/rpserver and rpproxy: support the rpmsg port uart
Use virtio-serial as the rpmsg-port-uart serial device, so we
can bringup the rpmsg-port-uart in qemu platform.

And update the documents:
nuttx/Documentation/platforms/arm/qemu/boards/qemu-armv7a/index.rst

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-06 02:15:43 +08:00
Bowen Wang aa0467057c qemu-armv8a/rpserver and rpproxy: support the rpmsg port uart
Use virtio-serial as the rpmsg-port-uart serial device, so we
can bringup the rpmsg-port-uart in qemu platform.

Server command:
qemu-system-aarch64 -cpu cortex-a53 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-chardev stdio,id=con,mux=on -serial chardev:con \
-object memory-backend-file,discard-data=on,id=shmmem-shmem0,mem-path=/dev/shm/my_shmem0,size=4194304,share=yes \
-device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,addr=0xb \
-device virtio-serial-device,bus=virtio-mmio-bus.0 \
-chardev socket,path=/tmp/rpmsg_port_uart_socket,server=on,wait=off,id=foo \
-device virtconsole,chardev=foo \
-mon chardev=con,mode=readline -kernel ./out/nuttx_qemu-armv8a_rpserver_ivshmem/nuttx \
-gdb tcp::7775

Proxy command:
qemu-system-aarch64 -cpu cortex-a53 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-chardev stdio,id=con,mux=on -serial chardev:con \
-object memory-backend-file,discard-data=on,id=shmmem-shmem0,mem-path=/dev/shm/my_shmem0,size=4194304,share=yes \
-device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,addr=0xb \
-device virtio-serial-device,bus=virtio-mmio-bus.0 \
-chardev socket,path=/tmp/rpmsg_port_uart_socket,server=off,id=foo \
-device virtconsole,chardev=foo \
-mon chardev=con,mode=readline -kernel ./out/nuttx_qemu-armv8a_rpproxy_ivshmem/nuttx \
-gdb tcp::7776

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-06 02:15:43 +08:00
liaoao 4cad404831 rpmsg_port: print remotes's running state in rpmsg_port_dump
Now rpmsg dump can print the remote core's running/sleep state

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-06 02:15:43 +08:00
liaoao 59d6263bec rpmsg_port: add rpmsg_port_get_signals api
And set signal_running when rpmsg devices registered

Now rpmsg port transport support to get the remote core's state
by api rpmsg_get_signals()

Signed-off-by: liaoao <liaoao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-06 02:15:43 +08:00
Yongrong Wang 906d5a8204 rpmsg: Add rpmsg_get_signals API and rpmsg transport ops support
provide get_signals ops to the transport layer implementation.
add rpmsg_get_signals API for rpmsg service to get remote core's
status.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-06 02:15:43 +08:00
yezhonghui 227d7237ab gpiochip: export ioexpander pointer to user
sim gpiochip ioexpander export to user

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2026-01-05 15:10:41 -03:00
yezhonghui b11f669676 ioe_dummy: fix pinval always zero issue
fix gpio pinval issue

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2026-01-05 15:10:41 -03:00
yezhonghui 36f91643ae sim/gpiochip: add sim gpiochip for gpio autotest
add sim gpiochip driver

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2026-01-05 15:10:41 -03:00
ENJOU1224 e072356182 arch/risc-v: Fix incompatible pointer types in vector context switching
The riscv_savevpu/restorevpu functions were using 'uintptr_t *' for vector registers, but 'tcb->xcp.vregs' is defined as 'uintreg_t *'. This mismatch caused compilation errors on GCC 13+ due to incompatible pointer types. This patch aligns the parameter types to 'uintreg_t *'.

Signed-off-by: ENJOU1224 <enjou1224@outlook.com>
2026-01-05 15:08:03 -03:00
Alan Carvalho de Assis 76903ea636 drivers/sx126x: Fix typo in the Kconfig
This is a small fix just to true the github getting the new commits
after running git push -f

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-01-05 14:59:32 -03:00
Alan Carvalho de Assis cce61ea287 drivers/sx127x: Add RX Timeout support
This commit adds support to fix RX timeout for SX127x, it is done
leaving the RX mode, entering in stanby mode and returning to RX
mode. It is enough to fix the AFC and get communication working
again.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-01-05 14:59:32 -03:00
Alan Carvalho de Assis 667165db46 drivers/sx127x: Move Kconfig and add bitrate options
This commit moves sx127x Kconfig to lpwan/sx127x/ to follow the
same logic used by sx126x and adds the configuration to support
different bitrate (the default 4800 is fine tuned for LORA).

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-01-05 14:59:32 -03:00
chenzihan1 258e81f248 gnss_uorb.c: update upper->parsebuffer every new line
When the last data sent by the driver does not contain \n\r,
it will cause a GAA parsing error

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2026-01-05 12:43:34 -03:00
zhangkai25 daf5715810 drivers/adc: Use mutexlock to replace critical section protection
Use mutexlock to replace critical section protection when using adc_isr_thread

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2026-01-05 22:03:12 +08:00
p-szafonimateusz 0721dfd171 boards/sabre-6quad/citest: migrate to NTFC
migrate sabre-6quad/citest to NTFC test cases

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-01-05 22:03:01 +08:00
p-szafonimateusz cb87a19d7d boards/rv-virt/citest: migrate to NTFC
migrate rv-virt/citest to NTFC test cases

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-01-05 22:03:01 +08:00
p-szafonimateusz 5585b01636 boards/rv-virt/citest64: migrate to NTFC
migrate rv-virt/citest64 to NTFC test cases

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-01-05 22:03:01 +08:00