Commit graph

8198 commits

Author SHA1 Message Date
Alin Jerpelea
440d69a310 canutils: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
e41ef49995 builtin: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
087cac4471 database: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
7fe01f1c52 cmake: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
dc4bf4a5fb boot: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
69b6c936d1 benchmarks: migrate license to ASF
Xiaomi has submitted the SGA and we can migrate the licese to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
41e51e68a2 benchmarks: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
7e9cf0237d audioutils: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
wangjianyu3
39bd365787 nshlib/nsh_parse: Removing unnecessary value assigning about redirection
Coverity Log

  CID 1612757: (#1 of 1): UNUSED_VALUE
  assigned_value: The value -1 is assigned to param.fd_in here, but the stored value is overwritten before it can be used.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-19 14:11:55 +08:00
wangjianyu3
f1212a6065 nshlib/nsh_parse: Closing fds opened for redirection if necessary
Coverity Log

  CID 1612743: (#1 of 1): Resource leak (RESOURCE_LEAK)
  12. leaked_handle: The handle variable fd_out goes out of scope and leaks the handle.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-19 14:11:55 +08:00
Xiang Xiao
adb4c3b555 testing/testsuites: Fix format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'size_t'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-12-19 04:22:09 +01:00
zhangshoukui
cebd77c614 fs cases: fix compile error
kernel/fs/cases/fs_stream_test.c:279:70: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=]
  279 |           syslog(LOG_ERR, "len = %zi != return value from fwrite = %zi",
      |                                                                    ~~^
      |                                                                      |
      |                                                                      long int
      |                                                                    %i
  280 |                  len, ret);
      |                       ~~~
      |                       |
      |                       int
kernel/fs/cases/fs_stream_test.c:311:69: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=]
  311 |           syslog(LOG_ERR, "len = %zi != return value from fread = %zi",
      |                                                                   ~~^
      |                                                                     |
      |                                                                     long int
      |                                                                   %i
  312 |                  len, ret);
      |                       ~~~
      |                       |
      |                       int

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-19 04:22:09 +01:00
chao an
d6f6f5ce11 mlearning/tflite-micro: fix build break if enable cmsis-nn and neon
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-19 02:00:48 +08:00
Tiago Medicci
231827e84e ostest: Add test for GCC's tls (CONFIG_SCHED_THREAD_LOCAL)
Enables testing the GCC thread local storage (tls) and the __thread
keyword within ostest.
2024-12-18 22:46:04 +08:00
wangmingrong1
c4fa568457 gcov: Add a signature end statement to test statement matching
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-18 22:45:39 +08:00
YAMAMOTO Takashi
3efbed1f27 system/libuv/Kconfig: depends on CONFIG_PIPES
libuv unconditionally uses pipe().

Fixes: https://github.com/apache/nuttx/issues/14773
2024-12-18 20:04:21 +08:00
YAMAMOTO Takashi
d8faa9b18e interpreters/luamodules/luv: use "depends on" instead of "select" 2024-12-18 20:04:12 +08:00
tengshuangshuang
1e199e4d4f test:add mutex socket syscall directory
some test cases have been added that cover the functionality of fs, mutex, pthread, socket, and syscall

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2024-12-18 17:43:33 +08:00
YAMAMOTO Takashi
53db7817d9 Remove all references to CONFIG_SCHED_ATEXIT
It has been removed a few years ago.
https://github.com/apache/nuttx/pull/6197
2024-12-18 17:42:24 +08:00
chao an
9c8a96aa51 nshlib: add support for disable sigmask from ps command
before:

nsh> ps
  PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK COMMAND
    0     0   0 FIFO     Kthread   - Ready              0000000000000000 0069616 Idle_Task
    1     0 224 FIFO     Kthread   - Waiting  Signal    0000000000000000 0067536 loop_task
    2     0 224 FIFO     Kthread   - Waiting  Semaphore 0000000000000000 0067504 hpwork 0x400fcfe0 0x400fd028
    3     3 100 FIFO     Task      - Running            0000000000000000 0067536 nsh_main

after:

