Commit Graph

7622 Commits

Author SHA1 Message Date
liuhongchao
7efa80aa51 apps/drivertest: Fix run cmocka_driver_framebuffer No display on the screen
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 02:50:29 +08:00
liuhongchao
0d9b8a8fbf drivertest: Fix run cmocka_driver_touchpanel crash
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 02:50:29 +08:00
liuhongchao
6ec9d880c4 drivertest: Fix No display when running cmocka_driver_framebuffer
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 02:50:29 +08:00
guoshichao
573008244c greenhills: fix the variable unused warning
"nsh_parse.c", line 1565: warning #550-D: variable "quoted" was set but never
          used
    bool quoted;
         ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-20 02:50:13 +08:00
guoshichao
fa22160cb0 apps: update .gitignore rule to exclude "*.inf" file
the "*.inf" file are intermediate compilation output from greenhills
compiler, we do not need to trace these files

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-20 02:50:13 +08:00
guoshichao
7b5e54cd7b ostest/fpu.c: fix the greenhills compile warning
CC:  binfmt_unregister.c "fpu.c", line 98: warning #1160-D: a reduction in alignment without the
          "packed" attribute is ignored
    uintptr_t save1[XCPTCONTEXT_REGS] aligned_data(XCPTCONTEXT_ALIGN);
              ^

"fpu.c", line 99: warning #1160-D: a reduction in alignment without the
          "packed" attribute is ignored
    uintptr_t save2[XCPTCONTEXT_REGS] aligned_data(XCPTCONTEXT_ALIGN);
              ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-20 02:50:13 +08:00
jianglianfang
7abd0a7303 lvgldemo: fix uninit_use_in_call
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-20 02:49:34 +08:00
zhanghongyu
acf9e3679e netutils/iptables: add cmake support.
add cmake support for xtables.c, solves the problem of missing symbols
when compiling with cmake

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-20 02:48:49 +08:00
meijian
2e929bdf15 netutils/mqttc: add cmake support
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-20 02:48:22 +08:00
zhanghongyu
972594604c libcoap: fix makefile compile error after menuconfig
correct the LIBCOAP_VERSION format

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-20 02:46:43 +08:00
jinxiuxu
8ebab7657f apps/nxplayer: add ioctl stop when play completed
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-20 01:43:20 +08:00
guoshichao
9bfe138087 greenhills: fix the unknow build options warning
CC:  symtab_apps.c ccarm: Warning: Unknown option "-fno-lto" passed to linker
ccarm: Warning: Unknown option "-fno-builtin" ignored.  Did you mean "-fno-common"?

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-18 20:15:10 +08:00
guoshichao
a6094d81bb apps/canutils: fix the build warning on greenhills compiler
CC:  stdlib/lib_srand.c "candump.c", line 231: warning #550-D: variable "ret" was set but never used
  	int opt, ret;
  	         ^

"candump.c", line 101: warning #550-D: variable "cmdlinename" was set but
          never used
  static char *cmdlinename[MAXSOCK];
               ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-18 20:05:46 +08:00
guoshichao
8cb59a75ea ltp: fix the build warning
the warning are:
ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c:163: warning: "NSIG" redefined
  163 | #define NSIG (sizeof(signals)/sizeof(int))
      |
In file included from /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/include/pthread.h:35,
                 from ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c:31:
/home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/include/signal.h:53: note: this is the location of the previous definition
   53 | #define NSIG            _NSIG           /* _NSIG variant commonly used */

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-18 20:00:57 +08:00
guoshichao
4e9ae2d45a ltp: fix the link error raised by "proc.h" inclusion error
the link error are:
arm-none-eabi-ld: /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/staging/libapps.a(1-4.c.home.guoshichao.work_profile.vela_os.vela_ltp_1.apps.testing.ltp_3.o): in function `tst_process_state_wait3':
/home/guoshichao/work_profile/vela_os/vela_ltp_1/apps/testing/ltp/ltp/testcases/open_posix_testsuite/include/proc.h:63: multiple definition of `tst_process_state_wait3'; /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/staging/libapps.a(1-3.c.home.guoshichao.work_profile.vela_os.vela_ltp_1.apps.testing.ltp_3.o):/home/guoshichao/work_profile/vela_os/vela_ltp_1/apps/testing/ltp/ltp/testcases/open_posix_testsuite/include/proc.h:63: first defined here

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-18 20:00:57 +08:00
chenrun1
12012f2276 cachespeed:Fixed the problem of printing variables in 32/64-bit environment
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-18 03:14:24 +08:00
chenrun1
57cb20b63a ramtest:Fixed the problem of printing variables in 32/64-bit environment
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-18 03:14:24 +08:00
zhangchao53
204326c236 porting fake function framework 2024-08-17 13:46:03 +08:00
zhangchao53
f841ca16eb enable superpi cmake 2024-08-17 00:08:22 +08:00
Shoukui Zhang
7df20ea1bb nshlib: Optimize the size of the recursive stack
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-08-16 19:48:18 +08:00
zhangshoukui
7503f7bf33 popen: Replace fcntl with ioctl
The fcntl interface sets the O_CLOEXEC property by calling the ioctl interface. Let's call the ioctl interface directly.

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-08-16 19:48:18 +08:00
zhangshoukui
ff85c8c0d9 fstest: If the file is deleted it will not be opened
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-08-16 19:48:18 +08:00
Xin Xu
fe51fed1e6 Revert "cmake:builtin register support NONE srcs target"
This reverts commit bcf655e196.
2024-08-16 15:21:50 +08:00
xuxin19
bcf655e196 cmake:builtin register support NONE srcs target
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-08-15 13:37:24 +08:00
Daniel Jasinski
1fdf13478f build: Missing CMakeLists.txt for bas
This correctly enables BASIC interpreter in CMake based
build for at least sim:bas board configuration.

Signed-off-by: Daniel Jasinski <jasinskidaniel95szcz@gmail.com>
2024-08-11 10:22:34 +08:00
Marco Casaroli
0797ee2312 fix(nsh_parse): handle env variables correctly
The PR #2469 broke handling of environment variables because an
error in the if/else if control flow.

This fixes it.
2024-08-10 11:08:18 -03:00
Marco Casaroli
e46347ec1b nsh_fileapp: handle input redirection 2024-08-08 19:19:18 -03:00
Marco Casaroli
8fba726a7d feat(nsh_cat): allow cat to read from stdin
Now, if we run cat without arguments, it will just read from stdin.

It can be used with redirect like `cat < infile > outfile`.
2024-08-08 19:19:18 -03:00
Marco Casaroli
4104019e1c feat(nsh): add console read
This allows programs such as `cat` to read from the console (that could be redirected).
2024-08-08 19:19:18 -03:00
Marco Casaroli
96100b30f2 feat(nsh): input (stdin) redirection
This adds support for `<` to redirect input on nsh commands.
2024-08-08 19:19:18 -03:00
chenrun1
875f2fcc1e ramspeed:Fix memleak due to double malloc.
if (allocate_rw_address)
    {
      info->dest = malloc(info->size);
      info->src = malloc(info->size);
    }
  if ((info->dest == NULL && !info->allocate_rw_address) || info->size == 0)
    {
      printf(RAMSPEED_PREFIX "Missing required arguments\n");
      goto out;
    }
  else
    {
      /* We need to automatically apply for memory */
      printf(RAMSPEED_PREFIX "Allocate RW buffers on heap\n");
      info->dest = malloc(info->size);
      if (info->dest == NULL)
        {
          printf(RAMSPEED_PREFIX "Dest Alloc Memory Failed!\n");
          goto out;
        }
      info->src = malloc(info->size);
      if (info->src == NULL)
        {
          printf(RAMSPEED_PREFIX "Src Alloc Memory Failed!\n");
          goto out;
        }
    }

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-08 09:51:55 +08:00
chenrun1
e04782816f ramspeed:Add log printing & improve test accuracy & optional test cases
1.Add more print logs

ramspeed -w 0x61ba15c0 -s 524288 -n 10000 -i
RAM Speed: Write address: 0x0x61ba15c0
RAM Speed: Read address: 0x0
RAM Speed: Size: 524288 bytes
RAM Speed: Value: 0x00
RAM Speed: Repeat number: 10000
RAM Speed: Interrupts disabled: true

2.Improve test accuracy, now print in double type in us time unit

______Perform 32 Bytes access______
RAM Speed: system memset():      Rate = 625000.000 KB/s [cost: 0.500 ms]
RAM Speed: internal memset():    Rate = 240384.615 KB/s [cost: 1.300 ms]

