8039 Commits

Author SHA1 Message Date
renzhiyuan1
2074d04f62 cmake:add kissfft CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-27 18:12:54 +08:00
dengwenqi
f7ff338a7b fix: git status/git status --ignore normalization check problem 2024-10-27 18:12:54 +08:00
zhanghongyu
429befe1ed examples/netpkt: add ethercat test example for robot
add a simple example to test ethercat's sending and receiving

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-27 15:59:14 +08:00
xuxingliang
28c3c05c28 example/libtest: add malloc/free to libtest
So we can verify flags like kasan are effective or not.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-27 15:05:36 +08:00
Neo Xu
c4b6fd77be lvgldemo: allow to customize input dev path
Default to /dev/input0, now it's configurable.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-27 14:05:37 +08:00
xuxin19
b4c2e6bf46 build(bugfix):remove unused cmake scrpits
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-27 14:05:17 +08:00
xuxin19
55a955234a cmake:add system gprof CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-27 14:05:06 +08:00
renzhiyuan1
469cc11406 cmake:add flatbuffers CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-27 14:05:06 +08:00
Petro Karashchenko
7f7bbe236d examples/mqttc: add option to use MBED TLS for connections
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-26 19:11:55 -03:00
liuwei35
3e54ea0aae fix compile warning for fsutils inifile.c
Signed-off-by: liuwei35 <liuwei35@xiaomi.com>
2024-10-26 23:08:53 +02:00
Neo Xu
0109ab39ec lvgldemo: should use nuttx_deinit to free all resources
Memory leak can be detected when simply change the while(1) loop to exit. The lv_nuttx_deinit will free resources including display, input etc.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-26 21:33:00 +08:00
Neo Xu
1506c6f54d lvgl: upgrade to release/v9.2.1
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-25 09:27:15 +02:00
zhanghongyu
2ff75e32e9 netutils/connectedhomeip: use CONFIG_CXX_STANDARD instead of hard code
as c++ versions are upgraded, hard code compilation options can
cause build error

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-24 19:57:59 +08:00
Lup Yuen Lee
b6fb787669 CI: Enable sim-02 build when we create or update a Complex PR
CI Build Job sim-02 was disabled to reduce our usage of GitHub Runners, to comply with ASF Policy: https://github.com/apache/nuttx/issues/14376#issuecomment-2427837859

However this causes the Scheduled Merge Job to fail, due to reduced CI Checks: https://github.com/NuttX/nuttx/actions/runs/11490041505/job/31980056690#step:7:465

This PR re-enables sim-02 when we create or update a Complex PR.
2024-10-24 09:28:08 +07:00
Felipe Moura
f517b66d60 examples/spislv_test: Added app that allows users to test SPI Slave comm
This application continuously reads the file system of the spislv. Each received message will be written to the user in hexadecimal form, and the same received data will be sent back. In this way, the user can test if their spislv driver and hardware setup are working properly before proceeding further.

On a master device, using the SPI tool, when sending the message: spi exch -x 4 deadbeef

The slave device will output:
Slave: 4 Bytes read
 Value in hex form from /dev/spislv2: de ad be ef
Slave: Writing value back to /dev/spislv2
2024-10-22 18:41:12 +02:00
wangmingrong1
a7a03a9e5a kasantest: Add some tests for legitimate and illegitimate operations of memory APIs
1. By printing the results, you can know which libc memory APIs in the
current system support kasan check; for examples:
KASan Test: heap underflow -> PASS
KASan Test: heap overflow -> PASS
KASan Test: heap use after free -> PASS
KASan Test: heap invalid free -> PASS
KASan Test: heap double free -> PASS
KASan Test: heap poison -> PASS
KASan Test: heap unpoison -> PASS
KASan Test: heap illegal memchr -> PASS
KASan Test: heap illegal memcpy -> PASS
KASan Test: heap illegal memcmp -> PASS
KASan Test: heap illegal memmove -> PASS
KASan Test: heap illegal memset -> PASS
KASan Test: heap illegal strcmp -> PASS
KASan Test: heap illegal strcpy -> PASS
KASan Test: heap illegal strlen -> FAIL
KASan Test: heap illegal strncpy -> FAIL
KASan Test: heap illegal strchr -> PASS
KASan Test: heap illegal strncmp -> PASS
KASan Test: heap illegal strnlen -> FAIL
KASan Test: heap illegal strrchr -> PASS
KASan Test: heap legal memchr -> PASS
KASan Test: heap legal memcpy -> PASS
KASan Test: heap legal memcmp -> PASS
KASan Test: heap legal memmove -> PASS
KASan Test: heap legal memset -> PASS
KASan Test: heap legal strcmp -> PASS
KASan Test: heap legal strlen -> PASS
KASan Test: heap legal strlen -> PASS
KASan Test: heap legal strncpy -> PASS
KASan Test: heap legal strchr -> PASS
KASan Test: heap legal strncmp -> PASS
KASan Test: heap legal strnlen -> PASS
KASan Test: heap legal strrchr -> PASS
KASan Test: globals underflow -> PASS
KASan Test: globals overflow -> PASS

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-22 23:14:50 +08:00
simbit18
abcfd74c19 ISSUE_TEMPLATE: fix missing labels
Not all labels are added because there is no match with the label name.

