Commit Graph

7370 Commits

Author SHA1 Message Date
raiden00pl
89cf6b4ce6 cmake: add smp test 2024-02-05 08:46:22 -08:00
raiden00pl
9921571674 cmake: add cachespeed 2024-02-05 08:46:22 -08:00
raiden00pl
364ca42837 cmake: fix spinlock_bench compilation 2024-02-05 08:46:22 -08:00
YAMAMOTO Takashi
46888aa8e4 toywasm: regen for v38
```
REF=b3e060f308db23e21aaa3004484bf9335e4d3fcc ./regen.sh
```
2024-02-05 03:37:32 -08:00
YAMAMOTO Takashi
aba3e27c6c toywasm: update to v38 2024-02-05 03:37:32 -08:00
Ville Juven
0f31a8d98e nsh_fscmds.c: Fix CONFIG_FS_SHM -> CONFIG_FS_SHMFS
The define macro was wrong
2024-01-31 08:52:05 -08:00
chao an
0968264ac0 nshlib: fix build break if CONFIG_CPP_HAVE_VARARGS if undefined
ctc E272: ["nsh_ddcmd.c" 197/7] undeclared identifier "vtbl"

Signed-off-by: chao an <anchao@lixiang.com>
2024-01-30 20:44:05 -08:00
wangyongrong
32f269a079 nsh_syscmds: update rptun_ping to rpmsg_ping, add cmd_rpmsg.
To support rpmsg ioctl, add cmd_rpmsg function, and update rptun ping to rpmsg ping.
depends on apache/nuttx#11618

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-30 20:42:49 -08:00
YAMAMOTO Takashi
b43340b0aa toywasm: regen
```
REF=15e6585cecd8049a03a901a4ed8a6b2dd3c18e48 ./regen.sh
```
2024-01-30 04:09:27 -08:00
YAMAMOTO Takashi
df573bb024 toywasm: bump the version 2024-01-30 04:09:27 -08:00
Yanfeng Liu
d381699ac1 testing/getprime: add cmake support
add CMakeLists.txt to support building with CMake

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-27 00:56:13 -08:00
yangjian11
09122debe9 nsh_timcmds: display date using set format
Reference: https://www.geeksforgeeks.org/date-command-linux-examples/?ref=gcse#9-list-of-format-specifiers-used-with-date-command

Signed-off-by: yangjian11 <yangjian11@xiaomi.com>
2024-01-26 19:13:25 -08:00
Michal Lenc
61d1f37f5f nsh_timcmds: show RTC time in timedatectl command only if CONFIG_RTC_DRIVER is set
NuttX build fails otherwise as required structures are not included.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-01-26 09:45:03 -08:00
Junbo Zheng
c699b05f74 nshlib: add expr command support
It is a mini version for the `expr` command, which implements the features of addition, subtraction, multiplication, division and mod.

Reference: https://www.geeksforgeeks.org/expr-command-in-linux-with-examples/

bl2>
bl2> expr 1 + 2
3
bl2> expr
Usage: expr <operand1> <operator> <operand2>
bl2> expr 5 - 2
3
bl2> set hello 10
bl2> expr $hello - 2
8
bl2> expr 8 a 9
Unknown operator
bl2> expr 20 / 5
4
bl2> expr 10 % 4
2
bl2> expr 10 / 0
operand2 invalid
bl2>
bl2> expr mi + 100
invalid parameter
bl2> expr 100 + mi
invalid parameter
bl2> expr 100 + 0
100

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2024-01-25 18:12:28 -08:00
Yanfeng Liu
596328ccca nshcmd/rptun: align help mesg with impl
the ping subcommand is guarded with RPTUN_PING in its handler.
its help mesg should have same guard to avoid confusing user.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-25 18:11:39 -08:00
xuchaojie
ca5293629f wapi: Add pscan cmd to trigger a passive scan.
Added scanning in passive mode without affecting the scan command.

Signed-off-by: xuchaojie <xuchaojie@xiaomi.com>
2024-01-25 03:10:06 -08:00
SPRESENSE
a16fb23dd7 lte/alt1250: Notice instance information
Notice instance information of LwM2M server operation to application.
2024-01-24 22:21:56 +01:00
Takeyoshi Kikuchi
c82aa9f683 config.nims: fix NimSuggest crash.
When editing in VSCode, NimSuggest refers to config.nims and tries
to find the NuttX .config.
Fixed a problem that .config cannot be read because the environment
variable "TOPDIR" is not defined.

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2024-01-23 04:03:59 -08:00
dependabot[bot]
dabdad732e build(deps): bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 23:17:06 -08:00
Yanfeng Liu
14d4059159 Zig: revise apps build support
This requires nuttx/pull/11548 to work.

