Commit graph

1393 commits

Author SHA1 Message Date
yukangzhi
71593dffad apps/system/trace: support binary dump of noteram
This patch adds support for dumping binary contents from noteram via the
`trace dump -b <file>` command. Changes include:

- Add a `binary` parameter to `trace_dump()` and the public header
  `system/trace/trace.h` to indicate binary output mode.
- Update `trace_dump()` to set the noteram read mode to binary using
  `NOTERAM_SETREADMODE` when requested.
- Update `trace dump` CLI parsing in `system/trace/trace.c` to accept
  the `-b` flag and pass it through to `trace_dump()`.
- Update usage/help text to include the new `-b` option.

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-26 19:32:42 +08:00
hongfengchen
b56c785640 testing: add missing header files
Add missing header files in netutils and lsan modules to fix
implicit function declarations and improve compilation compatibility.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
dongjiuzhu1
854d00e49e system/uorb: uorb_listener add new features.
Add nonwakeup ways to using uorb_listener

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-26 19:31:45 +08:00
dongjiuzhu1
1f990388ec system/uorb: support non-wakeup subscribe.
default subscribing is wakeup.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-26 19:31:45 +08:00
likun17
a454cf4d94 system/uorb: uorb_listener flush functionality optimization.
uorb/listener:Added flush failure prompt information.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-23 10:01:33 +08:00
likun17
ada12ce175 system/uorb: uorb_listener adds new features.
uorb/listener.c: Added flush function.
aurora:/ # uorb_listener -f sensor_accel_uncal,sensor_mag_uncal,sensor_aaa
Waited for 5 seconds without flush complete event. Giving up. err:25

Result:
        Topic [sensor_mag_uncal0] flush: FAILURE. [-1]
        Topic [sensor_accel_uncal0] flush: SUCCESS.
Total number of flush topics: 1/2

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-23 10:01:33 +08:00
likun17
183deb66e9 system/uorb: uorb_listener adds new features.
add get sensor device information based on topic.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-23 10:01:33 +08:00
Bartosz Wawrzynek
f09d0b2e09 apps: Fix minor issues for latest toolchains
- crypto/mbedtls: Add -Wno-cpp flag to suppress warnings
- interpreters/quickjs: Add flags to suppress warnings
- lte/alt1250: Fix spelling issues in comments
- system/dd: Add missing includes for modern compilers
- system/zlib: Add -Wno-cpp flag
- testing/cxx: Include missing algorithm header

Signed-off-by: Bartosz <bartol2205@gmail.com>
2026-01-23 10:00:52 +08:00
fangpeina
715da6bde6 system/ymodem: fix send err when partial write
Fix buffer offset calculation in ymodem_send_buffer() to correctly
handle partial writes by advancing the buffer pointer and adjusting
the remaining size on each retry.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-01-23 09:43:22 +08:00
hongfengchen
b72f7997a3 system/popen: close newfd correctly
Fixes a bug where newfd is not properly closed when newfd[0] equals newfd[1].
This can cause file descriptor leaks in certain edge cases where the read
and write sides of the pipe are duplicated.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-22 19:54:56 +08:00
likun17
8146403512 system/uorb: uorb listener bug fix.
Fixed the issue that instance+1 subscription will be triggered when
topic exists in this core

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-22 03:34:51 +08:00
guoshichao
755fae7ac1 system/cu: merge the cu.h to cu_main.c
Merge the cu.h header file contents into cu_main.c to simplify the
code structure. The cu_globals_s structure and related definitions
are now directly in cu_main.c.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-20 10:23:34 +01:00
makejian
ddc699a4f3 system/cu: fix signal handler to use sa_sigaction
The sigint() function uses siginfo->si_user but was declared with
only one parameter (int sig). This causes compilation error because
siginfo is undeclared.

Fix by:
1. Rename sigint to cu_exit with proper sigaction signature
2. Use sa_sigaction instead of sa_handler to receive siginfo_t
3. Pass cu pointer via sa.sa_user for signal handler access

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-20 10:23:34 +01:00
wangchengdong
d9afe2db8c signals: fix build and runtime issues when signals all isabled
Fix build and runtime issues when signals all disabled.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-19 22:55:19 +08:00
guoshichao
782de2748f cu: implement the cu exit logic like top cmd
using the local cu_globals_s instance to manange the cu exit procedure

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-19 22:48:25 +08:00
likun17
ed7bb51b14 system/uorb:unit_test bug fix
Fixed the error message caused by inconsistent definitions of pthread_t on different platforms.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:40 +08:00
dongjiuzhu1
7ba3638507 system/uorb: merge set_info to orb_advertise_multi_queue_info.
support new api: orb_advertise_multi_queue_info to advertise topic
with info

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-19 12:22:40 +08:00
likun17
3d97bf02e4 system/uorb:Loop bug fix
Fixed the epoll issue that when multiple events come only the first POLLIN is entered.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:40 +08:00
guoshichao
e804886c68 libuv: fix sendmsg parameter type in NuttX port
Update the libuv NuttX port patch to change sendmsg() parameter from
"struct msghdr *msg" to "const struct msghdr *msg" in the NuttX-specific
implementation stub. This maintains compatibility after NuttX's socket API
was made POSIX-compliant with const-correct parameters.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 21:10:55 +08:00
zhanghongyu
2b0a4a20f5 iptables: add file lock to prevent concurrent overwrite
the kernel can only prevent the concurrency of s/getsockopt, but
iptables will call these interfaces multiple times at a time. We
need to wait for one iptables to complete before executing the second
one, otherwise the data will be overwritten.