issue_labeler.yml
os: Linux -> os: linux

001_bug_report.yml
Type: bug -> Type: Bug
Corrected label in links

002_feature_request.yml
Type: enhancement -> Type: Enhancement
Corrected label in links

003_help.yml
Type: question -> Community: Question
Corrected label in links
2024-10-22 23:14:15 +08:00
Lup Yuen Lee
1cb45b0d1c CI: Split the targets in sim-01 and add sim-03
This PR syncs the Simulator Targets `sim-01`, `sim-02`, `sim-03` from `nuttx` repo to `nuttx-apps`: https://github.com/apache/nuttx/pull/14428
2024-10-22 08:47:07 +08:00
buxiasen
790be6d639 nshlib/nsh_parse: use sh -c replace pthread detach when nsh background.
pthread & detach will still quit when parent task exit,
cause nsh_parse clone args leak. nsh should use task instead of thread

this case can reproduce the memory leak.
int main(int argc, FAR char *argv[])
{
  printf("Hello, World!!\n");
  system("sleep 1 &");
  return 0;
}

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-22 00:04:09 +08:00
Lup Yuen Lee
ec458f0ec7 CI: Build only Arm32 Targets arm-01 / 03 / 05 / 06 / 07 / 09 / 11 for Complex PRs
This PR updates the Build Rules `arch.yml` to build only these Arm32 Targets when we create or update a Complex PR:
- arm-01, arm-03, arm-05, arm-06, arm-07, arm-09, arm-11

No changes for Simple PRs (arm-01 to arm-14) and for Merging PRs (also arm-01 to arm-14).

This will improve our breadth of CI Checks across Arm32 Targets, as explained here: https://github.com/apache/nuttx/issues/14376
2024-10-21 05:53:04 +07:00
Lup Yuen Lee
52a50ea72a CI: Split the Build Jobs for Arm64 and x86_64
This PR syncs https://github.com/apache/nuttx/pull/14282 from `nuttx` repo to `nuttx-apps`.
2024-10-20 16:19:10 +08:00
cuiziwei
729cc337a1 libuv: Remove GCCVER redefinition
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-19 18:55:01 +08:00
wangjianyu3
e5a1bb1796 nshlib/dd: Add support for reading from/writing to standard input/output
Test
  1. Input from stdin and output to stdout
       Keyboard input: 12345AAAAABBBBB
    nsh> dd bs=5
    1234512345AAAAAAAAAABBBBBBBBBB

  2. Input from file and output to stdout
    nsh> dd if=/etc/init.d/rc.sysinit
    mkrd -m 2 -s 512 1024
    mkfatfs /dev/ram2
    mount -t vfat /dev/ram2 "/tmp"

  3. Input from stdin and output to file
       Keyboard input: QWERT
    dd of=/data/dd_stdout bs=5

    Then, cat the output file in host (based on HostFS):
    $ cat ./dd_stdout
    QWERT

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-19 14:07:32 +08:00
Lup Yuen Lee
a799c3e805 CI: Skip half of RISC-V, Xtensa and Simulator targets when a Complex PR is created / updated
When we submit or update a Complex PR that affects All Architectures (Arm, RISC-V, Xtensa, etc): CI Workflow shall run only half the jobs for RISC-V, Xtensa and Simulator:
- `risc-v-01` to `03`
- `xtensa-01`
- `sim-01`

When the Complex PR is Merged: CI Workflow will still run all jobs for RISC-V, Xtensa and Simulator:
- `risc-v-01` to `06`
- `xtensa-01` to `02`
- `sim-01` to `02`

Simple PRs with One Single Arch / Board will build the same way as before:
- `risc-v-01` to `06`
- `xtensa-01` to `02`
- `sim-01` to `02`

We hope to lower drastically our usage of GitHub Runners before the ASF Deadline, as explained here: https://github.com/apache/nuttx/issues/14376
2024-10-19 06:57:33 +07:00
likun17
06181f0b00 uorb:Fixed the abnormal issue of printing uint16 with PRIu16.
The PRIu16 macro in the system is defined as "u", and "hu" is required.
In Linux and Nuttx, PRIu32 PRIu16 PRIu8 are all defined as "u", but %pB
prints the structure and needs its offset. %pB gets the offset through
sizeof(short int)

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-18 19:56:58 +08:00
zhangshoukui
8b17cfedf2 drivertest_i2c_spi: Supports incoming device nodes so we can test both iic and spi
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-18 19:56:40 +08:00
nuttxs
8d82bd7b76 wireless/wapi.c: Initialize variables to avoid abnormal
data when wapi get country code.
2024-10-18 18:12:22 +08:00
raiden00pl
a7024aea89 examples/foc: protect control loop with critical section
If the controller frequency is high, system timer interrupts will
eventually interrupt the controller function, thereby increasing the
execution time. This may lead to skipping the control cycle, which
negatively affects the control algorithm.

