Rebuild from a clean tree in one recipe so a stale state no longer breaks the build.
This commit also simplify some build logic.
Signed-off-by: raiden00pl <raiden00@railab.me>
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>
Run the bitmap converter through the Python formatter required by checkpatch so the Python 3 print syntax fix passes the project style checks.
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
Use Python 3 print function syntax so bitmap_converter.py can be parsed by current Python interpreters while preserving the existing usage message and exit path.
Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
Keep the default zero CPU value when the procfs load file cannot be read, and trim only the newline that was actually present. This avoids parsing uninitialized stack data in fillcpu and avoids writing before the showinfo CPU buffer when fgets returns no data.
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
Use 0 as a Kconfig placeholder. The nuttx build rejects unset keys
and can generate random values when configured.
BREAKING CHANGE: CONFIG_FSUTILS_PASSWD_KEY1..4 no longer default to
0x12345678 / 0x9abcdef0. Configs that relied on those defaults must
set keys manually or enable BOARD_ETC_ROMFS_PASSWD_RANDOMIZE_KEYS in
nuttx. Fix: set keys in menuconfig or enable random key generation.
Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
This commit disables the `no-maybe-uninitialized` warning because
it's wrongly evaluated after increasing the optimization level of
the Python's library.
Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
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>
This commit resolves all of the build warnings that were preventing
NXDoom from compiling in CI runs.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
The pinned Berry source emits -Wshadow diagnostics in a couple of files. NuttX CI passes -Werror, so sim:berry fails when those third-party warnings are promoted to errors.\n\nAdd -Wno-shadow to Berry-specific compiler flags in both Make and CMake paths, keeping the local source patch limited to the NuttX port changes.
Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
This commit includes a (highly) modified version of Chocolate DOOM which
can run on NuttX. The majority of the modifications were made to pass
the NuttX style check. Some small modifications have been added to
support keyboard input, render graphics to frame buffers and directly
use the POSIX interfaces NuttX supplies, stripping out Windows/Mac stuff
and any references to SDL.
NOTE: Sound is currently not supported in any capacity, nor is the
networking stuff. A lot of Chocolate DOOM code was stripped out since it
was unused. If there is a need/desire to add it back later, the original
Chocolate DOOM source can be used as a reference.
WARNING: The NuttX keyboard codec is incredibly non-standard and so
there are problems translating from X11 keys to NuttX ones to play DOOM.
Right now, the CTRL key for firing doesn't work because the NuttX codec
has no concept of it. The NuttX codec should be modified (and other
input devices supported), but at the time of this port I am not
sufficiently comfortable doing so since I am afraid of breaking other
things in the kernel.
NOTE: This port (and likely the original DOOM) seems to be written with
32-bit computers in mind. As such, most things are given the type of
natural `int`, even when a single byte might do. There are significant
size optimizations that could be made to make this more suited to
embedded devices that NuttX typically runs on.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit adds the original Chocolate DOOM source which forms a basis
for the NuttX port of DOOM.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Berry's downloaded default/berry.c uses CRLF line endings, while the local NuttX patch was LF. Fresh Linux and CMake builds failed when patch saw the line-ending mismatch.
Regenerate the local Berry patch against the pinned upstream CRLF source and apply it directly in both Make and CMake fetch paths. This keeps the integration working until the Berry-side change is merged upstream and the pinned commit can be updated.
Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
Fix two potential NULL pointer dereferences in nsh_fscmds.c:
1. fdinfo_callback: asprintf() failure left filepath potentially
NULL, which was then passed to nsh_catfile(). Add early return
on asprintf failure.
2. cmd_cat: malloc(BUFSIZ) for stdin reading was used without
checking the return value. Add NULL check with -ENOMEM return.
Also fix a typo in error message: 'nsh_catfaile' -> 'nsh_catfile'.
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
Fixes#17063
Add modification time display to ls -l long format output.
The timestamp is shown as 'YYYY-MM-DD HH:MM' between the permission
string and the file size, following the ISO long-iso format.
Files with st_mtime == 0 (e.g., procfs, tmpfs pseudo-entries) skip
the timestamp display to avoid showing a meaningless epoch time.
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
By default rexecd spawns a detached worker thread per accepted connection
to allow concurrent sessions. Add a "-t" runtime option to instead handle
each connection inline in the main task, avoiding the per-connection
worker stack (CONFIG_NETUTILS_REXECD_STACKSIZE) allocation from the heap.
This matters on low-memory targets with limited free heap.
With "-t", connections are served strictly one at a time: a long-running
or interactive command blocks the accept loop until it finishes. Without
it, the existing thread-per-connection behaviour is unchanged.
Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
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>
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>
Add an optional Berry interpreter under apps/interpreters.
Fetch the pinned upstream source and apply the NuttX default-port patch.
Generate Berry constant objects and build the NSH command through Kconfig.
Make and CMake build paths are included for normal app integration.
Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
popen() now returns a fopencookie-backed FILE* whose fileno() yields the
cookie pointer rather than a real descriptor, so poll() silently ignores
the negative fd and the relay loop blocks forever waiting for command
completion. See https://github.com/apache/nuttx-apps/pull/3511
Use dpopen()/dpclose() to obtain the raw bidirectional socket descriptor
directly, restoring the EOF/POLLHUP command-completion signal.
Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
When the relay loop exits early without entering any branch, ret would be
returned uninitialized, tripping -Werror=maybe-uninitialized. Initialize
it to 0.
Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit fixes the previous behavior where an echo with a
single string and its default new line is send as single write().
This issue came from: https://github.com/apache/nuttx-apps/pull/1559
Signed-off-by: Alan C. Assis <acassis@gmail.com>
Integrated SSH daemon authenticating against FSUTILS_PASSWD, with an
ECDSA P-256 host key and an NSH session over a PTY per connection. Built
from the upstream Dropbear tarball (pinned commit) and patched for
NuttX, using Dropbear's bundled libtomcrypt for all crypto. setsid()
(apache/nuttx#19184) and link() now come from NuttX, not local stubs.
Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
Expose scpi-parser unit support through explicit Kconfig options instead of raw CFLAGS.
Map each option to the corresponding upstream USE_UNITS_* compile-time define, preserving the existing default unit set while allowing users to enable groups such as USE_UNITS_TIME.
Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
Add the missing module metadata for the executable ELF helpers used by the package fixture flow so the generated artifacts describe their target and type consistently.
Also fix the existing embedlog spelling issue that is picked up by the current apps check, keeping this branch clean under CI.
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
Add a test that verifies modifying SP (REG_R13) in the saved register
context is honored on signal return. The test pushes values onto the
stack, triggers SIGALRM, and in the handler advances SP to skip a
value, then verifies the correct value is popped after signal return.
This exercises the SP relocation fix in arm_sigdeliver.c for ARMv7-M
and ARMv8-M architectures.
Signed-off-by: Andrew Au <cshung@gmail.com>
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>
Add the initial nxpkg command, metadata and store handling, the local install/list path, and the repository export helper.
Keep the current flow scoped to local artifacts and target-qualified repository entries so it remains usable as an incremental MVP while follow-up features land separately.
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
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>
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>
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>
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>
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>
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>
Prior to this change, if an empty folder existed instead of the
actual libwebsockets source, the build would fail. This commit
checks for an actual file instead, avoid such kind of errors.
Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
libwebsockets can be built without TLS support. To allow this, it
was necessary to create a specific Kconfig option that enables TLS
support if OPENSSL_MBEDTLS_WRAPPER is enabled. Otherwise, TLS is
not supported (but libwebsockets can still be used with plain ws://
connections).
Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
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>