Commit graph

2443 commits

Author SHA1 Message Date
Matteo Golin
c814059f6c examples/txmorse: Example application for transmitting Morse code
Adds an example application leveraging the Morsey library for
transmitting Morse code, either to the console (debug) or to GPIO
devices for now as the two supported sinks.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-21 05:46:11 -03:00
Matteo Golin
5114ddd6c0 examples/baromonitor: New LVGL example which integrates with barometer
This example is an LVGL application which reads pressure and temperature
data from a barometer and displays it on gauges. It is intended to
provide an idea of what LVGL on NuttX can practically be used for in an
application.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-20 09:40:04 +08:00
Old-Ding
850f481344 examples: fix local socket address lengths
The configured path size already includes its NUL terminator. Adding
another byte made the maximum address length exceed sockaddr_un, while
ustream could write at sun_path[UNIX_PATH_MAX].

Use the existing bounded copy length directly as the path portion of
the socket address and rely on strlcpy for termination.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-13 12:28:07 +02:00
Matteo Golin
b39228cd41 !examples/audio_rtttl: Implement example using RTTTL library
This commit fixes the audio_rtttl example (which was undocumented and
previously used kernel-level functions) such that now it uses the RTTTL
parsing library. Contributors can implement 'players' for different
types of audio sinks. Currently, PWM is supported.

BREAKING: The previous version of this example only supported a single
board (Spresense) and uses public interfaces from the kernel code. Now
it only uses user-space interfaces and supports any board implementing
those interfaces. Users who relied on the old behaviour should submit a
patch to add a new player to this application which uses the desired
audio sink for the Spresense through user-space interfaces.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-13 10:02:37 +08:00
Mihai Pacuraru
3762a64bc6 examples/mqttc: add a subscriber client implementation example
Implement the subscriber client that optionally integrates
    the TLS layer and can reconnect to the broker if the
    application is running in unstable network environments.

    The client is compliant with all 3 levels of QoS.

Signed-off-by: Mihai Pacuraru <mpacuraru@protonmail.com>
2026-07-13 10:02:05 +08:00
Old-Ding
0566af556a examples: lp503x: Fix command argument handling
The lp503x shell command handlers receive the remaining input string as their argument. Treat empty colour arguments as the query case, document that query form in help text, and keep colour and brightness values signed until the existing range checks have run so invalid values are not silently truncated.

Guard the readline_stream() result before using it as a buffer index. readline_stream() returns EOF on end of file or failure, and writing buffer[len] before checking len can write before the stack buffer.

Use MAX_BRIGHTNESS consistently for brightness range checks.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:41:15 +08:00
Old-Ding
17b028e592 examples: wgetjson: check allocations before use
Several malloc() results in the wgetjson example were used before checking for allocation failure, which could crash low-memory paths before cleanup ran.

Return or propagate allocation errors before using the allocated buffers. Use explicit NULL comparisons for the new pointer checks to match review feedback.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:35:19 +08:00
Old-Ding
7fa0767e30 examples: nrf24l01_term: reserve RX terminator
read_pkt() terminates the received payload with buff[ret], but a full-size read can leave no room for that trailing NUL byte.

Limit the read length to one byte less than the buffer size so the received payload remains safely terminated before it is printed.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:30:49 +08:00
Old-Ding
13f04f65b1 examples: nrf24l01_btle: Fix RX terminator bounds
nrf24_read() reads up to the nRF24L01 maximum payload length and then appends a NUL terminator for the receive buffer. A full 32-byte payload can therefore write one byte past the local rbuf[32].

Reserve one extra byte for the terminator while keeping the read length capped at NRF24L01_MAX_PAYLOAD_LEN. Dump the number of bytes actually received in the debug path.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:28:21 +08:00
Old-Ding
54905cd0ff examples: xmlrpc: bound header value copy
xmlrpc_handler() stores HTTP header values in a CONFIG_XMLRPC_STRINGSIZE + 1 byte buffer, but it passed CONFIG_EXAMPLES_XMLRPC_BUFFERSIZE to xmlrpc_getheader(). With the defaults, that allows a 1024 byte copy into a 65 byte destination.