- Zig apps can use normal entrance "main()" now as we
- added RENAMEMAIN for none BUILD_MODULE case.
- enabled Zig program building in BUILD_MODULE case.

Note the Zig main source need to have "fn main(" pattern as
renaming is implemented via `sed`.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-21 06:21:18 -08:00
Huang Qi
dbcbec363d wamr: Add new option to enable quick aot entry
Enable AOT quick entry to improve performance for call
AOTed function from host side in some cases with simple
signature.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-01-19 01:02:59 -08:00
YAMAMOTO Takashi
70108ae59e wamr: bump the default stack guard size
using 0 by default seems a bit too aggressive to me.

1024 here is what would have been used before this kconfig knob
was introduced by https://github.com/apache/nuttx-apps/pull/1259.
It also matches some expectations in the recent wamrc.
40b430fd24/core/iwasm/compilation/aot_emit_aot_file.c (L2672-L2678)
2024-01-19 09:08:10 +01:00
zhanghongyu
9c48a8d4fc iperf: add parameters to support dynamic device bind
In addition to the CONFIG_NETUTILS_IPERFTEST_DEVNAME configuration, you can specify network cards by parameter to support devices with multiple network interface

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-17 00:54:31 -08:00
Xiang Xiao
e4e43a1ca0 adb: Don't declare variables in the middle of function
and unify the prefix from ADB to ADBD

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-01-15 19:29:57 +08:00
Xiang Xiao
db0e0b9bfe adbd/logcat: Change alog_ prefix to logcat_
to unify the prefix usage in the code base

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-01-15 19:29:57 +08:00
YAMAMOTO Takashi
8930743831 Wasm.mk: disable by default
Fixes partly: https://github.com/apache/nuttx-apps/issues/2046

Also, this fixes warnings like:
```
spacetanuki% ./tools/configure.sh -E sim:wamr
  Copy files
  Select CONFIG_HOST_MACOS=y
  Refreshing...
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory              /usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
CP: arch/dummy/Kconfig to /Users/yamamoto/git/nuttx/nuttx/arch/dummy/dummy_kconf
ig
CP: boards/dummy/Kconfig to /Users/yamamoto/git/nuttx/nuttx/boards/dummy/dummy_k
config
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory

```
2024-01-13 02:16:16 -08:00
wangyongrong
7047fa5bde nsh syscmds: add CONFIG_RPTUN_PING when use rptun_ping
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-13 02:15:55 -08:00
wangyongrong
5f1de35936 rpsock_client.c: fix printf format warning
rpsock_client.c:203:30: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
  203 |                       printf("client check fail total %d, \
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  204 |                               i %d, %08" PRIx32 ", %08x\n",
      |                               ~~~~~~~~~~
  205 |                               ALIGN_UP(total), i, intp[i],
  206 |                               (ALIGN_UP(total) / sizeof(uint32_t) + i));
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                   |
      |                                                                   long unsigned int

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-12 01:22:23 -08:00
fangxinyong
385f707382 nshlib: move etc romfs mount from nsh to nuttx
This commit corresponds to apache/nuttx#11498 in nuttx.

Move etc romfs mount to sched/init for compatibility with kernel/protected mode.

changes:
- move etc romfs mount from nsh to Nuttx, but keep the script to parse and execute.
- move and rename the related CONFIG, move customized nsh_romfsimg.h to etc_romfs.c
  in boards, and no need declaration for romfs_img/romfs_img_len.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-01-09 21:25:19 -08:00
Huang Qi
c4e78cd10a wamr: Add new option to enable tail call support
See also:
https://github.com/bytecodealliance/wasm-micro-runtime/pull/2975

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-01-06 04:34:50 -08:00
Bowen Wang
2a08d17ed6 nsh_mmcmds: support "memdump -h/help" to show usage and sequence number
Compare with "cat /proc/memdump", use "memdump -h/help" is more
convenient.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-01-06 04:34:27 -08:00
Bowen Wang
3d4442207d nsh_ddcmd: print errno instead the return value when dd failed
Print the errno gives more information to debug the dd failed
problem.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-01-06 04:34:07 -08:00
wangyongrong
51762a8958 nsh cmd rptun: add rptun ping useage description
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-06 04:33:48 -08:00
zhanghongyu
d9f467dd8e libcoap: add cmake script
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-06 04:32:41 -08:00
zhanghongyu
ce735f4136 libcoap: add makefile and Kconfig
server:
when ipv6 is enable:
ap> coap_server
only ipv4 is enable, we need to specify the ip address of the network card:
ap> coap_server -A [ipv4 address]

client:
ap> coap_client -m get coap://[ipv4/6 address]/time
Dec 26 06:41:12

