Commit Graph

8315 Commits

Author SHA1 Message Date
Tiago Medicci
db8542d2b1 interpreters/python: fix patch to set _PyRuntime attribute
This commit also adds the check for the `__NuttX__` macro to the
patch file that allows setting an attribute to the `_PyRuntime`
structure. The `__NuttX__` macro is guaranteed to be present when
building any application for NuttX.
2025-02-14 20:53:07 +08:00
chao an
7f424c3e8d nshlib/builtin: check background task before restore the signal
fix crash if:
CONFIG_SCHED_WAITPID=n
CONFIG_SCHED_CHILD_STATUS=y

The old signal will be restored only when sigaction is saved to avoid invaild access.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-12 10:30:05 -03:00
Matteo Golin
fb0c1e10de system/uorb: require that LIBC_FLOATINGPOINT be enabled for DEBUG_UORB
This change prevents users from trying to use the `uorb_listener`
application without having floating point printing enabled on systems
that do not have an FPU (systems with FPUs have `LIBC_FLOATINGPOINT`)
enabled by default. Solution dicussed and agreed in:
https://github.com/apache/nuttx/issues/15599.
2025-02-07 09:45:59 +01:00
Tiago Medicci
f139e56cd6 testing/libc/wcstombs: Add testing application for wcstombs
This application test the libc's `wcstombs` function for different
len sizes (bigger than the converted string, exactly the size of
it and smaller than it).
2025-02-06 23:41:31 +01:00
Luchian Mihai
5d7ff307c2 examples/amg88xx: fix kconfig
fix amg88xx kconfig EXAMPLES_AMG88XX_STACKSIZE option name

