1343 Commits

Author SHA1 Message Date
Jukka Laitinen
479d206dff system/cdcacm: Support sercon and serdis in CONFIG_BUILD_KERNEL
- Put sercon and serdis in separate source files, so that the main
functions can be compiled in also in kernel build.
- Don't store the ttyacm handle in the application, it is stored
in kernel side in case of the system_cdcacm

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-09-17 12:38:05 +02:00
Lars Kruse
df711238fe system/dd: implement "--help" parameter
Previously the usage hints were displayed only in case of errors.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2025-09-12 09:33:13 +08:00
Lars Kruse
db36c8c617 system/dd: emit status messages to stderr (not stdout)
Previously `dd` clobbered its output by writing status messages (e.g.
transfer statistics) to stdout.

Now all status messages are written to stderr.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2025-09-12 09:33:13 +08:00
Filipe Cavalcanti
6bcb347982 system/ntpc: update ntpc messages
Updates verbosity on ntpc commands. Also updated documentation on NuttX side.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-09-05 23:47:36 +02:00
YAMAMOTO Takashi
71ce94a13e system/dd/dd_main.c: fix a typo in a comment
Found by the CI.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-08-26 21:56:12 +08:00
YAMAMOTO Takashi
93ced081dc system/dd/dd_main.c: replace #if defined with #ifdef
Although I personally prefer the former, at least one reviewer
preferred the latter. I coundn't find project-wide preferences.
Anyway, this is not important for me.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-08-26 21:56:12 +08:00
YAMAMOTO Takashi
78bae4f14f system/dd: portability to non-nuttx platforms
while this is not a goal for this repository,
it's convenient for me (hopefully for some others too)
to be able to build this for other platforms.

an obvious downside is to have a few more ifdefs.