Make xmlrpc_getheader() treat size as the destination capacity, reserve one byte for the terminator, and pass sizeof(value) from the caller.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:27:44 +08:00
Old-Ding
50ffee7a85 examples: Fix network echo receive terminators
The netloop and poll TCP echo examples receive up to IOBUFFER_SIZE bytes and then append a NUL terminator before logging the data. A full-size receive can therefore write one byte past the input buffer.

Reserve one extra byte in the buffers that are terminated after recv(). Keep the receive limit and echo length capped at IOBUFFER_SIZE so the data path is unchanged.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:27:18 +08:00
Jorge Guzman
dd24407c71 examples/lvglterm: add USB HID keyboard input with cursor scrolling
Rework the terminal input selection into an explicit three-way Kconfig
choice so the format each keyboard delivers is picked up front:

  - On-screen keyboard (touch) - default, unchanged behaviour.
  - Matrix / upper-half keyboard - reads struct keyboard_event_s events
    (for example the M5Stack Cardputer matrix on /dev/kbd0).
  - USB HID keyboard - reads a byte stream (for example /dev/kbda with
    CONFIG_USBHOST_HIDKBD).

The physical-keyboard variant now polls the device non-blocking from the
LVGL thread (no dedicated task), mirroring the touch variant.  The USB
path decodes the stream with the keyboard codec, so with a driver built
for CONFIG_HIDKBD_ENCODED the Up/Down cursor keys scroll the terminal;
a plain-ASCII stream still works as ordinary key presses.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-07 09:52:42 +08:00
raiden00pl
c785d40af7 examples: add Lely CANopen slave example
add Lely CANopen slave example

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 11:02:13 -03:00
raiden00pl
962d90bb6e examples: add Lely CANopen master example
add Lely CANopen master example

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 11:02:13 -03:00
Old-Ding
e94e89113a examples: gps: bound NMEA line reads
The GPS example appends serial input to a fixed-size NMEA line buffer until CR or LF without checking the buffer limit. A malformed or overlong input line can write past the end of line[], and the code also uses ch even when read() does not return a byte.

Read bytes only after a successful read(), stop storing at MINMEA_MAX_LENGTH - 1, drain overlong lines until the line ending, and skip parsing truncated sentences.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 16:31:53 +08:00
Jorge Guzman
59d3a0d0ae examples/lvglterm: support physical keyboard input
Refactor the LVGL terminal into a shared core (lvglterm.c) plus two
selectable input variants: the existing on-screen touch keyboard
(lvglterm_touch.c) and a new physical keyboard variant (lvglterm_kbd.c) that
reads key events from a /dev/kbdN device and streams them to the shell.