nsh> ps
  PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT       STACK COMMAND
    0     0   0 FIFO     Kthread   - Ready              0069616 Idle_Task
    1     0 224 FIFO     Kthread   - Waiting  Signal    0067536 loop_task
    2     0 224 FIFO     Kthread   - Waiting  Semaphore 0067504 hpwork 0x400fcfe0 0x400fd028
    3     3 100 FIFO     Task      - Running            0067536 nsh_main

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-18 11:48:16 +08:00
wangjianyu3
7e77ab29e5 uORB/sensor: Add macro for satellite format string
Make it easier to extend the format of struct member

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-18 09:38:54 +08:00
zhangshoukui
2e0b577680 drivertest_uart: The string was not truncated because one more character was read
#0 0x43c7443a in strnlen nuttx/libs/libc/string/lib_strnlen.c:42
    #1 0x43c698aa in vsprintf_internal nuttx/libs/libc/stdio/lib_libvsprintf.c:933
    #2 0x43c6ca80 in lib_vsprintf nuttx/libs/libc/stdio/lib_libvsprintf.c:1383
    #3 0x4409c0bd in vsnprintf nuttx/libs/libc/stdio/lib_vsnprintf.c:72
    #4 0x47137cd0 in vcmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2097
    #5 0x47139573 in cmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2422
    #6 0x471376ff in string_equal_display_error apps/testing/cmocka/cmocka/src/cmocka.c:1410
    #7 0x471379a0 in _assert_string_equal apps/testing/cmocka/cmocka/src/cmocka.c:1952
    #8 0x4433d972 in read_default apps/testing/drivertest/drivertest_uart.c:242
    #9 0x4713c6cd in cmocka_run_one_test_or_fixture apps/testing/cmocka/cmocka/src/cmocka.c:3029
    #10 0x4713d487 in cmocka_run_one_tests apps/testing/cmocka/cmocka/src/cmocka.c:3143
    #11 0x4713f2ca in _cmocka_run_group_tests apps/testing/cmocka/cmocka/src/cmocka.c:3294
    #12 0x443444c6 in cmocka_driver_uart_main apps/testing/drivertest/drivertest_uart.c:358
    #13 0x4409a472 in nxtask_startup nuttx/libs/libc/sched/task_startup.c:72
    #14 0x43dc92e7 in nxtask_start nuttx/sched/task/task_start.c:116
    #15 0x43e31f00 in pre_start nuttx/arch/sim/src/sim/sim_initialstate.c:52

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-17 16:06:13 +08:00
hujun5
32ee7611bb fix a typo
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 12:06:32 +08:00
Lup Yuen Lee
9c5568c2af testing/ltp: Increase Stack Size
Inside CI Build risc-v-05: `rv-virt:citest` fails with a Stack Overflow at ltp_interfaces_pthread_barrierattr_init_2_1:
- https://github.com/apache/nuttx/issues/15170

This PR doubles the Stack Size for `testing/ltp` (from 4096 bytes to 8192), so that `rv-virt:citest` completes successfully.
2024-12-17 02:20:15 +08:00
buxiasen
fa22f80ee3 ramspeed: fix dest align typo, add not-aligned print
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-12 13:48:19 +08:00
chao an
e861ea8b53 nshlib/[cd|ls|pwd]: add support for local CWD(Current working directory)
This PR will still allow basic shell operations such as cd/ls/pwd to be used even when the environment is disabled.

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 02:12:55 +08:00
Tiago Medicci
d7ed69200f interpreters/python: Avoid warnings that could be treated as errors
This commit disables some warnings when building CPython to avoid
CI failing when `EXTRAFLAGS="-Wno-cpp -Werror"` is set.
2024-12-12 02:12:25 +08:00
buxiasen
1f8b9aa74c drivertest: update comment in driver test Kconfig
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-11 01:28:27 +08:00
buxiasen
b232fa42cf drivertest: add arm-m signal through isr case
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-11 01:28:27 +08:00
chao an
9c5a2ad062 mlearning/tflite-micro: add a config option to redirect micro log to syslog
new config option TFLITEMICRO_SYSLOG to redirect micro log to syslog

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-10 18:11:27 +08:00
chao an
37acd5e671 mlearning: fix build break if enable cmsis-nn
apps/mlearning/tflite-micro/tflite-micro/tensorflow/lite/micro/kernels/cmsis_nn/conv.cc:18:10:
  fatal error: Include/arm_nnfunctions.h: No such file or directory
   18 | #include "Include/arm_nnfunctions.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-09 17:29:05 +08:00
