Commit graph

8753 commits

Author SHA1 Message Date
Jiri Vlasak
0e1ccbe35d license: Fix typo in LICENSE file
license: Fix typo in LICENSE file

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-23 11:05:48 -03:00
Jiri Vlasak
72f57fc34e netutils: Add BARE
BARE is a simple binary representation for structured application data.

cbare, the BARE implementation ported by this commit, is an I/O agnostic
C implementation of the BARE message encoding.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-23 11:05:48 -03:00
guohao15
197401975a mtdconfig: support ram_mtdconfig device && lomtdconfig device
For nvs test in qemu

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2026-01-23 10:07:11 +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
hujun5
19dcc896d7 sched/tcb: add a reference count to the TCB to prevent it from being deleted.
To replace the large lock with smaller ones and reduce the large locks related to the TCB,
in many scenarios, we only need to ensure that the TCB won't be released
instead of locking, thus reducing the possibility of lock recursion.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-22 11:06:12 -03: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
wangzhi16
f16a45a854 examples/pipe: bugfix testcase of fifo
There are three bug in fifo testcase.

1. line 211 and line 295 should be nbytes not ret.
2. coverity report error:
CID 1667262: (#4 of 11): Double close (USE_AFTER_FREE)
11. double_close: Calling close(int) will close the handle fd that has already been closed. [Note: The source code implementation of this function has been overwritten by the built-in model.]

Double close will ocurr when line 234 is true and goto line 341, close again!
Now, Using the previous code logic, Use a tid and an errout_with_null_thread to avoid uninitialized problems.

3. since line 295 is used ret not nbytes, error not expose before.

When the end of read and write are opened, end of write will write successfully even if end of read not read.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
wangzhi16
5c6d646d76 testing/fs: add testcase to test the stability of memfd.
Supplement ostest test cases.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
wangzhi16
094b0f235a test/mutex: fix mutex testcases.
Multiple threads should use the same lock for resource protection.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
yukangzhi
122a4a6f4e apps/examples/popen: Modify kconfig file
This test depends on !DISABLE_POSIX_TIMERS.

arm-none-eabi/bin/ld:
apps/examples/popen/libapps_popen.a(popen_main.c.obj):
in function `popen_main':
apps/examples/popen/popen_main.c:62:(.text.popen_main+0x1c):
undefined reference to `timer_create'

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-22 19:52:02 +08:00
yukangzhi
3c99bad310 crctest: Test the CRC library that the E2E depends on.
Test the CRC Library defined in the AUTOSAR specification

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-22 19:51:51 +08:00
tengshuangshuang
b6203955f9 syscall: fix listen case bug
Skip UDP listen test when CONFIG_NET_UDP is disabled to prevent
test failures on configurations without UDP support.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
338301de76 timerjitter: fix signal-cause error
Handle timer-delivered signals correctly to prevent assertions when
signal-related events occur during timing measurements.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
be26d79633 syscall: fix badfd test for fdcheck compatibility
Handle fdcheck path for badfd test to prevent unexpected dumps when
fdcheck is enabled, allowing proper testing of bad file descriptor
error cases.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
b86457dfcb apps/testing: fix syscall cases for fdcheck compatibility
Guard fdcheck-sensitive paths in setsocketopt, dup2, and fsync tests
to avoid assertion failures when fdcheck is enabled, ensuring tests
can properly verify error handling behavior.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
8afe3c0645 test: clean driver_audio_test (void *) cast
Drop unnecessary casts in driver_audio_test to silence compiler
warnings and improve code clarity.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
4df2ce98aa testing: fix net case bug
Adjust net socket test expectations for correct behavior to prevent
false test failures in network socket test cases.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
df48348fca test: fix timerjitter data style error
Fix timerjitter output formatting for date/time fields to match
expected format and improve test result readability.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
6249f22f97 tests: fix cache_test and arch_lib_test date style error
Correct date formatting in cache_test and arch_lib_test outputs to
ensure consistent date/time display format across test results.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
5216065fb8 cache_test: fix up_flash_dcache error
Fix flash dcache helper error handling in cache_test to properly
handle errors when flushing data cache operations fail.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +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
tengshuangshuang
10873c6b59 testing: specify arch kconfig for testsuites
Specify architecture configuration in testsuites Kconfig to ensure
correct architecture-specific settings and build configurations.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-21 14:44:00 -03:00
tengshuangshuang
40a890626d testing: specify arch format Kconfig
Specify architecture format in Kconfig to ensure proper configuration
handling for different architectures in testing modules.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-21 14:44:00 -03:00
zhenwei fang
72fe4e21e1 nsh: fix nsh redirect fd double close
avoid double-close of redirection fds

Signed-off-by: zhenwei fang <fangzhenwei@bytedance.com>
2026-01-21 14:42:50 -03:00
Côme VINCENT
85b1a1c8c1 fix(macro): fix CAPIO_FREQUENCY macro typo
Going from CAPIOC_FREQUENCE to CAPIO_FREQUENCY according to nuttx/pull/16925

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2026-01-21 16:59:08 +01:00
makejian
57ced95c07 crypto/openssl-wrapper: align SSL_CTX_new declaration with OpenSSL
Remove the extra rngctx parameter from SSL_CTX_new() to match
the standard OpenSSL API signature:
  SSL_CTX *SSL_CTX_new(const SSL_METHOD *method)

This improves compatibility with code written for OpenSSL.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 19:25:02 +08:00
makejian
690d8bddce crypto/openssl-wrapper: fix SSL error code mapping
Map mbedtls error codes to OpenSSL standard return codes in
SSL_connect/SSL_do_handshake:
- Return 1 on success
- Return 0 on controlled shutdown
- Return -1 on fatal error (was returning mbedtls error codes)

This aligns the return values with OpenSSL specification where
SSL_get_error() should be called to get the actual error reason.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 19:25:02 +08:00
makejian
825007aafb crypto/openssl-wrapper: export SSL_CTX_load_verify_file and SSL_CTX_load_verify_dir
Export SSL_CTX_load_verify_file() and SSL_CTX_load_verify_dir()
interfaces to allow loading CA certificates from file or directory.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 19:25:02 +08:00
makejian
22f85e8b61 benchmarks/fpu: improve timing precision to milliseconds
Change FPU benchmark timing from seconds to milliseconds for better accuracy.
This allows for more precise measurement of test cycles, especially for
shorter test runs that previously completed within a single second.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 07:43:09 -03:00
makejian
9148fb9718 benchmarks: Add Whetstone FPU benchmark
Add the Whetstone floating-point benchmark to NuttX applications.
The Whetstone benchmark is a widely-used tool for evaluating FPU
(floating-point unit) performance.

This benchmark is ported from netlib.org whetstone.c which has a
custom permissive license requiring attribution. Therefore it
depends on ALLOW_CUSTOM_PERMISSIVE_COMPONENTS.

Usage: whetstone [loops]

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 07:43:09 -03:00
Jiri Vlasak
37403210f9 netutils/nng: Update help for NETUTILS_NNG
NNG depends on options that, if not enabled, makes compilation or
runtime crashes. Noting these options in help helps to find out which
are such options.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-21 09:48:11 +08:00
wangchengdong
5456849446 ostest/hrtimer: Add threaded hrtimer tests
Add threaded hrtimer tests

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-21 00:29:40 +08:00
wangchengdong
840c4fceef ostest/hrtimer: align hrtimer callback declaration
align hrtimer callback declaration with latest update of hrtimer

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-21 00:29:40 +08:00
wangchengdong
19dd2531fb testing/ostest: fix build issue
fix:

  Building NuttX...

  /d/a/nuttx-apps/nuttx-apps/sources/apps/Application.mk:238: target 'signest.c.d.a.nuttx-apps.nuttx-  apps.sources.apps.testing.ostest.o' given more than once in the same rule

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-20 17:01:42 +01: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
zhanghongyu
9c85568c4f icmpv6_ping.c: change socket type from SOCK_DGRAM to SOCK_RAW.
standardize the implementation of ping6 to better comply with socket
permissions on certain systems.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-19 22:52:06 +08:00
makejian
d2902008fe openssl-wrapper: fix code style compliance
Fix coding style issues in OpenSSL/MbedTLS wrapper implementation:
- Align whitespace and indentation
- Fix line formatting
- Ensure consistent code style per NuttX standards

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 22:51:14 +08:00
makejian
bafe30898a openssl-wrapper: mapping more error code whitin mbedtls and openssl when ssl error
VELAPLATFO-66562

Change-Id: Ibb1446a7fcae1d2bc09d75052466a6ce084103b8
Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 22:51:14 +08:00
makejian
49e2592e34 openssl-mbedtls-wrapper: export SSL_ASSERT* macro
VELAPLATFO-62586

Change-Id: I2ceac930c87196a16ea7ddf5e4130bb991b51025
Signed-off-by: makejian <makejian@xiaomi.com>
(cherry picked from commit d0547662d5006ec0a348d89d3d7e251ef4bb183c)
2026-01-19 22:51:14 +08:00
makejian
94ffd5e9f0 openssl_wrapper_mbedtls: extend openssl interfaces in ssl module for mqtt
VELAPLATFO-62586

Change-Id: I3b56b028e76aee118ed90211c097ac3fe86bc129
Signed-off-by: makejian <makejian@xiaomi.com>
(cherry picked from commit 7a567e98489f64b740044b9ce4066fa8d41af359)
2026-01-19 22:51:14 +08:00
makejian
33d5062ba6 openssl_wrapper_mbedtls: support bio interfaces in openssl
VELAPLATFO-62586

Change-Id: I5d7675c05dc3a52c1cb15a6132b969a19f848248
Signed-off-by: makejian <makejian@xiaomi.com>
(cherry picked from commit 409c86a062a816b56a3a48b1111102d12f24a48f)
2026-01-19 22:51:14 +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
guanyi3
a75fa37090 usrsocktest: fix TEST_ASSERT_EQUAL fail for POLLIN
This assertion should be removed because the POLLIN event is now only
raised when there is data pending to be received. Previously, POLLIN
was incorrectly set as soon as the connection was established, even
when no data was available, which was not consistent with the expected
behavior.

Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
2026-01-19 22:46:45 +08:00
wangchengdong
df30f84f33 ostest/hrtimer: sync hrtimer test with latest updates
Synchronize the hrtimer ostest with the latest hrtimer changes.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-19 08:37:08 -03:00