Commit graph

8160 commits

Author SHA1 Message Date
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
buxiasen
b75e404ec1 coredump: use llx to fix coverity report
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 07:36:36 +08:00
buxiasen
04f49f179b system/coredump: coredump restore independ and support mtd
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 07:36:36 +08:00
buxiasen
52bfcb3ab9 system/coredump: compatible restore name with NAME_MAX 32 Bytes
Coredump should compatible with default 32B NAME_MAX

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 07:36:36 +08:00
YAMAMOTO Takashi
6560618600 system/dd: improve EOF handling a bit 2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
9039b9cb18 system/dd: Fix a printf format 2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
f6f223e674 system/dd: portability to non-nuttx platforms
eg.
```
/opt/wasi-sdk-24.0/bin/clang -Wall -Oz -s -o dd.wasm dd_main.c
```
2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
1fed08e870 system/dd: make if= and of= optional 2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
1caf06bd77 system/dd: print help and abort on unknown options 2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
9c7a65e1e7 system/dd/dd_main.c: remove unnecessary header include 2024-11-28 15:20:13 +08:00
simbit18
0327abb483 build.yml: MSYS2 GitHub Action disable ccache and enable
You need to disable the msys2 cache from the GitHub action because we moved the Scheduled Merge Jobs to a new NuttX Mirror Repo and approaching total cache storage limit !!!

https://github.com/apache/nuttx/actions/caches

https://github.com/msys2/setup-msys2?tab=readme-ov-file#cache