Other Examples:
	coap_client -m get coap://[::1]/
	coap_client -m get coap://[::1]/.well-known/core
	coap_client -m get coap+tcp://[::1]/.well-known/core
	coap_client -m get coap://%2Funix%2Fdomain%2Fpath%2Fdgram/.well-known/core
	coap_client -m get coap+tcp://%2Funix%2Fdomain%2Fpath%2Fstream/.well-known/core
	coap_client -m get coaps://[::1]/.well-known/core
	coap_client -m get coaps+tcp://[::1]/.well-known/core
	coap_client -m get coaps://%2Funix%2Fdomain%2Fpath%2Fdtls/.well-known/core
	coap_client -m get coaps+tcp://%2Funix%2Fdomain%2Fpath%2Ftls/.well-known/core
	coap_client -m get -T cafe coap://[::1]/time
	echo -n 1000 | coap-client -m put -T cafe coap://[::1]/time -f -

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-06 04:32:41 -08:00
Yanfeng Liu
cf27f085f5 add const for romfs_img_len
this makes both declarations read-only as they are corelated.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-04 09:12:48 -08:00
Lee Lup Yuen
41a4963515 config.nims: Support Nim Apps for RISC-V 32-bit and 64-bit
NuttX Build fails when it compiles `examples/hello_nim` for RISC-V (32-bit and 64-bit). That's because the Nim Config Script `config.nims` couldn't identify the Nim Target Platform: `riscv32` or `riscv64`.

This PR fixes `config.nims` so that Nim Compiler correctly derives the Nim Target Platform (`riscv32` or `riscv64`), by searching NuttX `.config` for `CONFIG_ARCH_FAMILY=rv32` or `rv64`.

This logic is slightly different from the Nim Targets `arm` and `arm64`, which are currently derived from `CONFIG_ARCH=arm` and `arm64`.

`config.nims` is explained in this article: https://lupyuen.github.io/articles/nim#inside-nim-on-nuttx
2024-01-04 09:11:34 -08:00
Xiang Xiao
e55c0d9aa5 Remove @ tag from all comments
and format the multiple line comments

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-01-04 10:26:49 +01:00
Zhe Weng
9489659890 netutils/ping: Optimize stack usage of icmp_ping
Can reduce 88~144 Bytes on ARMv7-A depending on optimization level.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-01-02 19:47:23 +01:00
Lee Lup Yuen
16bca8b568 examples/hello_nim: Fix nimcache location
The Nim Example App fails to build because the `.nimcache` is located 2 folders up. This PR fixes the location of `.nimcache` in the `Makefile` of the Nim Example App.

`.nimcache` is explained in this article: https://lupyuen.github.io/articles/nim#inside-nim-on-nuttx
2024-01-02 09:52:54 -08:00
Zhe Weng
4c0bd143eb nshlib/ifconfig: Let "dns" option depends on CONFIG_NETDB_DNSCLIENT
"dns" option of `ifconfig` can work just with `CONFIG_NETDB_DNSCLIENT`,
no need to depend on `CONFIG_NETINIT_DNS` or `CONFIG_NETINIT_DHCPC`.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-12-30 01:40:05 -08:00
renjianguang
d9b8a0ee62 drivertest: Fix drivertest_audio crash
1.call AUDIOIOC_RELEASE when finished
2.make sure the driver dequeue all buffers before free the buffers

Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2023-12-28 05:38:58 -08:00
Yanfeng Liu
4d9f2e3692 optional argument for generated ROMFS file path.
existing headerfile path is used when argument is missing.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2023-12-28 05:36:18 -08:00
fangxinyong
ba075747be ostest: Add initial support for CONFIG_BUILD_KERNEL
task_* APIs are unavailable in kernel build mode, replacing with
posix_spawn or pthread_* API to pass the case. But posix_spawn requires
some dependency, for example CONFIG_BUILTIN and CONFIG_LIBC_EXECFUNCS,
so pthread_* APIs are used in most scenarios. Some tests should be
re-visited because the intent is to user another task (in this case
another process) to e.g. receive signals.
That will require quite a bit of extra work.

Tests that had to be disabled:
- restart: task_restart() does not work at all with kernel mode so it is
  disabled entirely
- fpu: make sure the FPU test is not even attempted, because it will cause
  ASSERT() and stop the test
- vfork: vfork() does not work for some reason in CONFIG_BUILD_KERNEL,
  there is something missing on the kernel side, so just disable the test for now

Tests that should be re-visited:
- The signal tests, now they signal the process itself while before the
  signal was sent to another task. This will require building the part
  that receives the signal as a separate process
- waitpid: Like stated above, waitpid does not work for pthreads
- suspend: kill to send signal does not work for pthreads

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
Co-authored-by: Ville Juven <ville.juven@unikie.com>
2023-12-27 10:01:05 -08:00
YAMAMOTO Takashi
f12586c51e interpreters/wamr: add INTERPRETERS_WAMR_DEBUG_AOT option
At least it's sometimes useful for nuttx sim.