iptables flow:
get current iptables entries [1] -> add new entry 2 [1,2] -> set to kernel [1,2]
get current iptables entries [1] -> add new entry 3 [1,3] -> set to kernel [1,3]
entry 2 is lost

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 17:20:03 +08:00
zhanghongyu
5f634815cb iptables: fix the ipv4 mask conversion error
the configured mask should be in network byte order, but the logic here
calculates it as host byte order.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 17:12:03 +08:00
wangchengdong
60d814efa2 sched/signal: Add support to disable partial or all signals
Fix dependency issue when signals are partially or fully enabled

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-15 15:48:54 +08:00
jingfei
97545f6ff9 ymodem:rb of ymodem add prefix and suffix for download file name
Adding parameters to rb main can add prefixes and suffixes
to the file names to be downloaded

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-01-15 01:24:17 +08:00
liucheng5
58326d39dc system/uorb: add a new uorb topic ENG
Add a new uorb topic for ENG sensor

Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-14 10:49:28 -05:00
shichunma
7daac30cb4 system/iptables: avoid trap when running "iptables -L"
A trap occurs every time CONFIG_NET_NAT is enabled while CONFIG_NET_IPFILTER is not.

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-01-11 15:07:15 -05:00
Huang Qi
4e8a0ae4c4 style: Fix coding style violations in nuttx-apps
Fix various coding style issues including:
- Case statement formatting
- Include placement and ordering
- Whitespace issues
- Long line formatting
- Bracket alignment

Affected modules:
- audioutils, examples, include
- netutils, system

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-12 00:54:48 +08:00
Felipe MdeO
ca11a7e093 system/smf: Port SMF .c/.h files to NuttX
This commit add state machine framework lib to the NuttX project. Also an example is added to help users understand and use this feature.

Changes: Added some files. No impact in other features are expected.

Adjust SMF macro names

Fix issues requested during MR review

update kconfig

fix ci-cd issue

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-01-05 12:50:04 -05:00
Zhe Weng
4f93ec0a43 pkt: Set sll_protocol for raw socket to ETH_P_ALL
Ref: https://man7.org/linux/man-pages/man7/packet.7.html

We should either set protocal when creating socket or binding, otherwise
we cannot capture any packet.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-04 21:41:21 +08:00
dongjiuzhu1
03ca9ba500 netutils/ptpd: using -B to control BMCA message
new option -B to BMCA message

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
4426ce733a netutils/ptpd: using dynamic config to config clien-only mode and delaye2e
fix compile warning when only enable PTPD_CLIENT or PTPD_SERVER

