Commit graph

8696 commits

Author SHA1 Message Date
zhanghongyu
faefee4897 MQTT-C: compile tests only if no with_mbedtls is enabled
tests only supports tests in non-encrypted mode. when we open tests
compilation in other modes, there will be many compilation warning
with mismatched parameter types, and it will not run correctly.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 21:12:36 +08:00
gaohedong
54bef649ea net/ptpd: fix compile warning issue
In some scenarios, dynamic memory allocation is not allowed, so it is modified to a static allocation method.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-16 21:12:22 +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
guoshichao
0a90fe5167 benchmarks/ramspeed: add cmake build support
Add CMakeLists.txt for the RAMSpeed benchmark application, enabling it to
be built with the CMake build system alongside the existing Makefile-based
build. This ensures consistent build behavior across build systems.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 21:09:07 +08:00
zhanghongyu
c62d0d0875 netlib_setarp.c: add ATF_PERM to mark arp entry as permanent
Improve the behavior of the ARP table so that the manually configured
ARP table has the highest priority, can only be manually modified to
other values, otherwise will never change again, and will not time out.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 21:08:26 +08:00
anjiahao
63e2650487 elf:avoid interference between different ELFs generated by symtab
if defined CONFIG_EXAMPLES_ELF and CONFIG_EXAMPLES_MODLUE,
elf will generated BINDIR, so generated symtab will interference.
It supports inputting multiple specified files in mksymtab.sh to
avoid interference.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-16 21:07:56 +08:00
v-tangmeng
6630c08783 examples/elf: add support for CONFIG_DISABLE_SIGNALS
make the example elf can work with SIGNAL disabled

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2026-01-16 21:07:56 +08:00
anjiahao
27e0811312 elf:Delete unnecessary generation, elf does not use kernel api
delete the mod_symtab.c generate procedure

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-16 21:07:56 +08:00
anjiahao
91f55245eb apps:modify examples elf compile method
rearrange the elf test directory, make the sub-testcase in separate
directory

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-16 21:07:56 +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
daichuan
859fc54c96 netutils/ping: change socket type to SOCK_RAW
The ping socket creation method is changed from SOCK_DGRAM to SOCK_RAW,
because SOCK_DGRAM may not have permission in some environments (e.g. Docker).
Also add checksum calculation when send, and perform IP header processing when receive.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-15 17:19:29 +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
zhanghongyu
3e3b8c6936 graphics/libyuv: fix the typo.
fix the typo.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 16:46:40 +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
zhaoxingyu1
26fcdbd9ad mtdconfig/nvs: fix typo error in nvs testcase
such as: 2st->2nd, 3st->3rd and so on

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-15 10:26:21 +08:00
zhaoxingyu1
32facd5b3a mtd/nvs: testcases fit the situation where erasestate is 0
Special_id dynamically adjusts based on erase value

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-15 10:26:21 +08:00
zhaoxingyu1
58c2473b38 apps/testing: nvs testcases support remove align size
mtd/nvs removes CONFIG_MTD_WRITE_ALIGN_SIZE,
testcases need to be modified meanwhile

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-15 10:26:21 +08:00
gaohedong
af8ff17f95 netlib: fixed compilation issues
fixed compilation issues

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-15 10:26:02 +08:00
haopengxiang
680dca1121 ltp: close mq_close/3-1 testcase when open CONFIG_FDCHECK
Caused the cause will used after free on fd

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 10:25:21 +08:00
ligd
429f24afbd ltp: close mq_close/4-1 testcase when open CONFIG_FDCHECK
Caused the cause will used after free on fd

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 10:25:21 +08:00
ligd
b7b2ba37a1 timer_test: reduce the sleep time to improve testing efficiency
reduce the sleep time

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 10:25:21 +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
meijian
b0b90ac728 apps/net: add http connectivity check API
Add netlib_check_httpconnectivity() to verify HTTP service connectivity by sending GET request and validating status code.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-13 10:55:40 +08:00
raiden00pl
a22bf844cd .github/build.yml: fix python venv installation
install venv package in one command to avoid issues with ubuntu mirrors

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-01-12 11:04:21 -05:00
Matteo Golin
8d4e872402 !testing/cmocka: Compile cmocka as a libary only by default
BREAKING CHANGE