Eren Terzioglu
9411e898e6 Move verbose option to common use 2024-12-07 11:38:10 +08:00
Eren Terzioglu
95a8c43b73 apps/nxdiag: Add dignostic info without esptool support for Espressif devices 2024-12-07 11:38:10 +08:00
Eren Terzioglu
f2e5d5c13f apps/nxdiag: Add dignostic info logging support during build on nxdiag example for Espressif devices 2024-12-07 11:38:10 +08:00
wangmingrong1
f1ae5f32f5 mtetest: Add a series of tests for the mte instruction set
Added basic mte instructions, ldg, stg, irg, gmi instruction tests

➜  NX git:(master) ✗ qemu-system-aarch64 -cpu max -nographic \
        -machine virt,virtualization=on,gic-version=3,mte=on \
        -chardev stdio,id=con,mux=on, -serial chardev:con \
        -mon chardev=con,mode=readline  -kernel ./nuttx/nuttx
- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize

NuttShell (NSH)
nsh>
nsh>
nsh> mtetest
Spawning process for test: mtetest1
Running test: mtetest1
Test 'mtetest1' completed
Spawning process for test: mtetest2
Running test: mtetest2
Test 'mtetest2' completed
Spawning process for test: mtetest3
Running test: mtetest3
Test 'mtetest3' completed
Spawning process for test: mtetest4
Running test: mtetest4
Test 'mtetest4' completed
Spawning process for test: mtetest5
Running test: mtetest5
Test 'mtetest5' completed
All tests completed.
nsh>

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-06 19:44:12 -03:00
Tiago Medicci
efc1bf710c interpreters/python: Add Python's port to NuttX
This is the NuttX's port of Python (cpython)!

Initial support of Python includes building the Python's static
library and the `python` (Programs/python.c) application. Python's
modules are stored in `pyc` (byte-code file) and loaded as needed
from flash.
2024-12-06 19:42:09 -03:00
Tiago Medicci
9d7714f843 system/nxdiag: Change the order to generate the sysinfo.h file
The generation of `sys info.h` depends on evaluating whether
Espressif's HAL exists in the arch folder. However, cloning the HAL
itself happens in the `context` phase of the build, so it is
necessary to wait for it to finish before proceeding to the
evaluation in nxdiag. This is done by using the `depend` phase to
generate the `sysinfo.h` file.
2024-12-06 22:30:25 +08:00
wangjianyu3
b08c29617b system/usbmsc: Add support for setting paths that bind to LUN at runtime
Help

  nsh> msconn -h
  Usage: msconn [-o OPTION]... [-l LUNs]...
  Configures the USB mass storage device and exports the LUN(s).

  Supported arguments
    -o
        nc: No const LUN
        ro: Readonly
        rw: Read/Write(default)
    -l
        Device path to export

  Examples
    1. Export const LUN(s) only
        msconn
    2. Export /dev/ramx and const LUN(s)
        msconn -l /dev/ramx

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-06 08:56:30 +08:00
George Poulios
6600a5fd08 MbedTLS: patch warning when DTLS is off
This is to patch upstream MbedTLS issue:
  https://github.com/Mbed-TLS/mbedtls/issues/9425
that triggers a -Werror=undef when MBEDTLS_SSL_PROTO_DTLS
is undefined. There is no other way to silence that warning
and it breaks builds in systems with -Werror. Once the
upstream issue is resolved, this can be reverted.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2024-12-05 13:45:38 +08:00
wangmingrong1
818a3e6b63 kasantest.c: Adding Dependencies
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-04 22:36:04 +08:00
pengyiqiang
ce217b8744 lvgldemo: add LVGL duplicate initialization protection
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-12-02 19:50:19 +08:00
chao an
296d5d15af tflm: add tflm hello world example into nuttx build
1. add tflm hello world example into nuttx build
2. add tflm model convert flow

Test on sim/tflm

$ cmake -B build -DBOARD_CONFIG=sim/tflm -GNinja
$ cmake --build build
$ ./build/nuttx

NuttShell (NSH) NuttX-10.4.0
nsh> tflm_hello
0 (id=0): size=16, offset=0, first_used=0 last_used=1
1 (id=1): size=64, offset=64, first_used=1 last_used=2
2 (id=2): size=64, offset=0, first_used=2 last_used=3
3 (id=3): size=16, offset=64, first_used=3 last_used=3
 0: 0000000000...................................................................... (1k)
 1: 0000000000..............................1111111111111111111111111111111111111111 (1k)
 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k)
 3: 22222222222222222222222222222222222222223333333333.............................. (1k)

"Unique Tag","Total ticks across all events with that tag."
FULLY_CONNECTED, 0
"total number of ticks", 0