With this option enabled, interrupts are disabled for the duration
of the controller function execution.

Here example results from CONFIG_EXAMPLES_FOC_PERF output
for b-g431b-esc1 board with CONFIG_EXAMPLES_FOC_NOTIFIER_FREQ=10000:

1. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=n

  exec ticks=5258
    nsec=30929
  per ticks=21268
    nsec=125105

2. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=y

  exec ticks=3428
    nsec=20164
  per ticks=19203
    nsec=112958

The difference is ~12us!
2024-10-18 10:43:46 +08:00
raiden00pl
b85a5ed306 examples/foc: ignore error for align and ident routines when motor controller disabled
CONFIG_EXAMPLES_FOC_RUN_DISABLE option is used for tests and benchmarks, so we don't
care about wrong results for motor identification and sensor alignment routines
2024-10-18 10:43:46 +08:00
raiden00pl
1aacc99491 examples/foc: print aling results only when verbose output enabled
it is a costly operation that takes a lot of time and is not of much value
2024-10-18 10:43:46 +08:00
raiden00pl
103bf83608 examples/foc: fix option that disable motor controller
fix some compiler error when EXAMPLES_FOC_RUN_DISABLE is enabled
2024-10-18 10:43:46 +08:00
raiden00pl
beeec27afd examples/foc: improve perf monitor
improve FOC perf monitor:

- add options to choose when perf result should be printed
- measure the controller thread call period
2024-10-18 10:43:46 +08:00
raiden00pl
5c166edf63 examples/foc: fix compilation error
fix compilatgion error:

foc_motor_f32.c: In function 'foc_motor_init':
foc_motor_f32.c:1574:7: error: label 'errout' used but not defined
 1574 |       goto errout;
2024-10-18 10:43:46 +08:00
raiden00pl
fc863b6cd0 examples/foc: fix snprintf warning
fix snprintf warning:

    foc_thr.c:110:39: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 7 [-Wformat-truncation=]
      110 |   snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
          |                                       ^~
    foc_thr.c:110:36: note: directive argument in the range [-2147483648, 0]
      110 |   snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
          |                                    ^~~~~~
    foc_thr.c:110:3: note: 'snprintf' output between 5 and 15 bytes into a destination of size 10
      110 |   snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-10-18 10:43:46 +08:00
jihandong
25937282ed ml: follow nxstyle
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
7d87768f78 ml: a cmdline tool to use tflite-micro.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
b91adbb9f2 ml: useful tflm debug options
print memory plan, and time cost of each operators.

Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
f2eb5cd3c4 ml: tflite extra hardware support.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
b15e71cd22 ml: update Makefile
-O3: reduce code size.
-DTF_LITE_STATIC_MEMORY: cause bugs on some cores.
+DTFLITE_EMULATE_FLOAT: robuster to emulate float cucalation by fix-point.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
c585aa147a ml: clean tflite Makefile
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
958d8e03eb Modify the usage error of neon instruction set
The second argument of vgetq_lane_s32(__a, __b) needs to be initialized before compilation, so unroll the for loop. and correct the passed parameters.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
renzhiyuan1
eb56c62dc9 cmake:add tflite-micro CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-18 09:40:17 +08:00
renzhiyuan1
8dfd998db1 cmake:add cmsis-nn CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
dda8cab335 ml: tflm mean optimization patch
Separate the Int8 implementation of the 'mean' operator to reduce the code size.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
068b2b16bb ml: tflm quantize optimization patch
Separate the 'Float32 to Int8' implementation of the 'quantize' operator to reduce the code size.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
570102c501 delete the neon conv2D
The complete implementation is placed separately in mLearning/tflite-micro/operators/neon, delete this part.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
14a591fab2 ml: tflm dequantize optimization patch
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
67f495e360 Added Cortex-A compilation environment.
Cortex-A compilation options are added to tflite-micro and cmsis-nn, and new operator compilation environments are configured.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
11519fe1ca Update third-party library version
Tflite-micro, ruy and cmsis-nn need to be updated to a new version.
Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
fb17e33894 Neon optimized Add operator
VELAPLATFO-25411

On the basis of CMSIS-NN, neon was used to optimize the Add operator, which calculates the offset and addition of eight input and output data in one loop.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00