tested with:
```
/opt/wasi-sdk-25.0/bin/clang -Wall -Oz -s -o dd.wasm dd_main.c
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-08-26 21:56:12 +08:00
Zhe Weng
7bfd5e5790 apps/system: Move input/monkey to apps/graphics/input
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-08-12 20:20:01 +08:00
wangjianyu3
7cc7cb8ffa system/uORB: Add flags for gnss satellite format
Some applications require satellite information for positioning using the flag USED_IN_FIX.
More details: https://github.com/apache/nuttx/pull/16805

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-08-03 22:56:12 +08:00
wangjianyu3
f34ae4587a system/gdbstub: Add depends of LIB_GDBSTUB
in function `gdbstub_main':
undefined reference to `gdb_state_init'
undefined reference to `gdb_process'
undefined reference to `gdb_state_uninit'

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-07-18 22:42:03 +08:00
Niccolò Maggioni
0c680bcb8e system/coredump: Fix missing loglevel to logmask conversion.
The current setlogmask call used in the coredump app specifies a raw log level
instead of a bitmask, and this causes wrong evaluations later on when that value
is checked against a mask. Therefore the LOG_UPTO macro is added for conversion.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-07-09 09:54:40 +02:00
Jean THOMAS
c7b395e7da system/settings: Add spaces after each switch 'case' 2025-06-26 13:22:47 -03:00
Jean THOMAS
4be82876e4 system/settings: general code cleaning
* Remove duplicate checks, use switch/case whenever possible
* Remove assertions just before if () condition checking the exact
  same thing
* Replace if (condition) assert(0) with assert(condition)

Signed-off-by: Jean THOMAS <jean@lambdaconcept.com>
2025-06-26 13:22:47 -03:00
wangmingrong1
92c490579d gcov: Output mode judgment is implemented in the kernel layer
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 23:48:01 +08:00
wangmingrong1
dfbaedd5c2 gcov: Refactoring the implementation framework of gcov
All implementations of gcov are sunk to the kernel implementation
1. Support three dump modes: serial port output, single file output, standard output

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 23:48:01 +08:00
wangmingrong1
25d43c65db apps/gcov: Alloc to strip 0
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 23:48:01 +08:00
Jean THOMAS
bb508520f1 system/settings: fix assertion triggered by uninitialized variables
Fix non-NULL pointer assertion in `get_setting()` caused by
uninitialized pointer variables.

Signed-off-by: Jean THOMAS <jean@lambdaconcept.com>
2025-06-26 19:23:02 +08:00
wangjianyu3
c4ff19a7e4 system/fastboot: fix typos of response error log
Fix typos of sparse header comments and download/upload response error log.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-25 10:01:27 +02:00
wangjianyu3
9df322d938 system/fastboot: add disconn for usb transport
Disconnect usbdev when deinit USB transport.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-25 10:01:27 +02:00
wangjianyu3
4b5af957ac system/fastboot: remove interest and close epoll
Remove fds from the interest list and close epoll if need.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-25 10:01:27 +02:00
wangjianyu3
6afed10118 system/fastboot: add depends for TCP poll
Add TCP backlog dependence for poll(),
network related configurations referenced to may has not enable it,
without which the TCP handshake will fail.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 15:45:51 +08:00
wangjianyu3
11cf4211ab system/fastboot: enable usb and tcp the same time
Add support for enabling USB and TCP transport at the same time.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 15:45:51 +08:00
wangjianyu3
abf9fbee30 system/fastboot: switch to epoll
Switch from poll() to epoll().

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 15:45:51 +08:00
wangjianyu3
e23ba4891d system/fastboot: rename argument context to ctx
Rename argument "context" to "ctx" for all functions.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 15:45:51 +08:00
wangjianyu3
7790894bb6 system/fastboot: add support for fastboot tcp
Add TCP network transport support for fastboot, users can
add "-s tcp:HOST[:PORT]" option to specify a network device.

Examples

  fastboot -s tcp:192.168.100.2 getvar version
  fastboot -s tcp:192.168.100.2 flash virtblk0 fastboot.c
  fastboot -s tcp:192.168.100.2 oem shell "uname -a"

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-18 22:06:08 +08:00
wangjianyu3
75033b7d26 system/fastboot: add func for context and usbdev
fastboot_context_initialize : initialize fastboot context
fastboot_context_deinit     : deinitialize fastboot context
fastboot_usbdev_initialize  : initialize usbdev and open USB endpoint
fastboot_usbdev_deinit      : close USB endpoint

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-18 22:06:08 +08:00
wangjianyu3
88fea63ff4 system/fastboot: replace GETUINT32 with be32toh
Replace macro `FASTBOOT_GETUINT32` with function `be32toh()`.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-18 22:06:08 +08:00
raiden00pl
faea03f1fd add system/adcscope - streaming tool for ADC
add adcscope app allowing to stream data from ADC device with logging/nxscope.
Useful for testing ADC drivers.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-17 14:29:08 -03:00
wangjianyu3
38bd6accea system/fastboot: add const for memdump_print_t
Add qualifier "const" to the declaration of `memdump_print_t`,
the value of the 2nd argument will not be changed.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-17 20:57:23 +08:00
Matteo Golin
5e50e2c1f9 system/syslogd: Initial implementation
Initial implementation of syslogd including version information, simple
usage help and UDP transmission. The current implementation transmits
RFC 5424 formatted syslog entries over UDP for consumption by a syslog
collector. Only some options from the manpage are implemented since
NuttX doesn't currently have the ability for some of the more complex
features (-l, etc.).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-06-17 20:43:58 +08:00
wangjianyu3
7375f6574e system/fastboot: move usbdev init after help
Move initialization of usbdev to after help().

This patch fix that even users just run `fastbootd -h`,
the usbdev will also be (re)initialized,
and if the daemon is running the status will be broken.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-15 11:19:49 +08:00
wangjianyu3
4c605ac43f system/fastboot: dump all memory regions
Add examples for oem memdump dumping all memory regions.

Host side

  $ fastboot oem memdump
  fastboot oem memdump 0x20000 0x28000
  fastboot get_staged 0x20000.bin
  fastboot oem memdump 0x40000000 0xf590000
  fastboot get_staged 0x40000000.bin
  fastboot oem memdump 0x4ff30000 0xd0000
  fastboot get_staged 0x4ff30000.bin
  FAILED (remote: 'Invalid argument')
  fastboot: error: Command failed

Device side

  nsh> fastbootd -h
  Usage: fastbootd [wait_ms]

  memdump:
      fastboot oem memdump 0x20000 0x28000
      fastboot get_staged 0x20000.bin
      fastboot oem memdump 0x40000000 0xf590000
      fastboot get_staged 0x40000000.bin
      fastboot oem memdump 0x4ff30000 0xd0000
      fastboot get_staged 0x4ff30000.bin

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-15 11:19:21 +08:00
wangjianyu3
4b8b96f060 system/uORB: fix orb_subscribe_multi undefined
Fix `orb_subscribe_multi` undefined error.

/workspace/prebuilts/gcc/linux/arm64/bin/../lib/gcc/aarch64-none-elf/13.2.1/../../../../aarch64-none-elf/bin/ld: apps/system/uorb/libapps_uorb_listener.a(listener.c.o): in function `listener_monitor':
/workspace/apps/system/uorb/listener.c:803:(.text.listener_monitor.constprop.0+0xe4): undefined reference to `orb_subscribe_multi'
/workspace/apps/system/uorb/listener.c:803:(.text.listener_monitor.constprop.0+0xe4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `orb_subscribe_multi'

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-05 19:43:10 +08:00
raiden00pl
32bcd87d8f system: unify Private Types banners
unify Private Types banners according to NuttX coding standard

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-28 10:16:50 +08:00
wangjianyu3
0fbeae7f0d uORB/sensor: Add timestamp for GNSS data
Add timestamp for GNSS measurements and clock, for matching.

When recovering the combination of `GnssMeasurement` and `GnssClock` into
[GnssData](https://android.googlesource.com/platform/hardware/libhardware/+/
           refs/heads/android14-release/include/hardware/gps.h#1748),
the reason for splitting is that the uORB buffer is not large enough to
accommodate `GnssData`, since different topics cannot guarantee the
same timing when publishing and subscribing data, we need an index to match.

WARNING: A new member "timestamp" of type uint64_t has been added at
the beginning of the struct "sensor_gnss_measurement" and "sensor_gnss_clock".

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-05-12 16:22:10 +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
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
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
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
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
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
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