Commit graph

8099 commits

Author SHA1 Message Date
wangjianyu3
40a5e47d5c uORB/sensor: Add GNSS firmware version for sensor_gnss_format
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-06 21:20:41 +08:00
hujun5
748a4d6b8f fix compile error
Error: smp_call.c:36:31: error: 'g_call_data' defined but not used [-Werror=unused-variable]
   36 | static struct smp_call_data_s g_call_data;
      |                               ^~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:237: smp_call.c.github.workspace.sources.apps.testing.ostest.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:52: /github/workspace/sources/apps/testing/ostest_all] Error 2
make[1]: Target 'all' not remade because of errors.
make: *** [tools/LibTargets.mk:248: /github/workspace/sources/apps/libapps.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-06 17:28:18 +08:00
hujun5
a320e6dda5 smpcall: add nxsched_smp_call_async and nxsched_smp_call_single_async
reason:
The old implementation of the SMP call, even when using the "no wait" parameter,
could still result in waiting, if invoking it within a critical section
may lead to deadlocks. Therefore, in order to implement a truly asynchronous SMP
call strategy, we have added nxsched_smp_call_async.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-06 09:53:35 +08:00
Huang Qi
5048d6b472 tools: Add essential math.h for wasm build
If the experimental feature Wasm build enabled with multi thread
compiling, the COPYFILE (cp) maybe raise the error below:
```
cp: cannot create regular file 'math.h': file exists
```

This error cause by that the wasi-sdk don't provide the math.h for
non-wasi envrioment, for this case, provide a math.h for it instead of copy
file each time is better.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-06 01:38:10 +08:00
Michal Lenc
2d5afd0625 nxboot: fix incorrect confirm state for directly flashed image
API function nxboot_get_confirm was returning incorrect value if
primary image was flashed directly into the embedded flash (this
image does not have a tail, but is automatically considered as valid
and stable based on the header magic value).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-11-06 01:37:46 +08:00
Ville Juven
f97304fa3f nsh_vars: Remove rogue sched_unlock()
There is no corresponding sched_lock() for this and therefore this causes
random crashes.

Found when running a long init script which utilizes shell variables in
SMP mode.
2024-11-06 01:35:42 +08:00
Xiang Xiao
400a8e3264 benchmarks: add .gitignore files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-04 10:56:36 +01:00
Lup Yuen Lee
594558eddf CI: Check out the correct branch of nuttx repo when compiling nuttx-apps
When compiling the Release Branch of `nuttx-apps`, our CI Workflow `build.yml` checks out the Master Branch of `nuttx` repo, which is incorrect. This happens due to a typo in `build.yml`: https://github.com/apache/nuttx/issues/14513

This PR fixes the typo in `build.yml` to checkout the correct branch of `nuttx` repo.
2024-11-04 12:51:06 +08:00
Lup Yuen Lee
80bbc01790 CI: Disable the CI Build on push to master branch
Due to the [recent cost-cutting](https://github.com/apache/nuttx/issues/14376), we are no longer running PR Merge Jobs in the `nuttx` and `nuttx-apps` repos. For this to happen, I am now running a script on my computer that will cancel any PR Merge Jobs that appear: [kill-push-master.sh](https://github.com/lupyuen/nuttx-release/blob/main/kill-push-master.sh)

This PR disables PR Merge Jobs permanently, so that we no longer need to run the script. This prevents our CI Charges from over-running, in case the script fails to operate properly.
2024-11-04 09:33:27 +08:00
robert
0212e57f44 Added demo for BLE
Summary
---------------------------------------------------------------------------------------------------------
Created a minimal demo application for Bluetooth. It works by displaying some data over Bluetooth and the
user can connect to the device running it on NuttX and read this data.

This can work in 2 scenarios: a real scenario, in which data from the BME680 (temperature, humidity, etc..)
is used and the user will be able to read it. The second scenario involves displaying some dummy data
(hardcoded values) for testing purposes.

This application can serve as an example for users implementing more complex applications using Bluetooth on NuttX.

Testing
---------------------------------------------------------------------------------------------------------
I used the ESP32-Sparrow (which includes the BME680 sensor) and the ESP32-devkitc boards for testing.

The Bluetooth stack starts by default with advertising when it initializes, however I noticed that enabling
advertising in the stack does not work (at least on ESP32). However, when scanning is also enabled, the
device starts advertising. Therefore, in our application, during the BLE services initialization part, I also
enable scanning as a temporary workaround in order to make sure the device advertises and the user can see it
and connect to it.
2024-11-04 02:33:42 +08:00
Huang Qi
3799e0922d wamr: add iwasm include directory to nuttx target
This patch allow from other module that outside
WAMR directory include `wasm_export.h` to use WAMR as library.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-04 02:27:50 +08:00
xuxin19
7bab630e72 sotest:implement cmake sotest when kernel build does not support yet
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-03 09:22:36 +08:00
xuxin19
90f2a33b69 cmake(bugfix):fix ymodem cmake typo
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-03 09:22:36 +08:00
Lup Yuen Lee
c403d6c362 CI: Add Python linter to check
This PR syncs https://github.com/apache/nuttx/pull/14323 from `nuttx` repo to `nuttx-apps`.

This will resolve the `checkpatch.sh` failure: https://github.com/apache/nuttx-apps/issues/2812
2024-11-02 15:55:02 +01:00
Lup Yuen Lee
76c016b557 CI: Enable builds for msys2, msvc, arm-08, arm-10, arm-13 for Complex PRs
This PR enables the CI Builds for msys2, msvc, arm-08, arm-10, arm-13 for Complex PRs. We disable the CI Builds for arm-01, arm-09, arm-11.

This will help to fix the recent breakage of builds: https://github.com/apache/nuttx/issues/14598
2024-11-02 21:40:53 +07:00
Eren Terzioglu
d6edbd0cec Improve nxdiag example for Espressif devices 2024-11-02 12:22:25 +08:00
Eren Terzioglu
6c3ca23dbf system/debugpoint: Fix RO watchpoint test issue for esp devices 2024-11-01 23:09:37 +08:00
Michal Lenc
61fec07c62 boot: add NuttX bootloader with update and recovery support
This commit adds NuttX based bootloader with the support for image
update and recovery if not confirmed. The algorithm utilizes three
flash partitions: primary (image runs from this area), secondary
and tertiary. Secondary and tertiary areas are used for update upload
and recovery.

The update is performed by simple copy from update area to primary
area with recovery being created in recovery area if not already present.
Once image is confirmed by the user, the image in update area is
confirmed as well, update area becomes recovery area and vice versa.
This means the recovery is always present (except for the first update)
and subsequent updates just copy image from update to primary. This
makes the update significantly faster and more considerable to flash
wear while keeping the recovery/revert possibility.

A header (aligned to flash's erase size) must be added to the beginning
of the image. Python script nximage.py can be used to prepend this
header to built binary. The algorithm also uses one erase page at the
end of a partition (partition, not image!) to store flags used to
indicate image confirm status and to detect update/recovery partitions.
Any program uploading update image to the update partition has to erase
this page for the boot to work correctly!

The algorithm implementation is based on a patch initially developed
for MCUboot project but rejected by the project's maintainers

https://github.com/mcu-tools/mcuboot/pull/1902

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-11-01 11:30:28 -03:00
makejian
242b947342 crypto: remove MBEDTLS_CONFIG_FILE
* \def MBEDTLS_CONFIG_FILE
 *
 * If defined, this is a header which will be included instead of
 * `"mbedtls/mbedtls_config.h"`.
no need to specify MBEDTLS_CONFIG_FILE

Signed-off-by: makejian <makejian@xiaomi.com>
2024-11-01 17:02:10 +08:00
chenzhijia
34ca696b86 Add The Linux Programming Interface under examples
https://man7.org/tlpi/index.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-31 17:12:12 +08:00
ouyangxiangzhen
4ba65ccde9 benchmarks: support tacle-bench.
This commit supports tacle-bench for real-time systems.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-30 23:16:22 +08:00
ouyangxiangzhen
0edb210561 benchmarks: support test-tlb
This commit added support for test-tlb, a memory latency micro-benchmark.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-30 23:13:01 +08:00
ouyangxiangzhen
ddabb6e0ef benchmarks: support cyclictest
This commit supports cyclictest from RT-Tests for the timer jitter profiling.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-30 23:10:48 +08:00
ligd
d9e178aad0 nshlib/console: fix compile error when open CONFIG_NSH_ALTCONDEV
CC:  mm_heap/mm_memalign.c misc/rwbuffer.c: In function 'rwb_readbytes':
misc/rwbuffer.c:1172:2: warning: #warning Not Implemented [-Wcpp]
 1172 | #warning Not Implemented
      |  ^~~~~~~
CC:  binfmt_unloadmodule.c In file included from nsh_console.c:40:
nsh_console.c: In function 'nsh_consoleredirect':
nsh_console.h:85:30: error: 'struct serialsave_s' has no member named 'cn_confd'; did you mean 'cn_infd'?
   85 | #  define INFD(p)      ((p)->cn_confd)
      |                              ^~~~~~~~
nsh_console.c:344:7: note: in expansion of macro 'INFD'
  344 |       INFD(ssave) = INFD(pstate);
      |       ^~~~
nsh_console.c: In function 'nsh_consoleundirect':
nsh_console.h:85:30: error: 'struct serialsave_s' has no member named 'cn_confd'; did you mean 'cn_infd'?
   85 | #  define INFD(p)      ((p)->cn_confd)
      |                              ^~~~~~~~
nsh_console.c:370:18: note: in expansion of macro 'INFD'
  370 |   INFD(pstate) = INFD(ssave);
      |                  ^~~~

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-29 23:43:04 +08:00
anjiahao
95368deae2 ymodem:fix bug,When sending a retransmission, HEAD is overwritten.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-29 18:02:20 +08:00
zhanghongyu
7dd4b28950 netpkt_ethercat.c: fix the description of usage
the current usage description is incorrect,
ifname must follow ethercat. The number of transfers can be specified
only after ifname is specified.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 18:02:08 +08:00
zhangning21
d2205f8759 add x86-64-ABI/.gitignore
Signed-off-by: zhangning21 <zhangning21@xiaomi.com>
2024-10-29 12:30:42 +08:00
ouyangxiangzhen
85094f3eae benchmarks: support tinymembench
This patch adds tinymembench for memory bandwidth and latency measuring.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-29 12:28:18 +08:00
zhanghongyu
b42bbcb5d3 netlib_getarptab.c: improved the display without any arp entry
before:
server> arp
ERROR: send() failed: 2
nsh: arp: S��x�����Ì
 failed: 2
server>

after:
server> arp
IP Address   Ethernet Address  Interface
server>

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 12:27:16 +08:00
zhanghongyu
4cec3dad0d nsh_netcmds.c: handle the ENETUNREACH error number
before:
server> arp -a 10.0.1.4
nsh: arp: ioctl failed: 101

after:
server> arp -a 10.0.1.4
nsh: arp: no such ARP entry: 10.0.1.4

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 12:27:16 +08:00
ligd
48db89158a ostest: update wqueue test for new API
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-29 01:22:29 +08:00
buxiasen
36be4a08ed resmonitor: add showinfo/filldisk/fillcpu/fillmem from test/
add cmake support

after enable TESTING_RESMONITOR, use showinfo -i 2 can show cpuload to
syslog every two seconds.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:36 +08:00
liwenxiang1
a526a4a173 app/testing:Add x86_64 abi test cases
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>

app/testing:Add x86_64 abi test download path

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-28 22:51:25 +08:00
buxiasen
e260522fa3 testing/pm_smp: delay_yield ticks 1->2, avoid idle canot run one cycle
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
buxiasen
93a431d19b testing/drivertest: add pm_smp test
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
buxiasen
7acf0ff314 drivertest_pm: compatible with SMP
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
liugui
9353bcefa2 skip oneshot timer test
Signed-off-by: liugui <liugui@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
anjiahao
0b03ca1538 macos:fix sim:module build warning
CP:  /Users/vela/ajh/nuttx/include/nuttx/fs/hostfs.h
CC:  inode/fs_inodebasename.c ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
        ar -m [-TLsv] archive file ...
        ar -m [-abiTLsv] position archive file ...
        ar -p [-TLsv] archive [file ...]
        ar -q [-cTLsv] archive file ...
        ar -r [-cuTLsv] archive file ...
        ar -r [-abciuTLsv] position archive file ...
        ar -t [-TLsv] archive [file ...]
        ar -x [-ouTLsv] archive [file ...]

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-28 21:27:32 +08:00
Leo Chung
c7a905ec0c apps/system/vi: Add missing vi_release before exit.
If VI exit without vi_release, that broken console.

Signed-off-by: Leo Chung <gewalalb@gmail.com>
2024-10-28 10:10:14 -03:00
Leo Chung
c0e04b0251 termcurses: Disable ICANON for serial driver. That was broken VI editor.
The ICANON flag broken VI key input, so disable it.

Signed-off-by: Leo Chung <gewalalb@gmail.com>
2024-10-28 10:10:14 -03:00
dengwenqi
41bc4f7873 testing/stressapptest: fix: git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-28 00:40:37 +01:00
haopengxiang
df559f1712 fix: git status/git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-27 22:30:39 +08:00
zhuanglin
5b2397b595 testing/fatutf8:fix Out of bounds writing
Signed-off-by: zhuanglin <zhuanglin@xiaomi.com>
2024-10-27 22:30:39 +08:00
makejian
84292d5013 mbedtls: compile warning fix
- apps/crypto/openssl_mbedtls_wrapper/mbedtls/err.c
- apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c

Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-27 20:57:11 +08:00
xuxin19
597c701518 cmake:add openssl_mbedtls_wrapper cmake build support
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-27 20:57:11 +08:00
makejian
fbcc320321 openssl_mbedtls_wrapper: Implement SHA1 Interface
Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-27 20:57:11 +08:00
makejian
42e0e4c6b2 openssl_mbedtls_wrapper: support X509_new()
Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-27 20:57:11 +08:00
cuiziwei
6721ae3555 fix build warning.
CC:  vfs/fs_lseek.c /home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c: In function ‘HMAC_CTX_new’:
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:57:31: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
   57 |       (mbedtls_md_context_t *)malloc(sizeof(mbedtls_md_context_t));
      |                               ^~~~~~
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:28:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
   27 | #include <mbedtls/hmac_drbg.h>
  +++ |+#include <stdlib.h>
   28 | #include <mbedtls/md.h>
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:57:31: warning: incompatible implicit declaration of built-in function ‘malloc’ [-Wbuiltin-declaration-mismatch]
   57 |       (mbedtls_md_context_t *)malloc(sizeof(mbedtls_md_context_t));
      |                               ^~~~~~
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:57:31: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c: In function ‘HMAC_CTX_free’:
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: warning: implicit declaration of function ‘free’ [-Wimplicit-function-declaration]
  126 |   free(ctx);
      |   ^~~~
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: warning: incompatible implicit declaration of built-in function ‘free’ [-Wbuiltin-declaration-mismatch]
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-27 20:57:11 +08:00
makejian
f7582e34e5 openssl_mbedtls_wrapper: add ssl wrapper from libwebsockets
Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-27 20:57:11 +08:00
yanghuatao
f1ace3774f apps/crypto: Add project openssl_mbedtls_wrapper
Add openssl mbedtls wrapper project

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-10-27 20:57:11 +08:00