eg. (modified a bit to avoid github autolinks)
```
spacetanuki% lldb ./nuttx
(lldb) target create "./nuttx"
Current executable set to '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64).
(lldb) settings set plugin.jit-loader.gdb.enable on
(lldb) b foo
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) r
Process 37011 launched: '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64)

NuttShell (NSH) NuttX-10.4.0
nsh> mount -t hostfs -o fs=/tmp/wasm /mnt
nsh> iwasm /mnt/test.aot
1 location added to breakpoint 1
Process 37011 stopped
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
   2
   3    __attribute__((noinline))
   4    void foo()
-> 5    {
   6        printf("hello from %s\n", __func__);
   7    }
   8
Target 0: (nuttx) stopped.
(lldb) bt
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
    frame #_1: 0x000000010580077a JIT(0x1058002d4)`bar(exenv=0x0000000101284280) at test.c:12:2
    frame #_2: 0x000000010580086a JIT(0x1058002d4)`baz(exenv=0x0000000101284280) at test.c:19:2
    frame #_3: 0x0000000105800972 JIT(0x1058002d4)`__main_argc_argv(exenv=<unavailable>, argc=<unavailable>, argv=<unavailable>) at test.c:26:3
    frame #_4: 0x00000001058061aa JIT(0x1058002d4)`aot_func#14 + 278
    frame #_5: 0x00000001058005cd JIT(0x1058002d4)`aot_func#2 + 153
    frame #_6: 0x00000001000e250f nuttx`push_args_end at invokeNative_em64.s:61
    frame #_7: 0x000000010013851a nuttx`wasm_runtime_invoke_native(exec_env=0x0000000101284280, func_ptr=0x0000000105800534, func_type=0x00000001011e2e20, signature=0x0000000000000000, attachment=0x0000000000000000, argv=0x0000000000000000, argc=0, argv_ret=0x0000000000000000) at wasm_runtime_common.c:4631:9
    frame #_8: 0x00000001000da1ae nuttx`aot_call_function(exec_env=0x0000000101284280, function=0x00000001011e1fb0, argc=0, argv=0x0000000000000000) at aot_runtime.c:1654:15
    frame #_9: 0x0000000100134b56 nuttx`wasm_runtime_call_wasm(exec_env=0x0000000101284280, function=0x00000001011e1fb0, argc=0, argv=0x0000000000000000) at wasm_runtime_common.c:2048:15
    frame #_10: 0x00000001000fbad4 nuttx`execute_main(module_inst=0x00000001011e3890, argc=1, argv=0x00000001011b63f8) at wasm_application.c:112:15
    frame #_11: 0x00000001000fb995 nuttx`wasm_application_execute_main(module_inst=0x00000001011e3890, argc=1, argv=0x00000001011b63f8) at wasm_application.c:238:11
    frame #_12: 0x00000001000ea1a0 nuttx`app_instance_main(module_inst=0x00000001011e3890) at main.c:113:5
    frame #_13: 0x00000001000e9d60 nuttx`iwasm_main(argc=1, argv=0x00000001011b63f8) at main.c:947:21
    frame #_14: 0x0000000100023275 nuttx`nxtask_startup(entrypt=(nuttx`iwasm_main at main.c:545), argc=2, argv=0x00000001011b63f0) at task_startup.c:70:8
    frame #_15: 0x000000010001065a nuttx`nxtask_start at task_start.c:134:7
    frame #_16: 0x000000010003a15f nuttx`pre_start at sim_initialstate.c:52:3
(lldb)

```
2023-12-25 04:47:07 -08:00
Takumi Ando
730370e565 fsutils: passwd: Fix wrong macro
passwd_update/adduser/deluser should be enabled
if CONFIG_FSUTILS_PASSWD_READONLY is NOT defined.

Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
2023-12-21 16:16:20 +01:00
Huang Qi
afa282ca4f WASI-SDK.defs: Simplify CFLAGS filters
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-20 21:24:20 -08:00
Tiago Medicci Serrano
11f2d5e5e4 examples/rmtchar: Implement RX and/or TX using the RMT char driver
The RMT (remote control) character driver is used to send and/or
receive data packets. Eventually, this app can be used to perform
a loopback test to validate the RMT driver implementation.
2023-12-19 03:34:28 -08:00
yuanyongjian
dcfb4d0662 nshlib:dmesg add '-c|-C' opt
Signed-off-by: yuanyongjian <yuanyongjian@xiaomi.com>
2023-12-14 20:14:25 -08:00
Zhe Weng
b7c5bdbdc9 nshlib/ifconfig: Add error print for inet_pton fail
> ifconfig wlan0 inet6 add fb
nsh: ifconfig: argument invalid

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-12-12 22:17:05 -08:00