Commit Graph

8380 Commits

Author SHA1 Message Date
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
Roy Feng
cc3392452a nshlib: typo fixed in Kconfig
`NSH_DISABLE_NFSMOUNT` should be `NSH_DISABLE_NFSMOUNT`

Signed-off-by: Roy Feng <roy.feng@sony.com>
2025-03-24 20:33:26 +08:00
raiden00pl
e336ebad5e cmake: fix cmake build for FreeModBus
fix cmake build for FreeModBus:

  1. nuttx-apps/modbus/mb.c:50:12: fatal error: mbrtu.h: No such file or directory
     50 | #  include "mbrtu.h"

  2. nuttx-apps/modbus/functions/mbutils.c:41:10: fatal error: port.h: No such file or directory
     41 | #include "port.h"

  3. various "undefined reference to" errors

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-24 02:04:36 +01:00
raiden00pl
9e2775de98 fix build for canutilis/lely-canopen
This commit fixes lely-canopen build for make and cmake.
It also update lely commit tag to the latest lely master.

The required changes are now split into several patches
to make it easier to fix any issues in the future.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-22 08:53:26 +08:00
Tomasz 'CeDeROM' CEDRO
bbcba55bbc examples/xmlrpc: Fix calls buffers size.
* examples/xmlrpc/calls.c used 80 bytes call buffers.
* update buffers to CONFIG_XMLRPC_STRINGSIZE+1 that is build time configurable.
* this keeps buffers size coherent with configuration.
* updated internal variable names to pass lint checks.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-21 14:21:31 +08:00
Lup Yuen Lee
1e4a952eea examples/fbcon: Fix endchoice and help in Kconfig
This PR fixes the `endchoice` and `help` in the Kconfig for fbcon
- https://github.com/apache/nuttx-apps/pull/3029#discussion_r2006527306

This patch will fix these build errors:
```text
apps/examples/fbcon/Kconfig:62: syntax error
apps/examples/fbcon/Kconfig:172: unknown option "---help--"
```
https://github.com/lupyuen/nuttx-riscv64/actions/runs/13981663903/job/39147989438#step:5:158

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2025-03-21 09:49:06 +08:00
simbit18
95c99d933a build.yml: Brought into sync with NuttX repository
added
    CI: Kill CI Test after 2 hours
    see https://github.com/apache/nuttx/pull/14849

    job msvc Windows native
    see
    https://github.com/apache/nuttx/pull/13894
    https://github.com/apache/nuttx/pull/15989

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-21 07:15:31 +08:00
Tim Hardisty
3e37dd2517 Add Framebuffer Console Example App 2025-03-20 10:19:49 -03:00
Eren Terzioglu
60e4052f81 games/snake: Add snake game
Add snake game support to have more demo games to show

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-18 17:16:39 -03:00
Michal Lenc
0639a2ad7b boot/nxboot: enhance bootloader capabilities and decision logic
This commit enhances the bootloader capabilities. The image's header
is extended with header version, size, platform identifier and
pointer to optional next header. CRC32 now includes part of
the header in its calculation as well.

The change also avoids having two different magics for image uploaded
over programmer and update image. Both these images have the same
magic and this magic is changed internally by the bootloader's logic.
The change is needed because image with standard magic is automatically
considered as a confirmed image (uploaded with programmer).

The current implementation avoids tails at all, therefore the user
application uploading the image does not have to erase the tail before
new upload. The image is considered as confirmed if it has standard
magic or its recovery is present. This means the bootloader has to
erase the header of the update image after the update is done (to
avoid update loop and to mark the image as unstable). This page is
written back during the confirmation.

This is a breaking change, but necessary for the future development
of the bootloader. The added header version field will allow to
add minor/major updates while keeping the backwards compatibility.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Pavel Pisa <pisa@fel.cvut.cz>
Co-authored-by: Karel Koci <cynerd@email.cz>
2025-03-14 10:35:49 -03:00
SPRESENSE
3b03636e95 examples/bmi160: Fix typo of depends on
Fix SENSORS_BMG160 to SENSORS_BMI160.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-03-07 11:21:34 +01:00
chenrun1
9c829f6650 examples: Add depends to different test cases
Summary:
  1.ftpd
  2.unionfs
  3.userfs
  4.nxffs
  5.smart

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-03-06 09:34:24 +01:00
chenrun1
a7020e45cc benchmarks/osperf: fix warning maybe-uninitialized
Summary:
In function 'performance_gettime',
    inlined from 'hpwork_performance' at osperf.c:245:10:
osperf.c:123:3: error: 'result.end' may be used uninitialized [-Werror=maybe-uninitialized]
  123 |   up_perf_convert(result->end - result->start, &ts);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