3. Optional test item, if we do not pass in the src address, only memset will be executed

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-08 09:51:55 +08:00
chenrun1
3b6f6ab4e6 ramspeed:Fix the mem leak caused by not releasing memory when the task exits under the -a option
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-08 09:51:55 +08:00
chenrun1
c87c7c24a8 iozone:add CMakefile.txt
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 15:59:52 +08:00
chenrun1
09fda56f19 fio:add fio CMakelist.txt
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 15:59:52 +08:00
chenrun1
ffcee721ce nshlib/ddcmd:Fixed NSH_CMDOPT_DD_STATS output format warning in 64-bit environment
In file included from nsh_ddcmd.c:44:
nsh_ddcmd.c: In function 'cmd_dd':
nsh_ddcmd.c:456:20: error: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]
  456 |   nsh_output(vtbl, "%llu bytes copied, %u usec, ",
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  457 |              total, (unsigned int)elapsed);
      |              ~~~~~
      |              |
      |              uint64_t {aka long unsigned int}
nsh_console.h:55:49: note: in definition of macro 'nsh_output'
   55 | #  define nsh_output(v, ...)   (v)->output(v, ##__VA_ARGS__)
      |                                                 ^~~~~~~~~~~
nsh_ddcmd.c:456:24: note: format string is defined here
  456 |   nsh_output(vtbl, "%llu bytes copied, %u usec, ",
      |                     ~~~^
      |                        |
      |                        long long unsigned int
      |                     %lu
cc1: all warnings being treated as errors

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 15:04:39 +08:00
chenrun1
8c0100b193 dhrystone:Ignore warnings. Warnings have no impact on the program itself.
The function implementation does not specify a return type, and is treated as a void return value function during use, so it is ignored.
CC:  icmpv6_ping.c dhrystone/v2.1/dhry_2.c:30:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
   30 | Proc_6 (Enum_Val_Par, Enum_Ref_Par)
      | ^~~~~~

2. The implementation of some functions is opposite to the calling position, and the processing can be ignored
dhrystone/v2.1/dhry_2.c:39:9: warning: implicit declaration of function ‘Func_3’ [-Wimplicit-function-declaration]
   39 |   if (! Func_3 (Enum_Val_Par))

3. This function is called from dhry_2.c and void behavior is expected.
dhrystone/v2.1/dhry_2.c:30:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   30 | Proc_6 (Enum_Val_Par, Enum_Ref_Par)

4. In the old version of C language, if the function declaration return value is not set, the default is void; in the new version, it is int, but in dhrystone, these functions are called as void type functions by default.
dhrystone/v2.2/dry.c:738:1: warning: control reaches end of non-void function [-Wreturn-type]
  738 | }
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_1’:
dhrystone/v2.2/dry.c:772:1: warning: control reaches end of non-void function [-Wreturn-type]
  772 | } /* Proc_1 */
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_2’:
dhrystone/v2.2/dry.c:795:1: warning: control reaches end of non-void function [-Wreturn-type]
  795 | } /* Proc_2 */
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_3’:
dhrystone/v2.2/dry.c:810:1: warning: control reaches end of non-void function [-Wreturn-type]
  810 | } /* Proc_3 */
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_4’:
dhrystone/v2.2/dry.c:822:1: warning: control reaches end of non-void function [-Wreturn-type]
  822 | } /* Proc_4 */
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_5’:
dhrystone/v2.2/dry.c:831:1: warning: control reaches end of non-void function [-Wreturn-type]
  831 | } /* Proc_5 */
      | ^

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 13:57:15 +08:00
chenrun1
09ec04760f cachetest:Tools for testing cache and uncacheable
Summary:
  A tool is provided to test the case of data correctness after cache flush. It requires an uncacheable offset to check whether the uncacheable address is consistent with the data in the buffer after calling up_dcache_flush.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 10:03:16 +08:00
chenrun1
1d9f045068 testing/memstress:Fix FAR prefix
Summary:
  Add FAR before some pointer declarations

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 10:02:59 +08:00
chenrun1
74a8d98a32 testing/memstress:Support enabling multi-threaded stress testing in the program
Summary:
  Added "-x" to set the number of threads, the default is 1

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 10:02:59 +08:00
chenrun1
15ef9781c5 coremark-pro:Ignore the implementation warning
Summary:
  Avoiding warnings caused by source code implementation leads to build failure. Most warnings are undef and the value is 0. We think it is not enabled.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-06 19:30:39 -03:00