add depends on SENSORS_AMG88XX to hide the example is the driver is not enabled
2025-02-05 10:51:56 +08:00
Tiago Medicci
43439a6b16 interpreters/python: set ROMFS-generated data to const char
This allows the data to be placed in the .rodata section, which can
be allocated in the flash or other read-only storage, freeing the
internal memory.
2025-02-01 23:34:24 +01:00
Tiago Medicci
87f4eb8021 interpreters/python: add wrapper to initialize Python
This wrapper application checks if the Python's modules are already
mounted (and mounts them, if not), sets the necessary environment
variables and, then, runs the Python interpreter.
2025-02-01 23:34:24 +01:00
Tiago Medicci
4c6a6c7b16 interpreters/python: create Python's config files dynamically
The `Setup.local` and the `config.site` files are used by Python's
build system to, respectively, enable or disable Python's modules
and set/unset available functions in the target system. These files
are now set according to NuttX's configs, enabling or disabling
Python's features according to the configs set on NuttX.
2025-02-01 23:34:24 +01:00
Tiago Medicci
5a7661a928 interpreters/python: add patch to set _PyRuntime section
By setting a specific region for the `_PyRuntime` structure, it is
possible to move it to the external memory, for instance, freeing
the internal memory (this structure occupies around 140KiB).
2025-02-01 23:34:24 +01:00
Neo Xu
e1e28eb88a ostest: fix cmake build break
/nuttx/apps/testing/ostest/ostest_main.c:322:(.text.user_main+0x3c3): undefined reference to `sched_thread_local_test'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-01-30 17:15:49 +01:00
Hiroki Noda
b43fd50ff0 examples:hello_nim: fix comment syntax 2025-01-30 02:18:52 +08:00
Huang Qi
18838d23bf examples/rust: Add basic Slint example
Summary:
- Added a basic Slint example for NuttX, demonstrating how to integrate Slint UI framework with Rust on NuttX
- Includes a simple UI with a counter and touchscreen input handling
- Provides CMake, Kconfig, and Makefile configurations for building the example

Impact:
- Introduces a new example showcasing Slint UI framework usage on NuttX
- Enables developers to explore Rust-based UI development on embedded systems
- Demonstrates integration with NuttX framebuffer and touchscreen drivers

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-29 14:08:45 +08:00
Huang Qi
285607608e tools/Rust: Add support for x86 platform
Summary:
- Added support for x86 and x86_64 architectures in the Rust build system
- Updated `nuttx_rust_target_triple` function in `cmake/nuttx_add_rust.cmake` to handle x86 and x86_64 target triples
- Updated `RUST_TARGET_TRIPLE` macro in `tools/Rust.mk` to include x86 and x86_64 target triples

Impact:
- Enables Rust crate compilation for x86 and x86_64 platforms
- No functional changes for existing architectures (ARM, RISC-V, etc.)
- Improves platform compatibility and expands Rust support in NuttX

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-29 13:41:30 +08:00
Xiang Xiao
cf46792554 apps/testing: Move sd_bench to apps/bechmarks
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-27 04:53:57 +01:00
Xiang Xiao
85a6aaa322 apps/testing: Move irtest/sensortest/resmonitor/monkey to apps/system
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-27 02:25:08 +01:00
Xiang Xiao
4e9d907677 testing: Move rpmsgdev to drivers/rpmsgdev
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-26 09:53:02 -03:00
Xiang Xiao
d7be1bd672 testing: Move fs/fopencookie to libc
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-26 09:53:02 -03:00
Xiang Xiao
b7f05e89ba testing: Move crypto/setest to drivers and open_memstream to libc
follow the dissusion from:
https://github.com/apache/nuttx-apps/pull/2931

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-26 07:32:53 +01:00
tengshuangshuang
0406e6734a apps/testing:move atomic,cpuload,getprime,smp and timerjitter folders to the new sched folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-26 00:23:15 +08:00
yintao
d3a1f80308 coredump: add error print
So we know if coredump exits with error, or there's no coredump.

Signed-off-by: yintao <yintao@xiaomi.com>
2025-01-24 09:34:47 +08:00
xuxingliang
1d1a8ba92e system/coredump: move coredump info to note
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-01-24 09:34:47 +08:00
Yanfeng Liu
048b3e6f7b examples/module: add hostfs support
This allows loading the kernel module from a hostfs file system.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-23 18:43:02 +08:00
tengshuangshuang
077c3461db apps/testing:merge case folder to the new mm folder
1.rename original  mm folder to heaptest and move it to mm folder

2.move the following folders into the new mm folder:
  cachetest, heaptest, iob, kasantest, memstress, memtester, ramtest, stressapptest

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-23 18:19:06 +08:00
Matteo Golin
acc2b390c3 examples/gps: Allow GPS serial port to be specified as command line argument, mark MINMEA dependency in Kconfig. 2025-01-23 14:31:14 +08:00
xuxin19
add50b3bd5 cmake(bugfix):fix NuttX CMake Wasm build multi dirs cannot be identified
System is unknown to cmake, create:
Platform/WASI to use this system, please post your config file on discourse.cmake.org so it can be added to cmake
Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please post that file on discourse.cmake.org.
CMake Error at CMakeLists.txt:100 (add_subdirectory):
  add_subdirectory given source
  /home/data/vela/tmp/apps/frameworks/security/ta/hello_world
  /home/data/vela/tmp/apps/frameworks/security/ta/" which is not an
  existing directory.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-01-23 14:26:08 +08:00
xuxin19
0b0a220c52 cmake(bugfix):fix wasm bin link entry missing issue
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-01-23 14:26:08 +08:00
xuxin19
aa7c63bfe1 cmake(bugfix):fix WASM install bin do not define error
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-01-23 14:26:08 +08:00
xuxin19
fb367c9792 cmake(enhance):Enhanced full WASM library and application compilation
1.add complete compilation FLAGS for wasm toolchain
2.wasm build no longer traverses the native directory, saving build time
3.implement OPT and AOT process actions for wasm files
4.create a bridge interface for navtie build and wasm build

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-01-23 14:26:08 +08:00
chao an
2ad162d27d system/cu: fix nxstyle error
$ ../nuttx/tools/checkpatch.sh -g HEAD~1
apps/system/cu/cu_main.c:5:78: error: Long line found

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-23 09:57:22 +08:00
chao an
dfb3fc9acf system/cu: remove canonical input mode from termios flag
ASCII_DEL will unable to handle after below change:
https://github.com/apache/nuttx/pull/14037

| commit df5c876932c4c82e8aee32adca651bb99d9d6200
| Author: zhangwenjian <zhangwenjian@xiaomi.com>
| Date:   Thu May 23 13:13:48 2024 +0800
|
|     libc:getline support backspace
|
|     Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>

remove canonical input mode to support backspace in cu

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-23 09:57:22 +08:00
tengshuangshuang
57c8a62e1e apps/testing:move arch_libc, fmemopen, scanftest folders to the new lib folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-22 17:18:30 +08:00
tengshuangshuang
8141e35f99 apps/testing:move epoll, fatutf8 ... folders to the new fs folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-22 01:34:00 +08:00
tengshuangshuang
6bc2b3c933 apps/testing:move {drivertest fftest irtest monkey nand_sim pcitest sd_bench sd_stress sensortest} folders to the new driver folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-21 16:22:56 +08:00
Eren Terzioglu
dca032ab18 examples/i2schar: Make tx/rx count value generic on transmit/recieve operations 2025-01-21 10:15:42 +08:00
Xiang Xiao
5330966762 nshlib: Replace the big temp buffer with lib_get_[path|temp]buffer
to save the stack consumption

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-20 22:39:35 +08:00
Xiang Xiao
131d50ae9d nshlib: Remove the unnecessary temp path buffer
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-20 22:39:35 +08:00
tengshuangshuang
903fbe41e9 apps/testing: move cxxsize,cxxtest and uclibcxx_test folders to the new cxx folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-20 21:15:21 +08:00
Neo Xu
e59ab2b3af gdbstub: change send buffer to const char
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-01-20 20:07:22 +08:00
Huang Qi
efcfd87b44 tools/Rust: Add support for panic_immediate_abort
Summary:
- Added support for `panic_immediate_abort` in Rust builds, which causes the system to abort immediately on panic instead of unwinding the stack
- Enabled `-Zbuild-std-features=panic_immediate_abort` flag for release builds when `CONFIG_DEBUG_FULLOPT` is set
- Updated both CMake and Makefile build systems to include the new flag

Impact:
- Significantly reduces binary size (e.g., from 2270605 to 84987 bytes for riscv64imc)
- Changes panic behavior to immediate abort, which may be preferred for embedded systems
- Improves system reliability by preventing undefined behavior from stack unwinding in constrained environments
- Maintains compatibility with existing Rust code while providing a more deterministic panic handling mechanism

For example, if it is enabled, the system will panic immediately:
```
NuttShell (NSH) NuttX-12.8.0
nsh> hello_rust_cargo
{"name":"John","age":30}
{"name":"Jane","age":25}
Deserialized: Alice is 28 years old
Pretty JSON:
{
  "name": "Alice",
  "age": 28
}
riscv_exception: EXCEPTION: Illegal instruction. MCAUSE: 0000000000000002, EPC: 0000000080027df6, MTVAL: 0000000000000000
riscv_exception: PANIC!!! Exception = 0000000000000002
dump_assert_info: Current Version: NuttX  12.8.0 8e3621e059 Jan 20 2025 14:45:00 risc-v
dump_assert_info: Assertion failed panic: at file: :0 task: hello_rust_cargo process: hello_rust_cargo 0x80020588
/* Stack dump from NuttX */
```
vs the default behavior:
```
NuttShell (NSH) NuttX-12.8.0
nsh> hello_rust_cargo
{"name":"John","age":30}
{"name":"Jane","age":25}
Deserialized: Alice is 28 years old
Pretty JSON:
{
  "name": "Alice",
  "age": 28
}