ptpd.c:493:38: error: 'CONFIG_NETUTILS_PTPD_PRIORITY1' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:494:39: error: 'CONFIG_NETUTILS_PTPD_CLASS' undeclared (first use
in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:495:39: error: 'CONFIG_NETUTILS_PTPD_ACCURACY' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_DEBUG'?
ptpd.c:498:38: error: 'CONFIG_NETUTILS_PTPD_PRIORITY2' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:502:36: error: 'CONFIG_NETUTILS_PTPD_CLOCKSOURCE' undeclared
(first use in this function); did you mean
'CONFIG_NETUTILS_PTPD_STACKSIZE'?

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
ac881e5108 system/ptpd: provide more parameter by struct ptpd_config_s when starting ptpd
origin command change to new command:
ptpd start interface & -> ptpd -i eth0 &
ptpd stop pid          -> ptpd -d pid
ptpd status pid        -> ptpd -t status

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
28302ae7d7 system/ptpd: using main task to replace new task
new starting command:
ptpd start interface &

we should run it in background ways

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
gaohedong
b56795e1e2 net/ping: utils ping should depends on ipv4
utils ping should depends on ipv4

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-25 12:24:30 +08:00
wangchen
f89773cbc8 ping: Initialize info.devname to NULL
Initialize info.devname to NULL to solve the problem of the SO-BINDTODEVICE property being set incorrectly in the icmp_ping function

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-25 12:24:04 +08:00
meijian
5d3b2d07d6 ping: add -I for bind device
Add -I option to specify the network device to use for sending ICMP
echo requests. This allows users to explicitly bind ping to a
specific network interface, which is particularly useful in
multi-homed systems with multiple network interfaces.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 12:24:04 +08:00
Matteo Golin
0045d8b546 uorb/listener: Fix typos
Fix typo in comments and strings.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-12-22 12:07:36 +01:00
fangpeina
c4da1b5b9f system/cu: Optimize I/O performance with batch read/write
Due to DMA-based transfers, the rx buffer can receive a large amount
of data at once. The previous character-by-character processing approach
was inefficient.

Modify character-by-character read to block read of the entire buffer.
This improves throughput and reduces CPU overhead, especially for high-speed
serial communication or other DMA-based transfers.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2025-12-18 21:49:00 +08:00
yangsong8
60f5a68c96 adb: adb tcp server configuration depends on NET_TCPBACKLOG
For TCP-based adb, if the current CPU contains TCP protocol stack,
then NET_TCPBACKLOG needs to be enabled.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-11 19:16:23 +08:00
yangsong8
953fa21fef adb: adb shell depends on SCHED_CHILD_STATUS
Without this configuration, when executing exit in adb shell,
adb will not be able to exit because it cannot receive the
close packet.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-11 19:16:23 +08:00
yangsong8
dbc99dbf35 apps/spitool: Support multiple trans
By adding a parameter -r, spitool can exchange multiple transactions.
example:
spi exch -b 1 -t 0 -n 0 -f 3000000 -m 1 -w 32 -x 1 -r 2 f001fff1 0000ff35

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-10 11:26:43 +08:00
yangsong8
74293114aa apps/system: fix spitool can not send data issue
when use cmd 'spi exch -b 1 -f 3000000 -m 1  -n 0 -w 32 -x 1 1f',
the last character '1f' can not be trans out.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-10 11:26:43 +08:00
yangsong8
00154fd818 apps/system/composite: change cmake build name to conn and disconn
The executable file compiled by cmake has the same filename as
that compiled by make.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-10 11:24:35 +08:00
yangsong8
f82e6c2229 nsh: return EOF when nread is 0
If enable CONFIG NSH_CLE. When sh reads data and detects that nread is 0,
return EOF and exit.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-10 11:24:14 +08:00
yangsong8
e19d99022a apps/fastboot: fix build warning
apps/system/fastboot/fastboot.c:351:43: error: '%s' directive output may be truncated writing up to 63 bytes into a region of size 60 [-Werror=format-truncation=] ...... apps/system/fastboot/fastboot.c:351:3: note: 'snprintf' output between 5 and 68 bytes into a destination of size 64 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ apps/system/fastboot/fastboot.c:351:43: error: '%s' directive output may be truncated writing up to 63 bytes into a region of size 60 [-Werror=format-truncation=] ...... apps/system/fastboot/fastboot.c:351:3: note: 'snprintf' output between 5 and 68 bytes into a destination of size 64 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-09 20:16:21 +08:00
yangsong8
9633580d2c apps/fastboot: add switchboot command
The switchboot command can be sent even without enabling sh

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-09 20:16:21 +08:00
yangsong8
63c1767d33 apps/fastboot: organize an api for external apps to call
add an interface fastboot_handler. This interface can be called
when nsh is disable.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-09 20:16:21 +08:00
yangsong8
5eae4c8f15 apps/fastboot: Enable network via ioctl during fastboot initialization
Bring up the network when do fastboot tcp init.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-09 20:16:21 +08:00
buxiasen
8126aaf803 cmake/process-spawn: remove if not required align with Makefile
We already fixed the process-spawn.c in Makefile, should align to cmake

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 11:23:10 +01:00
likun17
6028b42d0f uorb/generator:Fix generator bugs and formatting issues.
replace kmm_zalloc with zalloc and malloc, and fix format and return value errors.

Signed-off-by: likun17 <likun17@xiaomi.com>
2025-11-20 20:44:25 +08:00
likun17
9cf9b862c1 uorb: add generator tool.
e.g.:
1. uorb_generator -f /data/sensor/19700101000003/sensor_accel_uncal0.csv -t sensor_accel_uncal2
2. uorb_generator -s -r 5 -n 200 -t sensor_accel_uncal2 timestamp:1,x:-2.0,y:3,z:4,temperature:5

Signed-off-by: likun17 <likun17@xiaomi.com>
2025-11-20 20:44:25 +08:00