Commit Graph

8402 Commits

Author SHA1 Message Date
Tiago Medicci
d63bb6d81d interpreters/python: Do not link to standard libraries
This commit prevents Python from linking to standard libraries.
This is needed because Python's `configure` script tests for a set
of available functions that are provided by NuttX (instead of the
toolchain) and not having `-nostdlib` set may give wrong results.
2025-05-11 11:31:57 +08:00
Jukka Laitinen
376cc5a731 testing/ostest: Add checking of signal delivery TID to signest test
- Add another signal action, "interfere_action", and signal the interfere thread
- In both signal action functions (waiter and interfere), check that they get executed
  in correct thread's context

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 23:21:13 +08:00
vrmay23
77b2e8dfee examples/posix_stdio: New example dedicated to posix stdio library.
This example will help newcomers to port software from Linux to NuttX
in a POSIX compliant fashion using stdio library. It shows how to work with
open(), close() and write() functions over /dev/console.

Signed-off-by: Vinicius May <vmay.sweden@gmail.com>
2025-05-07 20:07:35 +08:00
George Poulios
30ef8ff845 examples/optee: Introduce an OP-TEE client example
Add an example app that opens a session with the devices pseudo-TA
and enumerates the available devices (prints their UUIDs only).

The example showcases:
 - opening the OP-TEE client driver
 - printing its version
 - opening a session
 - allocating shared memory
 - registering shared memory
 - invoking a function to the TA referencing the shared memory
 - closing the session

Enabled with CONFIG_EXAMPLES_OPTEE.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-05 23:58:57 +08:00
Jukka Laitinen
a011cad584 testing/ostest/signest: Replace kill with pthread_kill to fix running in SMP
"kill" sends the signal to all the the threads in the group. The intention of
the test is to send signals only to the "waiter" thread.

Running signal actions in parallel is not compatible behaviour with
the signest test, which assumes that signals are being run one after another.
For example running signals 38 and 40 in parallel on two threads/two cpus
would cause the test incorrectly fail on "even signals nested".

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-03 11:09:07 +08:00
wangjianyu3
f14249d1d3 system/uORB: Add API for sending loop exit event
Add orb_loop_exit_async() API to send exit event to uORB loop.

Closing immediately after a write may cause missing a wakeup.