osperf.c: In function 'hpwork_performance':
osperf.c:228:29: note: 'result.end' was declared here
  228 |   struct performance_time_s result;
      |                             ^~~~~~
CC:  audio/lib_buffer.c
CC:  common/arm64_initialize.c
CC:  builtin/lib_builtin_getname.c

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-03-05 20:00:52 +01:00
chenrun1
a0f05d0c62 ostest:Fix the issue that nxevent pthread was not executed, causing case failed
Summary:
  In the case of slow overall system response (such as when MM_KASAN is turned on), the nxevent case work thread will not be executed and will be switched back to the main thread, so that the event does not get the expected result and the case fails.
By adjusting the thread priority, the work thread can be scheduled to avoid the expected result failure

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-03-05 10:08:17 +01:00
chenrun1
2e61c6bff8 examples/romfs:add EXAMPLES_ROMFS_RAMDEVNO
Summary:
  add EXAMPLES_ROMFS_RAMDEVNO for custom initliaze ramdisk number

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-03-05 10:02:22 +01:00
Stepan Pressl
91aa0b8ae8 benchmarks/cyclictest/cyclictest.c: periodic output and -q option
Without the -q (--quiet) option, the program outputs the thread
stats every 100ms, which is compatible with the original
rt-tests/cyclictest utility.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-03-04 06:16:57 +08:00
tengshuangshuang
844b9c657d apps/testing:fix uclibc atomic make.defs error
In the previous changes to the apps/testing folder, I added an extra slash in the make.defs of uclibcxx, atomic.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-03-03 16:03:13 +01:00
YAMAMOTO Takashi
036fe7668d toywasm: regen for v66.0.0
```
REF=b0e100a4ebd666f02b2bb9222d402a9f399a740b ./regen.sh
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
nuttx-12.9.0 nuttx-12.9.0-RC0 nuttx-12.9.0-RC1
2025-02-28 10:24:51 +01:00
YAMAMOTO Takashi
322c81bd8a toywasm: bump to v66.0.0
the included changes are:

```shell
spacetanuki% git log --pretty=oneline v65.0.0..v66.0.0
b0e100a4ebd666f02b2bb9222d402a9f399a740b (tag: v66.0.0) wapm.toml: bump the version
7604b9b896d7f48c46e484f560bbc679a87b0241 LICENSE: new year
c674c030025aab4cac94962328ae69590c5f1367 test/spectest.wat: update to match the spec harness
a5cf6bda2b2e022775d4d2d54aa11afc2e1295c2 test/fetch-spec-test.sh: update wasm-spec-test
c97f2d8e9e19d586d46b5db48a0582f374796d12 test/prepare-spec-test.sh: bump https://github.com/WebAssembly/multi-memory
b5f75600df812c421855ab7008b13113658af1c4 test/prepare-spec-test.sh: bump https://github.com/WebAssembly/spec version
1bfdc750dc18d085ac739a629b8b12b7ed9d9f6b escape.c: fix an integer overflow issue, especially on 32-bit archs
e15be49961d32e1878bfea399fd9cd609ff94045 escape.c: fix a comment
spacetanuki%
```

for nuttx-apps, only the escape.c fix is important.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-02-28 10:24:51 +01:00
Stepan Pressl
31daca45ba benchmarks/cyclictest: the rt-tests cyclictest NuttX Port
Despite the existence of the patch in benchmarks/rt-tests,
this commit adds the NuttX Official cyclictest utility.

The main difference is the introduction of different
waiting methods next to POSIX clock_nanosleep:
- The thread can wait for a g_waitsem, posted by board_timerhook()
  if CONFIG_SYSTEMTICK_HOOK is defined.
  Since the semaphore is only one, only one thread can wait.
- The thread can wait for a Timer Device to timeout.
  The timer's timeout determines the waiting time of the thread.
  Since the timer is only one, again, only one thread can wait.

The user can measure the elapsed time using clock_gettime
or the timer device itself. The different waiting and measuring
methods were introduced because NuttX, by default, does not
offer fine measuring capabilities using POSIX time functions
(as of Feb 25).

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-02-27 11:30:37 -03:00
Eren Terzioglu
8fcff3e88c games/brickmatch: Add led matrix output option
Add led matrix output option for brickmatch game example

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 11:31:02 -03:00
Eren Terzioglu
9c7e298097 games/brickmatch: Add GPIO input option
Add gpio input option for brickmatch example

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 11:31:02 -03:00
chenxiaoyi
0da270d9d6 system/debugpoint: fix bug the length option parsing error
The debugpoint program has an option "-l" which requires an argument,
which means the optstring to getopt() should be "l:".

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-02-25 13:07:58 -03:00