The input source is chosen with a Kconfig choice (touch by default, keeping
the previous behaviour).  The keyboard variant reads its device from
CONFIG_EXAMPLES_LVGLTERM_KBD_DEV (default /dev/kbd0), overridable by the first
command-line argument, and scrolls the output with the Fn cursor keys.  A font
choice (UNSCII 8 or 16) is added for low-resolution displays.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-03 09:16:58 -03:00
Xiang Xiao
5ead824fff apps: Fix O_ACCMODE bitmask checks after Linux flag alignment
After aligning NuttX open() flag constants with Linux (O_RDONLY=0,
O_WRONLY=1, O_RDWR=2), code that used '(flags & O_RDONLY)' or
'(flags & O_WRONLY)' as a bitmask check is broken because O_RDONLY
is now 0.  Fix by using '(flags & O_ACCMODE)' comparisons instead.

  - usrsocktest: replace 'flags & O_RDWR' with 'flags & O_ACCMODE'
    in fcntl F_GETFL assertions
  - dd: verify mode used '(oflags & O_RDONLY)' to detect verify;
    replace with '(oflags & O_ACCMODE) == O_RDWR'
  - dpopen: replace '(oflag & O_RDWR) == O_RDWR' with
    '(oflag & O_ACCMODE) == O_RDWR'
  - usbmsc: replace 'flags & O_WRONLY' with
    '(flags & O_ACCMODE) == O_RDONLY'
  - fcntl_test: replace '(flags & O_WRONLY) == 0' with
    '(flags & O_ACCMODE) == O_RDONLY'

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-30 12:19:58 -04:00
Xiang Xiao
d172f81ecc apps: Replace O_RDOK with O_RDONLY after alias removal
The O_RDOK/O_WROK aliases have been removed from fcntl.h.  Replace
all remaining O_RDOK usage with O_RDONLY in the apps repository.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-29 07:42:09 +02:00
Xiang Xiao
4c560ef0a2 apps: Replace O_RDOK with O_RDONLY after alias removal
The O_RDOK/O_WROK aliases have been removed from fcntl.h.  Replace
all remaining O_RDOK usage with O_RDONLY in the apps repository.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-28 13:00:52 +02:00
Xiang Xiao
326b68aa36 examples/userfs: use designated initializers for struct dirent
The g_rootdir[] table initialized each entry's struct dirent member
positionally as { DTYPE_FILE, "FileN" }, which assumes d_type is the
first field.  This breaks when struct dirent gains the POSIX d_ino field
as its first member (see apache/nuttx: "fs/dirent: add d_ino member to
struct dirent"): the file-name string would be assigned to d_type,
producing -Wint-conversion warnings and an "initializer element is not
computable at load time" error.

Use designated initializers (.d_type / .d_name) so the table is robust
against the field order of struct dirent.

Also fix a 'Initiallly' typo in a nearby comment flagged by codespell.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-22 10:20:43 -03:00
Nightt
477d04b975 examples/gps: print units after measurements
Move GPS example units after the printed values to match the requested output style.

Wrap long printf format strings for checkpatch.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-20 11:51:35 -03:00
Nightt
1a6d06c3be examples/gps: show units in output
The GPS example prints parsed measurements without explicit units. The RMC
floating-point speed path also used minmea_tocoord(), even though speed is
not a coordinate.

Add units to the output labels, print speed with minmea_tofloat(), and print
GGA altitude as a scaled value with the sentence-provided unit.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-20 11:51:35 -03:00
Shoji Tokunaga
8d6c495365 examples/rust: Show command arguments in hello_rust_cargo
Print each argument passed from nsh with its index, and report when
the example is running on the simulator target. This makes the Rust
example demonstrate both C argv handling and target-specific output.

Signed-off-by: Shoji Tokunaga <toku@mac.​com>
2026-06-20 10:33:46 -03:00
Shoji Tokunaga
d1202bd501 examples/rust: Avoid the infinite loop on sim for hello_rust_cargo
On the sim target (Windows/macOS/Linux), hello_rust_cargo_main() ended
with an infinite `loop {}` that never returned control to NSH, so the
example could not exit and the shell prompt hung.

Introduce a Cargo `sim` feature that is enabled only when CONFIG_ARCH_SIM
is set, and use it to compile out the trailing infinite loop and return 0
instead. Other embedded targets keep the original looping behavior.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-20 10:33:46 -03:00
Tiago Medicci
1e19ceb347 examples/webpanel: Add a web panel application to configure NuttX
Initial development of the NuttX's Web Panel application. This is
a self-hosted web page application that enables retrieving system
info, provides a simple NSH terminal and enables uploading files.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-18 09:14:36 -03:00
Tiago Medicci
ec764fbbab examples/lws_echo: Add a simple websocket server example
This commit adds a simple websocket server example that echoes data
back to the client using libwebsockets.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
c51180d780 examples/mdnsd: Create an event-based starter for mDNS daemon
Start the mDNS daemon based on the event of getting a new IP
address for any of the system's network interfaces. This allows
DHCP client to trigger the mDNS daemon after getting a new IP
address, for instance.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:24:42 -03:00
Nightt
afc652243e examples/thttpd: use procfs for tasks CGI
The tasks CGI used nxsched_foreach() to walk scheduler internals and read
fields directly from struct tcb_s. That exposes an application example to
non-standard OS internals.

Read task information from /proc/<pid>/status instead, matching the public
procfs interface used by other task listing tools.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-14 08:56:44 -03:00
Felipe Moura
8b43c71595 examples/rng90: add RNG90 example
Add a new RNG90 example application that opens the RNG90 character device, reads random bytes, and prints them in hexadecimal format.

The example supports optional command-line arguments for device path and byte count and integrates with Kconfig, Make, and CMake build flows.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-06-09 12:36:04 +08:00
Shoji Tokunaga
840c2f30db apps/rust: Add dependencies for Rust cargo in make builds
Add a Rust make helper that collects crate input files, and use it for
the Rust hello and slint examples.

This makes the generated Rust static libraries depend on the crate
sources, manifests, build scripts. Hook the libraries into both context
and all, so re-running make after editing Rust inputs rebuilds the crate.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-04 08:58:07 -03:00
Arjav Patel
c106a02b58 examples/microros_sub: Add minimal Int32 subscriber example.
Mirror of microros_pub for the receive direction.  Creates a node,
subscribes to /nuttx_sub with std_msgs/Int32, drives an rclc_executor
spin loop, and prints each received value.  Exercises the new
rclc_executor + subscription callback path on top of the
microros_transport library shipped in apps/system/microros.

Validates the NuttX-native transport in the agent->client direction
end-to-end against a micro-ROS agent + ros2 topic pub on the host.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-04 14:30:34 +08:00
Arjav Patel
1081225509 examples/microros_pub: Add minimal Int32 publisher example.
End-to-end exercise of the micro-ROS stack on NuttX: calls
microros_transport_init() to register the configured backend,
brings up rclc_support / node / publisher, publishes 30
std_msgs/Int32 messages on /nuttx_pub at 1 Hz, then tears the
stack down cleanly.

The example's Make.defs adds $(APPDIR)/system/microros/transport
to its own CFLAGS rather than the system/microros Make.defs, so
the transport-glue header path is not pushed into the global
search path for unrelated apps.

Serves as the smoke test for the transport layer and as a template
for downstream publisher apps.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-02 00:15:25 +08:00
Nightt
c44f9a0556 apps: Fix unchecked strdup()/asprintf() as requested in #1727
Add missing failure handling for direct strdup() and asprintf() calls where the allocated result is consumed locally before any NULL/error check.

This keeps the scope to the functions named in #1727 and avoids changing pass-through return sites where callers already receive NULL on allocation failure.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-23 16:30:52 -04:00
Shoji Tokunaga
c9c5c75d08 examples/rust: Fix hello_rust_cargo CMake settings
Use the hello_rust_cargo-specific Kconfig symbols for the built-in
application stack size and priority.

Previously, CMake referenced the generic hello example symbols, so the
configured hello_rust_cargo stack size could be ignored.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-05-22 15:00:26 +08:00
raiden00pl
5cce60aa9a examples: add pulse count example
add pulse count driver example. Previously it was mixed with PWM example.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-22 13:39:32 +08:00
raiden00pl
2ad3e4e17b examples/pwm: remove refenrences to PULSECOUNT
Remove refenrences to PULSECOUNT from PWM example.
Pulse count driver will be handled by separate application.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-22 13:39:32 +08:00
Nightt
fcd10aa725 examples/lp503x: Open device write-only.
Open the LP503X device with O_WRONLY because the driver registers the device node with write-only permissions and the example controls it through ioctl().

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-22 13:39:04 +08:00
Nightt
b4f1e29494 apps: Fix additional open() arguments.
Add missing mode arguments to direct open() calls that use O_CREAT.

Also open the lp503x device with explicit read-only flags instead of O_CREAT, matching the device-node usage.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-22 13:39:04 +08:00
Xiang Xiao
f9f59bd0f8 !apps: drop redundant casts on tv_sec/tv_nsec and fix printf formats
Now that time_t is unconditionally 64-bit (signed int64_t) and the
struct timespec fields tv_sec / tv_nsec are wide enough on their own,
the explicit (uint64_t)/(int64_t)/(int) casts that used to guard the
multiplications and subtractions in *_us / *_ms / *_ns helpers are no
longer needed.  Drop them to keep the timekeeping math readable.

In the same spirit, this commit also normalises the printf-style format
specifiers and casts used to print tv_sec / tv_nsec / tv_usec values.
The prior code was a mix of "%d"/"%u"/"%ld"/"%lu"/"%lld" with matching
(int)/(unsigned long)/(long long) casts; some formats truncated time_t
on 32-bit hosts, others mismatched signedness or width.  Replace all
such cases with the portable POSIX-recommended forms:

  - tv_sec  (time_t,       signed, impl-defined width) -> %jd  + (intmax_t)
  - tv_nsec (long,         signed)                     -> %ld  (no cast)
  - tv_usec (suseconds_t / long)                       -> %ld  (no cast)

Also drop two stale `(FAR const time_t *)&ts.tv_sec` casts that are
unnecessary now that ts.tv_sec is plain time_t.

Arithmetic-cleanup files (existing scope):

  - benchmarks/cyclictest/cyclictest.c:        timediff_us()
  - benchmarks/sd_bench/sd_bench_main.c:       get_time_delta_us()
  - examples/oneshot/oneshot_main.c:           maxus computation
  - examples/watchdog/watchdog_main.c:         current_time_ms (x2)
  - industry/nxmodbus/nxmb_internal.h:         nxmb_util_clock_ms()
  - netutils/ntpclient/ntpclient.c:            timespec2ntp()
  - netutils/ptpd/ptpd.c:                      ptp_adjtime()
  - system/dd/dd_main.c:                       elapsed accounting
  - testing/drivers/drivertest/drivertest_posix_timer.c:
                                               get_timestamp()
  - testing/drivers/sd_stress/sd_stress_main.c:get_time_delta()
  - testing/sched/getprime/getprime_main.c:    elapsed accounting
  - testing/sched/pthread_mutex_perf/pthread_mutex_perf.c:
                                               timespec_avg()

Printf-format-fix files (new in this revision):

  - examples/adjtime/adjtime_main.c
  - examples/charger/charger_main.c
  - examples/netpkt/netpkt_ethercat.c
  - fsutils/mkfatfs/mkfatfs.c
  - graphics/tiff/tiff_initialize.c
  - netutils/ptpd/ptpd.c
  - nshlib/nsh_timcmds.c
  - system/coredump/coredump.c
  - system/ptpd/ptpd_main.c
  - testing/drivers/drivertest/drivertest_oneshot.c
  - testing/mm/kasantest/kasantest.c
  - testing/ostest/semtimed.c
  - testing/sched/pthread_mutex_perf/pthread_mutex_perf.c
  - testing/sched/timerjitter/timerjitter.c
  - testing/testsuites/kernel/time/cases/clock_test_clock01.c
  - testing/testsuites/kernel/time/cases/clock_test_smoke.c

No behavioural change.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-22 13:38:25 +08:00
Eren Terzioglu
173e19cde1 apps/examples: Add path option to SPI Slave test
Add path option to spislv_test example

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-05-19 07:02:31 -03:00
raiden00pl
8bd6615034 examples/pwm: remove references to CONFIG_PWM_MULTICHAN
remove references to CONFIG_PWM_MULTICHAN

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-18 11:35:09 -04:00
Xiang Xiao
a6477ec8dc !apps: replace sclock_t with clock_t and drop redundant time_t/off_t casts
Align with the upstream nuttx change that drops the sclock_t alias now
that clock_t is itself a signed 64-bit type (int64_t).  Beyond the pure
sclock_t -> clock_t rename, this commit also removes the
now-unnecessary (time_t)-1 / (time_t)0 / (off_t)-1 casts that were
papering over the previously-unsigned time_t.

Files touched:

  - examples/alarm/alarm_main.c:        sclock_t -> clock_t
  - netutils/dhcpd/dhcpd.c:             sclock_t -> clock_t
  - netutils/ftpd/ftpd.c:               sclock_t -> clock_t
  - netutils/thttpd/libhttpd.c,
    netutils/thttpd/tdate_parse.c:      drop (time_t)-1 / (time_t)0 /
                                        (off_t)-1 sentinel casts
  - system/resmonitor/filldisk.c,
    system/zmodem/zm_receive.c:         sclock_t -> clock_t
  - testing/ostest/wdog.c:              sclock_t -> clock_t (the bulk
                                        of the rename, 30 sites)
  - testing/testsuites/kernel/syscall/cases/{clock_nanosleep_test,
    fsync_test,time_test}.c:            drop (time_t)-1 casts in the
                                        new signed-time_t world

No behavioural change.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
Xiang Xiao
72837c8d26 !apps: drop CONFIG_SYSTEM_TIME64 conditionals
NuttX always uses a 64-bit system clock now (time_t/clock_t are
always 64-bit). Remove the obsolete CONFIG_SYSTEM_TIME64 #ifdef
branches and Kconfig dependency.

  - examples/dronecan: drop SYSTEM_TIME64 dependency
  - examples/netlink_route: always use PRIx64
  - netutils/netinit: always use the 1-hour LONG_TIME_SEC
  - netutils/ptpd: always pack the 48-bit seconds field and apply
    the 64-bit overflow guard in timespec_delta_ns()
  - testing/ostest/semtimed: always validate tv_sec >= 0

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
Xiang Xiao
3adb14f12d !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support
The matching nuttx commit removes CONFIG_HAVE_LONG_LONG; clean up the
remaining users in nuttx-apps so that "long long" is always assumed:

  - examples/noteprintf, examples/nxscope:
        unconditionally exercise the %lld / long long branch.
  - fsutils/mkfatfs/configfat.c:
        drop the 32-bit fall-back paths in mkfatfs_nfatsect12/16/32;
        always use uint64_t for the FAT-size arithmetic.
  - logging/nxscope/nxscope_chan.c:
        drop the CONFIG_HAVE_LONG_LONG guard around the 64-bit
        sample helpers.
  - netutils/ftpd, netutils/ntpclient:
        always emit the 64-bit format strings.
  - testing/fs/fstest/fstest_main.c:
        drop the parallel 32-bit verification path; keep only the
        64-bit (long long) random pattern generator.
  - system/zmodem/host/nuttx/compiler.h:
        remove the host-side CONFIG_HAVE_LONG_LONG stub macro.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
Matteo Golin
5b0cae9ab0 !apps: Simplify NuttX initialization
BREAKING: In an effort to simplify board initialization logic for NuttX,
NSH will no longer support architecture initialization. This will happen
during boot via the BOARD_LATE_INITIALIZE option. The boardctl command
BOARDIOC_INIT is also no longer available from user-space.

Quick fix:
Any application relying on BOARDIOC_INIT should now enable
BOARD_LATE_INITIALIZE to have initialization performed by the kernel in
advance of the application running. If control over initialization is
still necessary, BOARDIOC_FINALINIT should be implemented and used.
Boards relying on NSH for initialization should also enable
BOARD_LATE_INITIALIZE instead.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-06 13:27:05 +08:00
Tiago Medicci
901278a4ba examples: Remove deprecated rmtchar example application
The upper-half RMT driver is no longer available on NuttX. Instead,
Espressif's RMT peripheral was bound directly to the lirc driver.
For testing purposes, use the `irtest` application. NuttX OS PR
https://github.com/apache/nuttx/pull/18654 removed the upper-half
driver interface used by this application, so removing it does not
break any existing feature on NuttX.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-04-24 14:58:05 +02:00
raiden00pl
773f69d5d9 modbus: add nxmodbus
NxModbus is a lightweight Modbus protocol stack implementation for NuttX RTOS.

This commit adds:
- nxmodbus stack
- nxmbserver - Modbus Server (Slave) example
- nxmbclient - Modbus Client (Master) tool

Supported Modbus transports:
- ASCII
- RTU over serial port
- TCP
- RAW (ADU) for custom transport implementations

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-20 12:45:17 -03:00
Michal Lenc
7dc8cec1ac examples/hello_nim/Kconfig: name consistent with other Hello World apps
Use "Hello, language" scheme to keep the naming consistency with other
Hello World applications for different languages.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-04-13 00:28:32 +08:00
Piyush Patle
96a003072d include/debug.h: fix checkpatch fallout in touched apps files
Clean up style issues in the files touched by the <nuttx/debug.h> include
migration so the full apps-side PR passes checkpatch.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-11 10:39:27 -03:00
Piyush Patle
9d849adfab include/debug.h: Use <nuttx/debug.h> in apps
Replace app-side includes of <debug.h> with <nuttx/debug.h> to use the
header from the NuttX tree explicitly after the header move.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-11 10:39:27 -03:00