When all file descriptors associated with the same eventfd object have been closed, the resources for object are freed by the kernel. --EVENTFD(2)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-26 15:48:15 +02:00
wangjianyu3
3b0181dbd0 system/uORB: Fix orb_loop_s undeclared error
/workspace/apps/system/uorb/uORB/internal.h:42:31: error: 'struct orb_loop_s' declared inside parameter list will not be visible outside of this definition or declaration

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-26 15:48:15 +02:00
dongjiuzhu1
d670805758 system/uorb: add eventfd to notify loop exit.
Add support for exiting loop by writing eventfd.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-26 15:48:15 +02:00
dongjiuzhu1
84d4fe0bfd system/uorb: using UORB_LOOP_MAX_EVENTS to config loop function
Disable loop events by default (not compile loop.c and epoll.c).

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-26 15:48:15 +02:00
Carlos Sanchez
f94bccf119 canutils/slcan: explicitly manage the interface.
A recent change (https://github.com/apache/nuttx/pull/16199) has made the bitrate setting no
longer bring the interface up. Moreover, it is now no longer possible to change bitrate
of a CAN interface if it is up. Therefore, slcan needs to bring the interface down
to change it. Fortunately, it already had commands to open and close the interface
which map nicely to this.

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-04-23 22:30:47 +08:00
Carlos Sanchez
4fb47a6a6d canutils/slcan: Work with CAN interfaces with names longer than 4 characters.
Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-04-23 22:30:47 +08:00
dongjiuzhu1
5585c9d347 nshlib/dd: remove nsh dd cmd
using system/dd to instead nsh dd cmd
remove related to config, file.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
6db2c14faa system/dd: align nsh dd command
nshlib/dd: Increase the integer width for sector size in dd.

    On some systems, using sector sizes larger than 65536 is needed for
    profiling performance or testing.

    Stuart Ianna <stuart.ianna@motec.com.au>

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
be6a45cb14 system/dd: check infile/outfile when closing
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
721d79fb73 system/dd: align nshlib/cmd_dd
cmd_dd:support dd can do verify

    After writing the file, compare the contents of the two files again

    Signed-off-by: anjiahao <anjiahao@xiaomi.com>

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
b608dd0e3f system/dd: align nshlib/cmd_dd
nshlib/cmd_dd: Retry if read() was interrupted

    Without this patch

      nsh> ls /etc/group | dd | dd
      sh [13:100]
      sh [14:100]
      nsh: dd: read failed: 4
      nsh>

    Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
2a52c4c7f5 system/dd: support conv=nocreat
align nshlib/nsh_cmddd

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
Laczen JMS
61194fe6c0 examples/elf: add possibility to create romfs image
Add the possibility to create a romfs image for an "external" file
system. The romfs.img can directly be written to a configurable
mtdblock device.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-04-19 11:30:29 +08:00
Carlos Sanchez
8d89d73bb8 canutils: use bps units for bitrate in SocketCAN interfaces.
This matches PR https://github.com/apache/nuttx/pull/16225 in Nuttx where
units for SocketCAN bitrate ioctls were changed.
2025-04-17 15:39:43 +08:00
Jukka Laitinen
ecbd1e964a examples/camera: Initialize g_nximage semaphore with SEM_INITIALIZER
Use SEM_INITIALIZER macro instead of direct { 0 }

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-16 15:18:06 +03:00
YAMAMOTO Takashi
57365ac05d toywasm: regen for v67.0.0
```shell
REF=2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef ./regen.sh
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-13 11:31:36 +08:00
YAMAMOTO Takashi
1094573025 toywasm: bump to v67.0.0
see below for the included changes.
the "fix GCC warnings for the target with long uint32_t" change
is for https://github.com/apache/nuttx/pull/16022.

```shell
2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef wapm.toml: bump the version
95fdefcd3ea85ce18d0fd9c41536e609f6b0d7b2 suppress ubsan complaints on function type mismatches
9e131d0b86f29f453b51390e7a57db2f12efa8af fix a type in a comment
6832384862dab5f44b5328dbfe2a09cdba35713b platform.h: add WRONG_FUNC_TYPE macro to suppress -fsanitize=function
50062832c0481f4dcc67458fcfd2e1184e423d8b fix GCC warnings for the target with long uint32_t
04861b1084cd4925d99bfc758d5ae00359360c5d explain a cryptic dyld error
569aaa9b0ab6309311f331cdf3376e8d4445b1c0 libwasi_littlefs: emulate preadv/pwritev
b3f665319efe68215d9c9f51f489ba61b03c27fb ci: bump littlefs version
fe5cd58608c0eab0e3383626988240da1971a6ba fix debug info with IPO on macOS
7ef1b8abc4e4d1558986336732f21cf54f6abc58 libwasi_littlefs: fix crashes with non-debug builds
abb5efe1141721225945087d414d348f4afd4976 libwasi_littlefs: fix a few races
125d8973b485583d3ac4a8c4a60f97334135ee53 lfs_error_to_errno: translate unknown values to EIO
f1eda35d45229d02c7e23c872d2e0faeb9b2c731 Fix compilation errors with the latest macOS 15.2 SDK
3a01d8c5a063c18c8ebc58c45a61c7dd12cd4b75 libwasi_littlefs/README.md: remove a stale section
b7f015fd933fd330ed6e4e6f9af0dfc7b280e70d CI: update actions/upload-artifact download-artifact to v4
3a90622e105a2064878d4d63fc5e4566c6d1906b comment
6cdb84116abb930e903221231dd657ec08fec9e2 cmake: add custom-page-sizes tests
a2958960f59b6b0ccf7733fc3db301236991ff0b add run-wasm3-spec-test-custom-page-sizes.sh
f1029a818e638e0a5995a7fef43988592e709740 fetch-spec-test.sh: bump wasm-spec-test
7aa3d9050abcac11f7f8abef12ced6334acf0670 prepare-spec-test.sh: use my fork of custom-page-sizes for now
c987677a10557a0f938e3c10cfd05e5d741cf51e fetch-spec-test.sh: bump wasm-spec-test
c9372193a766c145a76a7ceaf79c820ce4576ce8 test/prepare-spec-test.sh: add custom-pages-sizes tests
9a74326a8d9503151ca3868ea6ed855293cb77b1 doc
cc700465b4275cc27007950f00ecf5079f68a778 comment
1700c523acf9fa3ba20772731eb04096852902a2 add a comment
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-13 11:31:36 +08:00
chao an
27846ffec7 libc/elf: rename modlib to libelf
Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.

CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-11 09:43:07 +08:00
chao an
69cb2e89e9 libs/libc/crc16: Separate implementation of crc16xmodem from crc16
keep default crc16 catalogue for CRC-16/XMODEM

Mapping crc16 implement to crc16xmodem

crc16     -> crc16xmodem
crc16part -> crc16xmodempart

- CRC-16/ACORN, CRC-16/LTE, CRC-16/V-41-MSB, XMODEM, ZMODEM
poly: 0x1021 initial seed: 0x0000, xor output: 0x0000

: width=16
: poly=0x1021
: init=0x0000
: refin=false
: refout=false
: xorout=0x0000
: check=0x31c3
: residue=0x0000
: name="CRC-16/XMODEM"

https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-xmodem

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-10 22:38:48 +08:00
raiden00pl
ac12971ac9 nxscope/nxscope_pser.c: use xmodem crc16 directly
use crc16xmodem directly to avoid using confusing crc16()

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-10 19:34:27 +08:00
YAMAMOTO Takashi
70f28553c6 examples/gps: fix a few printf formats
references:
https://github.com/apache/nuttx/pull/16022
4abb6f8da5/minmea.h (L241C15-L241C28)
4abb6f8da5/minmea.h (L43)

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-10 16:47:21 +08:00
anjiahao
21a6a13698 kernel build:avoid multiple definition ld script
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-04-09 14:01:40 +08:00
YAMAMOTO Takashi
61551aa849 system/dd: Implement conv=notrunc
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html
> notrunc
>   Do not truncate the output file. Preserve blocks in the output
>   file not explicitly written by this invocation of the dd utility.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-03 18:45:22 +08:00
raiden00pl
5d4b720596 foc/foc_feedforward.c: vdq_comp->q should use idq->d
fix typo in calculations for vdq_comp->q. It should use idq->d not idq->q.

Reported in https://github.com/apache/nuttx-apps/issues/3047

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-03 18:34:55 +08:00
Tiago Medicci
cf1d5bb08b benchmarks/mtd: use PRIxxx macro to improve portability
To improve portability, use `PRIxxx` macro instead of int/long int
format specifiers.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2025-04-01 09:08:59 +02:00
Tiago Medicci
b80e444aea benchmarks/mtd: Select libc's floating point support
The application requires libc's floating point support. Although
it may be already enabled by other applications and/or hardware
support, it should be explicitly selected by the app too.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2025-04-01 09:08:59 +02:00
Filipe Cavalcanti
19352ab3c0 gps: modify printf to use format specifier macros
Replace '%d' with 'PRId32' in some printf calls.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-30 14:29:21 +08:00
raiden00pl
fa8daf4071 examples/nimble_bleprph: fix various coding standard issues
fix various coding standard issues examples/nimble_bleprph

also fix compilation for make

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 14:28:47 +08:00
raiden00pl
a4af41f893 examples/nimble_blecent: fix various coding standard issues
fix various coding standard issues for examples/nimble_blecent

also fix compilation for make

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 14:28:47 +08:00
raiden00pl
3764ab041a cmake: remove empty strings from FetchContent
remove empty strings from FetchContent to eliminate cmake build warnings like this:

CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1564 (cmake_parse_arguments):
  The BUILD_COMMAND keyword was followed by an empty string or no value at
  all.  Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
  ARG_BUILD_COMMAND variable rather than setting it to an empty string.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 14:20:21 +08:00
raiden00pl
4bca48431a examples/adc: fix printf warning
examples/adc: fix printf warning

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 11:36:48 +08:00
simbit18
1193a82fca system/uorb/listener.c: fix typo
fix typo "Mointor" -> "Monitor"

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-29 10:31:47 +08:00
zhangshoukui
369729eea4 testing/drivers/drivertest: Uniform test case name
1.Some test functions are named too simply
2.Many driver tests depend on specific configurations and hardware, and the unified specification name facilitates cmocka to skip tests by using the skip parameter for wildcard matching

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-27 09:00:15 +01:00
Michal Lenc
0640d3f550 nshlib/nsh_fsutils.c: fix getpid_callback function read size
Commit 5330966 replaced local static buffer with malloc allocated
lib_get_pathbuffer. This however prevents the usage of sizeof(buffer)
in the follow up read function, therefore the read size has to be
specified as PATH_MAX - 1.

This fixes the functionality of pidof function call (and subsequently
pkill call that uses pidof).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-03-27 09:25:21 +08:00
Max Kriegleder
940ee9385c examples: add blecent and bleprph similar to mynewt-nimble apps
These example apps create a BLE central and peripheral based on
mynewt-nimBLE and work in companion. The apps are mostly based
on their equivalents, which can be found at
https://github.com/apache/mynewt-nimble/tree/master/apps

Signed-off-by: Max Kriegleder <max.kriegleder@gmail.com>
2025-03-27 02:30:00 +08:00
zhangshoukui
7b65b2bb41 drivertest_uart: Pass in the specified parameters to test
https://github.com/apache/nuttx/blob/master/tools/ci/testrun/script/test_framework/test_cmocka.py
cmocka --skip test_case_posix_timer|test_case_oneshot|write_default|read_default|burst_test|gpiotest01

In the CI of the community, this test is skipped because this test will block the terminal, and I think that the test added to cmocka should not be designed this way

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-26 15:23:40 +08:00
chao an
83eba58232 nxlooper: fix typo in nxlooper
replace CONFIG_O_MULTI_SESSION to CONFIG_AUDIO_MULTI_SESSION

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-26 02:41:36 +08:00
chao an
6d0a039cc9 system/nxplayer/nxrecorder: move apb buffer instance to stack
move apb buffer instance to stack to avoid alloc buffer from heap

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-26 02:41:17 +08:00
raiden00pl
e280e9bdb4 modbus: add an option to disable log
Introduce new configuration option that allow disable all logging functionality for FreeModBus.
This option is useful for small systems when we don't use any logging features.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-25 18:02:36 +01:00
Tiago Medicci
494554618e benchmark/mtd: Add MTD testing/benchmark application
This test allows measuring write and read operations on an MTD
flash device, evaluating its transfer rates.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2025-03-25 09:53:38 +08:00
Alan Carvalho de Assis
cdc5968c67 testing: Add Serial Error Reporting testing app
This commit adds support to Serial Error Reporting using the ioctl
TIOCGICOUNT.

This examples was inspired on this sample code:
https://stackoverflow.com/questions/78796301/c-serial-communication-why-does-read-lose-some-data-bytes-at-high-baud-rates/78800245#78800245

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-03-24 21:52:26 +08:00
zhanghongyu
fc142045a4 mbedtls: add MBEDTLS_SSL_COOKIE_C to Kconfig for manual configuration
current defconfig and mbedtls_config.h can not enable the definition
of MBEDTLS_SSL_COOKIE_C.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-03-24 21:49:36 +08:00
Huang Qi
16a16a9543 ostest: Implement mutex move test functionality
Add a new test for moving mutexes to verify behavior when a mutex is relocated.
* Introduced mutex_thread_args_t structure for thread arguments
* Created moved_mutex_thread_func to handle mutex operations in threads
* Updated mutex_test to include mutex_move_test for comprehensive testing

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-24 20:34:54 +08:00
Huang Qi
a8c62307ec examples/rust/slint: Update nuttx crate branch from master to main and fix pixel format check.
Changed the NUTTX dependency branch to 'main' for consistency with repository updates.
Updated pixel format check to use FB_FMT_RGB16_565 for better clarity and accuracy.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-24 20:34:29 +08:00
Huang Qi
99d2de6540 tools: Export NUTTX_INCLUDE_DIR for Rust builds
Set NUTTX_INCLUDE_DIR in the Rust build commands to include the necessary directories for proper compilation.
* Ensured correct include paths for Rust projects
* Improved build reliability for Rust components

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-24 20:34:29 +08:00