This commit introduces a Kconfig switch to include the cmocka binary
built from cmocka_main.c. The default behaviour is now changed so that
cmocka is built as a library only, which would be the desired behaviour
for users creating their own cmocka projects.

To restore the old behaviour (where the cmocka program is compiled), add
CONFIG_TESTING_CMOCKA_PROG=y to your legacy configuration.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-01-12 10:14:55 +08: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
gaohedong
d594c953a1 net/vlan: fix issue of vlan pcp config
Fix a issue of vlan pcp config.
`vconfig add eth0 10` will create eth0.10 with VID=10 and no PCP(0)
`vconfig add eth0 10 3` will create eth0.10 with VID=10 and PCP=3

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-12 00:55:47 +08:00
hujun5
21f4156048 sighand: need block WAKEUP_SIGNAL in current tcb
If the main thread receives the signal, the waiter_main will not be awakened.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-12 00:55:33 +08: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
zhangshuai39
63f61d080a netutils/ntpclient: Fix a large number of print DNS request errors
Before attempting to sample via NTP, network connectivity should be checked to avoid frequent sampling that could cause network error logs to overflow.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-11 15:57:05 +08:00
zhangshuai39
13a019450a netlib: Add an empty macro definition to the two connectivity functions
The `netlib_check_ipconnectivity` and `netlib_check_ifconnectivity` functions depend on the `NETUTILS PING` configuration item. When `NETUTILS PING` is not enabled, a compilation error will occur; therefore, an empty macro definition is added.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-11 15:54:38 +08:00
meijian
c61fb846d7 apps/net: add if network conntivity check API
Perform connectivity testing on the specified network interface card.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-09 14:03:20 +08:00
Zhe Weng
10eae1dc6b vconfig: Support setting default PCP when creating VLAN
Now we allow setting a default PCP when creating VLAN like:
`vconfig add iface-name vlan-id [pcp]`
e.g.
`vconfig add eth0 10` will create eth0.10 with VID=10 and no PCP(0)
`vconfig add eth0 10 3` will create eth0.10 with VID=10 and PCP=3

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-01-08 22:51:19 +08:00
Zhe Weng
ae7c168bf6 nshlib: Add vconfig command
Add vconfig command

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-08 22:51:19 +08:00
mazhuang
9c4103d496 nsh_syscmds/rpmsg: add rpmsg test command support
User can use rpmsg test /dev/rpmsg/<cpuname> to test the rpmsg
channel

Signed-off-by: mazhuang <mazhuang@xiaomi.com>
2026-01-08 22:50:11 +08:00
buxiasen
1512f9c6e5 netlib/ping: fix the stack variable not initialized.
We add devname in ping_info_s, but not initializeed, cause
data abort as value in stack possible not NULL.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-07 11:58:13 +08:00
wangchengdong
416c315f92 ostest: sync hrtimer ostest with hrtimer updates
Update the hrtimer ostest to reflect recent changes in the hrtimer
implementation.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-07 09:44:42 +08:00
Huang Qi
73bc5cbcc6 interpreters: Add mquickjs JavaScript interpreter integration
Add complete integration for the MicroQuickJS JavaScript interpreter,
supporting both CMake and Make build systems with automatic source
acquisition.

Key features:
* FetchContent downloads mquickjs from bellard/mquickjs if local
  git repository is not available in interpreters/mquickjs/mquickjs/
* Builds mqjs_stdlib host tool to generate mqjs_stdlib.h and
  mquickjs_atom.h headers during build
* Creates libmquickjs library with proper header generation dependencies
  to prevent parallel build failures
* Provides mqjs NSH application for interactive JavaScript execution
* Configurable task priority and stack size via Kconfig options
  (INTERPRETERS_MQJS_PRIORITY, INTERPRETERS_MQJS_STACKSIZE)