Enable CMake+Ninja for Msys2
2024-11-26 18:11:31 +01:00
dependabot[bot]
3f418f482e build(deps): bump codelytv/pr-size-labeler from 1.10.1 to 1.10.2
Bumps [codelytv/pr-size-labeler](https://github.com/codelytv/pr-size-labeler) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/codelytv/pr-size-labeler/releases)
- [Commits](https://github.com/codelytv/pr-size-labeler/compare/v1.10.1...v1.10.2)

---
updated-dependencies:
- dependency-name: codelytv/pr-size-labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-26 10:10:47 +08:00
wangjianyu3
38b54f6fc5 system/adb: Waiting for enumeration to complete before opening endpoint
Env

  esp32s3-devkit:adb

Error

  adbd [3:100]

  NuttShell (NSH)
  nsh> adb_uv_usb_setup (154): failed to open usb device -1 2

Test
  + adb_log("Waiting for %s ..", ep);

  adbd [3:100]

  NuttShell (NSH)
  nsh> adbd_main (161): Waiting for /dev/adb0/ep0 ..

  nsh> ps
    PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK COMMAND
      0     0   0 FIFO     Kthread   - Ready              0000000000000000 0003008 Idle_Task
      1     0 224 RR       Kthread   - Waiting  Semaphore 0000000000000000 0008080 hpwork 0x3fc8bc00 0x3fc8bc24
      2     2 100 RR       Task      - Running            0000000000000000 0003992 nsh_main
      3     3 100 RR       Task      - Waiting  Semaphore 0000000000000000 0008112 adbd
  nsh>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-23 01:44:19 +08:00
YAMAMOTO Takashi
365869b0a2 testing/ostest/signest.c: fix the range of signals
Note that MAX_SIGNO is a valid signal number.
2024-11-22 13:31:33 +08:00
YAMAMOTO Takashi
54a571fc92 testing/ostest/wdog.c: remove a set-only global 2024-11-22 13:31:19 +08:00
anjiahao
3cbcbb6521 bin:Copy debug info to a separate folder
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-22 09:03:57 +08:00
yinshengkai
7fb7e21bf2 system: support gcov output to stdout
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-22 09:02:48 +08:00
wangjianyu3
70e7ad85ed system/adb: Fix log format error
The "%pV" format depends on libc extension

Log

  adbd_main (***): 0x3fc9175cV

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-22 09:01:38 +08:00
xuxin19
1b91e3c4a6 cmake:add missing rtptools CMake scripts
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-19 17:17:30 +08:00
xuxin19
fee82bd3d3 cmake(build):add missing basic and nxlooper cmake script
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-18 13:52:45 +08:00
xuxin19
4d301988a9 cmake(build):add benchmarks osperf CMakeLists.txt
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-17 21:10:55 +08:00
hujun5
d9d851813e testing: add iob test
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-17 21:10:25 +08:00
Xiang Xiao
c7530f5e45 quickjs: fix mp_mul multiple definition
in function `mp_mul':
apps/interpreters/quickjs/quickjs/libbf.c:1179: multiple definition of `mp_mul';
nuttx/staging/libapps.a:apps/math/libtommath/libtommath/bn_mp_mul.c:8: first defined here

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-16 21:34:11 +01:00
haopengxiang
f67097662f build(bugfix):fix uClibc++ layout build error
make[2]: *** No rule to make target '/home/nuttx/libs/libxx/uClibc++/tests/testframework.cpp',
needed by '/home/nuttx/libs/libxx/uClibc++/tests/testframework.cpp.home.apps.testing.uclibcxx_test.o'.  Stop.

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2024-11-16 21:33:32 +01:00
wangjianyu3
687c1cacd9 nshlib/cmd_wait: Wait failed if "PROCFS/PROCES" not enabled
Env

  sim:nsh
  - CONFIG_FS_PROCFS_EXCLUDE_PROCES=y

Error

  nsh> sleep 5 &
  sh [4:100]
  nsh> wait 4
  nsh: wait: wait failed: 2

cmd_wait():

  snprintf(path, sizeof(path), "/proc/%d/status", tid);

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-14 23:20:39 +08:00
Huang Qi
9f859e914d posix_spawn: Move dependencies to Kconfig
`posix_spawn` depends on these configurations:
- !BINFMT_DISABLE
- !DISABLE_MOUNTPOINT
- BOARDCTL
- BOARDCTL_APP_SYMTAB
- ELF
- FS_ROMFS

Check them in compile time may waste some time if the dependencies are not met,
move them to Kconfig to avoid this.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-14 17:22:27 +08:00
wangjianyu3
3c4ddd2802 nshlib/pipeline: Concat variable arguments failed
1. Without this patch

  nsh> set var_test `uname`
  nsh> echo $var_test
  NuttX
  nsh> echo $var_test | cat
  sh [5:100]

  nsh>

2. With this patch

  nsh> set var_test `uname`
  nsh> echo $var_test
  NuttX
  nsh> echo $var_test | cat
  sh [4:100]
  NuttX
  nsh>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-14 15:51:40 +08:00
buxiasen
3a6ecb82b5 nshlib/nsh_parse: Fix variable arguments concat error of nsh_execute()
Without this patch

  nsh> set time 5
  nsh> echo $time
  5
  nsh> sleep $time &
  sh [5:100]
  nsh> nsh: sleep: missing required argument(s)

With this patch

  nsh> set time 5
  nsh> echo $time
  5
  nsh> sleep $time &
  sh [4:100]
  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 0x501760e0 0x50176128
      3     3 100 FIFO     Task      - Running            0000000000000000 0067536 nsh_main
      4     4 100 FIFO     Task      - Waiting  Signal    0000000000000000 0067520 sh -c sleep

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-14 15:49:14 +08:00
xuxin19
1c7a7f7529 cmake(bugfix):add INCLUDE_DIRECTORIES for nimble
/github/workspace/sources/apps/examples/nimble/nimble_main.c:40:10: fatal error: nimble/nimble_npl.h: No such file or directory
   40 | #include "nimble/nimble_npl.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-13 21:58:26 +08:00
wangmingrong1
378afdebd5 gprof: modify depends on
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-13 21:58:07 +08:00
anjiahao
59855a1a67 remove <nuttx/xxx.h> in stdio need add depend header file
libuv:
CC:  pthread/pthread_mutexattr_setrobust.c libuv/src/unix/thread.c: In function ‘uv_thread_create_ex’:
libuv/src/unix/thread.c:174:24: error: storage size of ‘param’ isn’t known
  174 |     struct sched_param param;
      |                        ^~~~~

btsak_main:
In file included from btsak_main.c:39:
btsak.h:149:1: error: unknown type name ‘bool’
  149 | bool btsak_str2bool(FAR const char *str);

pipe_main.c:
CC:  sim/sim_registerdump.c pipe_main.c:44:30: error: unknown type name ‘pthread_addr_t’
   44 | static void *open_write_only(pthread_addr_t pvarg)
      |                              ^~~~~~~~~~~~~~
pipe_main.c: In function ‘pipe_main’:
pipe_main.c:81:3: error: unknown type name ‘pthread_t’
   81 |   pthread_t writeonly;

redirect_test.c: In function ‘redirection_test’:
redirect_test.c:205:3: error: unknown type name ‘pthread_t’
  205 |   pthread_t readerid;
      |   ^~~~~~~~~
redirect_test.c:206:3: error: unknown type name ‘pthread_t’
  206 |   pthread_t writerid;
      |   ^~~~~~~~~

drivertest_posix_timer.c:48:29: error: ‘optarg’ undeclared (first use in this function)
   48 |       value = (type)strtoul(optarg, &ptr, base);                      \

drivertest_posix_timer.c:208:3: warning: implicit declaration of function ‘sleep’ [-Wimplicit-function-declaration]
  208 |   sleep(SLEEPSECONDS);
      |   ^~~~~

drivertest_uart.c:92:13: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
   92 |       len = read(fd, &tmp_char, 1);
      |             ^~~~
      |             fread

drivertest_uart.c:323:44: error: ‘optopt’ undeclared (first use in this function)
  323 |             printf("Unknown option: %c\n", optopt);

kernel/fs/cases/fs_getfilep_test.c:71:9: warning: implicit declaration of function ‘fs_getfilep’ [-Wimplicit-function-declaration]
   71 |   ret = fs_getfilep(fileno(fp), &filep);
      |         ^~~~~~~~~~~

kernel/mm/cases/mm_test_008.c:148:9: warning: implicit declaration of function ‘task_create’; did you mean ‘timer_create’? [-Wimplicit-function-declaration]
  148 |   pid = task_create("TestNuttx08_routine_1",
      |         ^~~~~~~~~~~
      |         timer_create

/home/ajh/work/nuttxwork/apps/testing/cmocka/cmocka_main.c:171:11: warning: implicit declaration of function ‘setenv’ [-Wimplicit-function-declaration]
  171 |           setenv("CMOCKA_XML_FILE", xml_path, 1);
      |           ^~~~~~

drivertest_pm_runtime.c:123:7: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
  123 |       usleep(210 * 1000);
      |       ^~~~~~

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-13 16:49:12 +08:00
xuxin19
37bab55843 cmake(bugfix):reduce static library propagation behavior
This will cause duplicate definitions during the link  process

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-13 16:39:50 +08:00
cuiziwei
2a76d17e10 cxxtest: Add static string test.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-13 13:18:17 +08:00
wangmingrong1
bb03ef0ce3 gcov: modify depends on
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-13 02:38:42 +08:00
anjiahao
dfbf408567 stdio.h:Remove unnecessary header file, app header change
stdio.h remove <nuttx/xxxx.h>  Some .c previously depended on
<nuttx/xxx.h> and needed to be added to .c instead of stdio.h

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-12 19:37:10 +08:00
jianglianfang
0c467dc02d audioutils/nxaudio: added pause/resume interface in nxaudio.h
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-11-11 17:18:09 +08:00
zhushiqshi
1f5ec0bfe7 apps/rexecd: add more trace info when failed
Signed-off-by: zhushiqi <zhushiqshi@xiaomi.com>
2024-11-11 17:17:52 +08:00
zhushiqshi
de8080dbff apps/rexecd: fix bind failed return 13
Signed-off-by: zhushiqi <zhushiqshi@xiaomi.com>
2024-11-11 17:17:52 +08:00
wenlingyun1
4a1c40aa96 update quickjs patch for cmake compilation
Signed-off-by: wenlingyun1 <wenlingyun1@xiaomi.com>
2024-11-11 17:17:22 +08:00