[RecordingMicroAllocator] Arena allocation total 2344 bytes
[RecordingMicroAllocator] Arena allocation head 128 bytes
[RecordingMicroAllocator] Arena allocation tail 2216 bytes
[RecordingMicroAllocator] 'TfLiteEvalTensor data' used 240 bytes with alignment overhead (requested 240 bytes for 10 allocations)
[RecordingMicroAllocator] 'Persistent TfLiteTensor data' used 128 bytes with alignment overhead (requested 128 bytes for 2 tensors)
[RecordingMicroAllocator] 'Persistent buffer data' used 1152 bytes with alignment overhead (requested 1100 bytes for 7 allocations)
[RecordingMicroAllocator] 'NodeAndRegistration struct' used 192 bytes with alignment overhead (requested 192 bytes for 3 NodeAndRegistration structs)
0 (id=0): size=16, offset=0, first_used=0 last_used=1
1 (id=1): size=64, offset=64, first_used=1 last_used=2
2 (id=2): size=64, offset=0, first_used=2 last_used=3
3 (id=3): size=16, offset=64, first_used=3 last_used=3
 0: 0000000000...................................................................... (1k)
 1: 0000000000..............................1111111111111111111111111111111111111111 (1k)
 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k)
 3: 22222222222222222222222222222222222222223333333333.............................. (1k)
0 (id=0): size=16, offset=16, first_used=0 last_used=1
1 (id=1): size=16, offset=0, first_used=1 last_used=2
2 (id=2): size=16, offset=16, first_used=2 last_used=3
3 (id=3): size=16, offset=0, first_used=3 last_used=3
 0: ................0000000000000000................................................ (1k)
 1: 11111111111111110000000000000000................................................ (1k)
 2: 11111111111111112222222222222222................................................ (1k)
 3: 33333333333333332222222222222222................................................ (1k)
~~~ALL TESTS PASSED~~~

nsh>

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-02 13:33:55 +08:00
George Poulios
0b3428942f Update MbedTLS 3.4.0 -> 3.6.2 and set it as default
Even though one could in theory simply set CONFIG_MBEDTLS_VERSION="3.6.2",
this commit is needed for 2 reasons:
  1. The patches need to be updated: 0001 works almost as-is (with fuzz 2)
     but 0002 hunk #4 fails and needed adjustment. Otherwise, the patches
     are identical.
  2. mbedtls_config.h needs to be updated: Following the same approach
     for the Kconfig this commit updates both Kconfig and mbedtls_config.h
     according to the changes:
       mbedtls$ git diff v3.4.0...v3.6.2 -- include/mbedtls/mbedtls_config.h

Minor edits also to crypto/controlse to comply with v3.6.2.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2024-12-01 17:57:21 +08:00
chao an
8b253d699c mlearning/tflite-micro: add tflm tool into cmake build
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
3fd04e86e8 math/ruy: remove ruy library from cmake list
ruy is not really used, tflite just uses the header file

Error log from CMake:
================================================================
-- Configuring done (2.1s)
CMake Error at cmake/nuttx_add_library.cmake:183 (add_library):
  No SOURCES given to target: ruy
Call Stack (most recent call first):
  apps/math/ruy/CMakeLists.txt:57 (nuttx_add_library)

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
5cb1cc7ac7 mlearning/tflite-micro: correct include patch of support library
1. correct include patch of support library
2. add flatbuffers include path

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
581b4cb673 mlearning/CMakeLists: include subdirectory to ensure ML module could be compile
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
8bc824a5e7 system/tflite-micro: fix patch flow of tflite-micro
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
bd94b6da1a system/flatbuffers: fix patch flow of flatbuffers
Applying patch to flatbuffers
patching file '<'
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file '<.rej'
patching file '<'
Hunk #1 FAILED at 39.
1 out of 1 hunk FAILED -- saving rejects to file '<.rej'
patching file '<'
Hunk #1 FAILED at 495.
1 out of 1 hunk FAILED -- saving rejects to file '<.rej'
patching file '<'
Hunk #1 FAILED at 23.
1 out of 1 hunk FAILED -- saving rejects to file '<.rej'
patch: **** Can't reopen file '<' : No such file or directory
-- Configuring done (12.8s)
-- Generating done (0.3s)

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
buxiasen
22d5d1d9d8 coredump: move definition out of types
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 07:36:36 +08:00