* Supports both 32-bit and 64-bit architectures with appropriate build flags

Files added:
* CMakeLists.txt - CMake build configuration with FetchContent support
* Kconfig - Configuration options for interpreter features
* Make.defs - Make build definitions
* Makefile - Alternative Make-based build support
* .gitignore - Ignores generated files and local mquickjs source directory

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-07 09:44:19 +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
buxiasen
157ecb091d iperf: compatible work with no IPv4
We possible want to use iperf to test rpmsg socket etc.

Fix error when enable iperf and no IPv4
```
arm-none-eabi-ld: warning: ~/nuttx/nuttx has a LOAD segment with RWX permissions
arm-none-eabi-ld: ~/nuttx/staging/libapps.a(iperf_main.c.~.apps.netutils.iperf_1.o): in function `iperf_main':
~/apps/netutils/iperf/iperf_main.c:248:(.text.iperf_main+0x330): undefined reference to `inet_ntoa_r'
arm-none-eabi-ld: ~/apps/netutils/iperf/iperf_main.c:240:(.text.iperf_main+0x354): undefined reference to `netlib_get_ipv4addr'
arm-none-eabi-ld: ~/nuttx/staging/libapps.a(iperf.c.~.apps.netutils.iperf_1.o): in function `iperf_print_addr':
~/apps/netutils/iperf/iperf.c:226:(.text.iperf_print_addr+0x3c): undefined reference to `inet_ntoa'
```

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-04 00:06:17 +08:00
buxiasen
188838469c kernel/syscall: fix required INET may case no support
We may possible enable socket and no ipv4

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-04 00:06:17 +08:00
meijian
3467f9b82d apps/net: add ip address connectivity check API
The system checks connectivity with the input IP address; if no IP address is provided, it defaults to checking DNS server connectivity.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-04 00:05:38 +08:00
dongjiuzhu1
150c5756a0 examples/capture: support monitor edge change by signal
add monitor code about edge change

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-03 23:51:26 +08:00
zhangshuai39
6830e297cf dhcpd: Supports kernel mode compilation
The previous method of terminating the dhcp daemon via a global variable has been removed; instead, the `kill pid` command is used. Also, because the original `dhcp_start` method creates tasks via `task_create`, which is not supported in kernel mode, `dhcp_start` is not compiled in kernel mode. The daemon can be started in kernel mode using `dhcpd xxx &`.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-02 12:29:42 -03:00
nuttxs
9ad4c3c395 netutils/dhcpc.h: fix the compilation error caused by undefined
CONFIG_NETDB_DNSSERVER_NAMESERVERS

Provide a default value for CONFIG_NETDB_DNSSERVER_NAMESERVERS if
CONFIG_NETDB_DNSCLIENT is not enabled

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2026-01-02 14:12:10 +01:00
p-szafonimateusz
85539a1223 github/ci: add support for NTFC
Add support for NTFC testing framework.

At the moment NTFC is downloaded from a private repo,
and installed with pip and venv. In the future NTFC repositories
will be migrated to Apache organization.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-12-31 16:33:10 -03:00
dongjiuzhu1
c90b64ed8b nshlib/ls_handler: eliminate floating-point operations for human-readable sizes
Replace floating-point arithmetic with fixed-point integer math to avoid
linking soft-float library (~2-3KB Flash) when displaying human-readable
file sizes (ls -lh command).

Changes:
- Use integer division and modulo to calculate size components
- Calculate decimal part: (remainder * 10) / unit for one decimal place
- Refactor duplicated code: consolidate GB/MB/KB logic into single path
- Remove CONFIG_HAVE_FLOAT dependency

This eliminates calls to __aeabi_f2d, __aeabi_fmul, __aeabi_i2f and other
ARM EABI floating-point helpers, reducing Flash footprint for systems
compiled with -mfloat-abi=soft.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-31 16:32:27 -03:00
zhangkai25
710aef6bd0 iperf: Increase the priority of the report thread
ensure it is not blocked by the iperf thread, preventing iperf from completing

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2025-12-30 19:51:57 +08:00