chenrun1
f126adb5fc nshlib/fscmds:Fix write overflow during cp -r process
Summary:
      do
        {
          nbyteswritten = write(wrfd, iobuffer, nbytesread);
          if (nbyteswritten >= 0)

The write return type is ssize_t, which is different in size from the originally declared type, so the unified type is ssize_t

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-06 19:30:12 -03:00
chenrun1
2413a2a4c8 testing/memstress:Initialize the pointer to avoid the pointer being unknown when the memory alloc fails
Summary:
  fix warning

In function 'memorystress_iter',
    inlined from 'memstress_main' at memorystress_main.c:475:10:
memorystress_main.c:289:10: error: 'ptr' may be used uninitialized [-Werror=maybe-uninitialized]
  289 |       if (ptr == NULL)
      |          ^
memorystress_main.c: In function 'memstress_main':
memorystress_main.c:248:20: note: 'ptr' was declared here
  248 |       FAR uint8_t *ptr;
      |                    ^~~

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-06 19:29:40 -03:00
Rushabh Gala
437c903c47 examples/leds_rust: Add Rust App for blinking the LED
- This PR adds `examples/leds_rust` to call NuttX POSIX APIs like `open()` and `ioctl()`, so that it blinks an LED
- The `leds_rust` app is also used for testing the GPIO and LED Drivers for Ox64 BL808 SBC and QEMU RISC-V Emulator in Google Summer of Code
- `leds_rust` be executed locally on Linux / macOS / Windows, by commenting out the first 2 lines of code
- The code is based on `examples/leds` in C, and `examples/hello_rust` in Rust

Co-Authored-By: Lup Yuen Lee <9960133+lupyuen@users.noreply.github.com>
2024-08-06 00:26:44 +08:00
simbit18
b4999fa916 Issues: Added Issue templates
**-Template**
 Bug report
Report a bug to improve NuttX stability

Feature request
Request an enhancement for NuttX

General Help
Get general support regarding NuttX

Of course, others can be added. !!! :)

**-Action**
An action for automatically labelling issues

 **Keywords**

Keywords are present in the dropdowns (the user can select more than one option) of the form Bug report and are:

    - Linux, Mac, Windows, Other
    - all, arm, arm64, avr, ceva, hc, mips, misoc, openrisc, renesas, risc-v, simulator, sparc, tricore, x86, x86_64, xtensa, z16, z80
    - Applications, Api, Board support, Build System, Configuring, Debugging, Drivers, File System, Installing, Kconfig, Kernel, Memory Management, Native port, Networking, OS Components, Posix, Sensors, Specific Peripheral

**To work, the labels must have the same name as the keywords !!!**

**So before the merge it is necessary to add them.**

Of course these keywords are examples so you can add, edit or delete them.

[Creating a label](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels#creating-a-label)

see https://github.com/apache/nuttx/issues/12748

none
CI
2024-08-06 00:23:01 +08:00
Yanfeng Liu
ab2e45a86c ostest/fpu_test: enable for FLAT mode only
As per the `HAVE_FPU` in `fpu.c`, fpu_test is only available for
FLAT build. So user_main should enable fpu_test for FLAT build also,
otherwise ostest will fail for PROTECTED build.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-08-03 21:09:33 +08:00
Ville Juven
38ae8e7827 ostest: Enable vfork test for BUILD_KERNEL
The test was disabled because of a bug in the NuttX kernel, which is now
fixed. Obviously depends on the fix.
2024-08-01 23:25:19 +08:00
Denis Ryndine
a15403958d nsh_dd: fix lseek return check.
- As was merged in commit 1852731df8 on
   dd_main.c: lseek returns -1 on error.

   Should be consistent in nsh_ddcmd.c and nsh_main.c.
2024-08-01 09:52:03 +08:00
simbit18
3d8536f380 build.yml: Added jobs to speed up CI checks.
Divided jobs risc-v and xtensa to finish workflow under 2 hours.
2024-07-30 11:15:52 +08:00
Pressl, Štěpán
1a7da54a9b examples/qencoder: obtain samples using the QEIOC_GETINDEX ioctl call
Normally, the qencoder position is obtained using the QEIOC_POSITION
ioctl call. Adding the -i argument uses the QEIOC_GETINDEX to
obtain the qe_index_s struct containing the position alongisde
other fields.

Signed-off-by: Stepan Pressl <pressste@fel.cvut.cz>
2024-07-29 22:28:56 +08:00