thread '<unnamed>' panicked at /home/huang/Work/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/sys/random/unix_legacy.rs:19:10:
failed to generate random data: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
nsh>
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-20 19:48:25 +08:00
tengshuangshuang
bdb0fcd71b apps/testing: move himem_test,mtetest and x86-64-ABI folders to the new arhc folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-20 17:48:48 +08:00
Huang Qi
9b6de015bc rust/hello: Optimize the build flags
Summary:
- Added `codegen-units = 1` and `opt-level = 'z'` to the release profile in `Cargo.toml`
- These changes optimize the build for minimal binary size

Impact:
- Reduces the final binary size by ~7% (244316 -> 228380 bytes)
- Improves resource utilization for embedded systems
- No functional changes to the application behavior

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-19 17:16:38 +08:00
Huang Qi
6669372415 wamr: Map armv7a/thumbv7a to armv7/thumbv7 for wamrc
Summary:
- Added explicit mapping of thumbv7a architecture to thumbv7 in the WAMR toolchain definitions
- WAMR's AOT compiler uses armv7/thumbv7 as the target architecture for all ARMv7-A processors
- This includes Cortex-A series processors like Cortex-A9 which use the armv7a/thumbv7a ISA

Impact:
- Fixes AOT compilation for ARM Cortex-A processors using thumbv7a architecture
- Maintains compatibility with WAMR's expected target architecture naming
- Ensures consistent architecture targeting across all ARMv7-A processors
- No impact on other architectures or build configurations

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-17 23:31:49 +08:00
wangjianyu3
f6462111b7 apps/nshlib: Reuse local variable for cmd_memdump
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-17 23:27:43 +08:00
zhangshoukui
339eeaa087 Use lib_get_tempbuffer Saving stack
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-16 22:49:19 +08:00
zhangshoukui
4685ca557b lp503x_main: Minor fix
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-16 22:48:45 +08:00
wangjianyu3
3108c27877 apps/nshlib: Save result and return ERROR if lib_get_tempbuffer() fails
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-16 22:48:34 +08:00
zhangshoukui
f8e4afbad3 optimize GPIO test for sim test pass
cmocka_driver_gpio //gpio input/output is tested by default
cmocka_driver_gpio -a /dev/gpio0 -b /dev/gpio1 -l // test loop
cmocka_driver_gpio -a /dev/gpio0 -b /dev/gpio0 // gpio input/output is tested by default

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-16 22:44:14 +08:00
zhangshoukui
b4def306fa Remove Useless filtering.The string for filtering rules should not point to a stack space
==1805058==ERROR: AddressSanitizer: heap-use-after-free on address 0xe18126a0 at pc 0x52b06320 bp 0xd7b13ee8 sp 0xd7b13ed8
READ of size 1 at 0xe18126a0 thread T0
    #0 0x52b0631f in tre_parse regex/regcomp.c:1356
    #1 0x52b2b1d0 in regcomp regex/regcomp.c:3710
    #2 0x48f55435 in c_regexmatch cmocka/src/cmocka.c:494
    #3 0x48f65bcf in _cmocka_run_group_tests cmocka/src/cmocka.c:3252
    #4 0x48f67e2d in cmocka_fs_test_main apps/testing/testsuites/kernel/fs/cmocka_fs_test.c:201
    #5 0x46210b2a in nxtask_startup sched/task_startup.c:72
    #6 0x45ff40fb in nxtask_start task/task_start.c:116
    #7 0x462695bb in pre_start sim/sim_initialstate.c:52

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-16 22:44:14 +08:00
tengshuangshuang
4432d84dd3 test:driver_audio bug fix
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-16 22:44:14 +08:00
wangjianyu3
410ca7d88e apps/nshlib: Remove the deprecated config NSH_LINELEN
NSH_LINELEN is replaced by POSIX standard LINE_MAX.

https://github.com/apache/nuttx/pull/15541
https://github.com/apache/nuttx-apps/pull/2943

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-16 20:54:50 +08:00