MicroMutableOpResolver<8> only registered 8 ops, missing
DEPTHWISE_CONV_2D, required by any depthwise-separable CNN
(MobileNet-style, DS-CNN keyword-spotting models). The kernel
already exists upstream (Register_DEPTHWISE_CONV_2D_INT8() in
tensorflow/lite/micro/kernels/depthwise_conv.h); this wires it
into the resolver and bumps the template size to <9>.
Verified with micro_speech_quantized.tflite on sim:tflm.
Before: Didn't find op for builtin opcode 'DEPTHWISE_CONV_2D'.
After: RESHAPE/DEPTHWISE_CONV_2D/FULLY_CONNECTED/SOFTMAX all execute.
Signed-off-by: Ansh Rai <anshrai331@gmail.com>
This update introduces the following changes in mw:
- Fixed all idetified -Werror warnings in CI.
- Fixed the issue where the backspace key was not working in QEMU
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
This update introduces the following changes in mw:
- Fixed some -Werror warnings in CI.
- Fixed the issue where the backspace key was not working in QEMU
Signed-off-by: Acfboy <AcfboyU@outlook.com>
nuttx-ntfc-testing's release-0.0.1 tag pins ntfc.yaml's citest
requirement to CONFIG_INIT_ENTRYPOINT=nsh_main, so any sim/citest
defconfig that switches to a different init entrypoint (e.g. nxinit's
init_main) fails CI with:
OSError: Missing kconfig dependency: ['CONFIG_INIT_ENTRYPOINT', 'nsh_main']
Maintainer raiden00pl cut nuttx-ntfc-testing release-0.0.2, which drops
that CONFIG_INIT_ENTRYPOINT requirement from ntfc.yaml, and requested
both nuttx and nuttx-apps workflows be updated to it:
https://github.com/apache/nuttx-ntfc-testing/issues/7#issuecomment-5480486089
Only the `git clone -b release-0.0.1` line is changed; the unrelated
`ntfc==0.0.1` PyPI package pin (build.yml) is untouched.
Assisted-by: opencode-agent/claude-sonnet-5
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Add SHA2-224 HMAC verification to the crypto hmac test using
CRYPTO_SHA2_224_HMAC through the /dev/crypto interface. Uses
standard HMAC test vectors producing a 28-byte digest.
Signed-off-by: guao <guao@xiaomi.com>
Add test cases for ChaCha20 stream cipher and ChaCha20-Poly1305
AEAD algorithm using the NuttX cryptodev interface. Tests cover
RFC 7539 test vectors including encryption/decryption with various
key/nonce/counter combinations.
Signed-off-by: guao <guao@xiaomi.com>
Add a test/ subdirectory (mirroring apps/system/uorb/test/) with
cmocka-based unit tests covering the NxInit logic most prone to
regression:
- init_parse_arguments(): plain/quoted arguments, "--" separator vs.
"--option" long options (regression coverage for a previously fixed
bug), argv-capacity truncation (asserting the exact folded contents
of the last slot, not just its presence).
- init_parse_config_file()/init_parse_config_lines()/
init_parse_config_buffer(): section routing, blank/whitespace-only
line skipping, unknown-section rejection, over-length line rejection,
and a line straddling two read-buffer refills, exercised through both
the file-based and buffer-based entry points.
- Action event matching: exact match, invert (!=), fnmatch wildcards,
and AND semantics across multiple events per action.
- Service conflict detection: duplicate service name rejection,
override replacing an earlier duplicate, and the SERVICE_ARGS_MAX
boundary built dynamically from CONFIG_SYSTEM_NXINIT_SERVICE_ARGS_MAX
rather than a hardcoded value.
Test sources compile action.c/parser.c/service.c a second time into a
separate nxinit_unit_test program, gated behind new
CONFIG_SYSTEM_NXINIT_TEST (depends on TESTING_CMOCKA); the default init
program is unaffected. The CMake path builds a dedicated
nxinit_unit_test target (with test/test_nxinit.c placed first in SRCS
so nuttx_add_application() renames its main() correctly); the Make path
appends the test sources into the shared CSRCS list.
Supporting bits required to make the suite exercise the real code:
- init_parse_config_buffer() is declared in parser.h and made
non-static so the buffer-based boundary test can call it directly,
alongside the existing init_parse_config_file() entry point.
- CONFIG_SYSTEM_NXINIT_ACTION_EVENTS_MAX default is raised from 1 to 2
so an action can carry more than one event ("on evA && evB"), which
the multi-event AND-semantics test exercises; a single event slot
made that test dead code.
- CONFIG_SYSTEM_NXINIT_TEST_STACKSIZE defaults to 8192: several parser
test cases build multi-hundred-byte stack buffers on top of cmocka's
own overhead, and the previous DEFAULT_TASK_STACKSIZE (2048)
overflowed the test task's stack silently on real hardware (no crash
dump, no watchdog reset, output just stopped) partway through the
suite.
Testing:
Built via `make CROSSDEV=riscv-none-elf-` for
esp32p4-pico-wifi-wareshare:nsh (CONFIG_SYSTEM_NXINIT_TEST=y) and ran
nxinit_unit_test on real esp32p4-pico-wifi-wareshare hardware over
UART:
nsh> nxinit_unit_test
[==========] nxinit_tests: Running 18 test(s).
...
[==========] nxinit_tests: 18 test(s) run.
[ PASSED ] 18 test(s).
nxstyle clean on all touched files.
Assisted-by: GitHubCopilot:claude-sonnet-5
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
init_parse_config_buffer() computed the per-refill copy length as
MIN(len - off, sizeof(tmp)) without subtracting the 'n' leftover bytes
already held at the front of 'tmp' from a previous refill, so
memcpy(&tmp[n], ..., r) could write past the end of tmp[]. The
file-based twin, init_parse_config_file(), already gets this right
(read(fd, &buf[n], sizeof(buf) - n)).
Reproduced locally with an AddressSanitizer host harness feeding the
real 95-byte builtin "preset" rc content through
init_parse_config_buffer() at CONFIG_SYSTEM_NXINIT_RC_LINE_MAX=32/48:
ASan reports a stack-buffer-overflow on the 'tmp' array. Fixed to
MIN(len - off, sizeof(tmp) - n) and reverified clean at
RC_LINE_MAX=32/48/64/128.
The default config never hits this (the builtin preset is 95 bytes and
the default RC_LINE_MAX is 128), but SYSTEM_NXINIT_RC_LINE_MAX had no
lower bound, so lowering it towards 32/48 for a smaller build would
silently corrupt the stack while parsing the preset during boot. Add a
"range 64 4096" bound so the value can no longer be set below the
builtin preset's needs.
Assisted-by: opencode:mimo-v2.5-pro
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
init_parse_config_file() declares 'r' inside the read loop with no
blank line before the following 'if (r < 0)' statement, violating the
NuttX coding standard (nxstyle: "Missing blank line after
declarations"). checkpatch.sh runs a whole-file nxstyle check on any
file a commit touches, not diff-only, so this pre-existing issue
surfaced on this PR's CI once parser.c was touched again.
Assisted-by: GitHubCopilot:claude-sonnet-5
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
init_parse_config_lines() had a dead early "continue" for a truly
empty line (buf == "\0") that skipped the memmove() bookkeeping its
sibling whitespace-only-line branch performs. When a real empty line
appeared mid-buffer, subsequent bytes were never shifted to the front
of the working buffer, corrupting the remaining-length tracking and
silently dropping every line after it for that refill chunk.
The whitespace-skip loop right below already handles the empty-string
case correctly (the loop body never executes, so it falls straight
into the "only whitespace" -> memmove -> continue path), so the buggy
early exit is simply redundant and removed.
Assisted-by: GitHubCopilot:claude-sonnet-5
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Previously, 'set KEY VALUE' in init.rc was not recognized as a builtin
command. It fell through to posix_spawnp(), which ran it in a
temporary child shell. The environment variable was set only in the
child process and lost when it exited, so services started afterward
never inherited it.
Register cmd_set as an init builtin that calls setenv(key, value, 1)
directly in the init process. The command takes exactly 2 arguments
(key and value). All code is guarded by CONFIG_DISABLE_ENVIRON so it
compiles out when environment support is disabled.
Since child processes inherit init's environment, 'set TZ Asia/Shanghai'
in init.rc now correctly propagates to all subsequently started
services.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
The previous default of 8 is insufficient for services with many
arguments (e.g. ptpd needs 10 argv slots). When exceeded, argv lacks
a NULL terminator, causing posix_spawnp to read out of bounds.
Increase default to 16 to prevent argument truncation for typical
daemon services.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Because this PR modifies nsh_fscmds.c and wamr/Kconfig, CI runs
nxstyle and codespell over the whole files and rejects pre-existing
issues that are unrelated to the rename:
- nsh_fscmds.c: reindent misaligned switch/case blocks in cmd_dmesg,
cmd_losetup, cmd_losmart, cmd_lomtd, cmd_mkdir, cmd_mkfatfs and
cmd_mkrd to the standard NuttX layout.
- wamr/Kconfig: fix two spelling typos flagged by codespell
("expections" -> "exceptions", "Configuable" -> "Configurable").
Style/whitespace and spelling only; no functional change.
Signed-off-by: zhengyu16 <zhengyu16@xiaomi.com>
The link support is no longer limited to the pseudo file system and now
covers both soft (symbolic) links and hard links across the VFS. Update
all references to the renamed configuration option PSEUDOFS_SOFTLINKS,
which has been renamed to FS_LINKS in the NuttX kernel, so that nshlib,
the interpreters, adb, tlpi and the test suites keep building.
This must be merged together with the corresponding NuttX change that
performs the actual kernel-side rename.
Signed-off-by: zhengyu16 <zhengyu16@xiaomi.com>
The uLUt and libshvc declare headers intended for make export
by EXPORTED_INCLUDES mechanism implemented during 2026
Micowindows GSoC. The shv-libs4c has been updated as well
to support newer pyshv versions and that way firmware updates
when shv-nxboot-updater is used through pyshv based shvflasher.py
and related GUI.
For pyshv see https://github.com/silicon-heaven/pyshv
New commits from shv-libs4c project
https://github.com/silicon-heaven/shv-libs4c
- shv_com_common: shv_unpack_discard and shv_unpack_skip
required to skip additional parameters and query requests
introduced introduced by newer silicon-heaven protocol
and pyshv. Incorrect skipping was a bug even against
previous protocol version but did not present itself because
older pyshv did not send additional requests which need
to be ignored.
- shv_file_node: small, but crucial unpack change
Ignore any other messages than PARAM in file node's write unpack
function. Other different states should be handled, too.
- shv_file_node: fix the CRC unpack method too
Any other messages than PARAM are ignored.
- shv_com: add a method to close a connection only
- shv_dotdevice_node.c: close the conn with the other side when resetted
- shv_com.h: use array designators for error strings
- libshvtree: move shv_con_errno_strs to the C file to not waste space
by copies
- shvtree/shv_clayer_posix: provide alternative socketpair notification
support
This allows to use shv-libs4c and related pysimCoder support
on RTEMS system which does not provide functional pipe
directive/system call but BSD networking supported local/UNIX
socket pair is fully supported.
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
codespell flagged this in PR #3751 CI:
system/nxinit/init.c:119: unkown ==> unknown
system/nxinit/init.c:130: unkown ==> unknown
Both entries were introduced by the resetcause-for-triggers commit and
are unrelated to the earlier nxstyle regression already discussed on
the PR.
Assisted-by: GitHubCopilot:claude-sonnet-5
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Add the missing mapping entries in the resetflag[] array to prevent
potential NULL pointer dereference when accessing reset.flag.
The resetflag array uses designated initializers and must have entries
for all BOARDIOC_SOFTRESETCAUSE_* values to avoid array holes.
Reported by: xuchuntian@xiaomi.com
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Add built-in property sys.boot.reason, which allows action triggers to be
executed on specific reset cause.
For example:
```
on property:sys.boot.reason=cpu_soft_reset(bootloader)
echo "bootloader mode ..."
start fastboot
```
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Changes PSEUDOTERM dependency from 'select' to 'depends on' which was
missing from the initial pull request.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
The lvglterm terminal now runs the shell on a pseudo-terminal instead of three
plain pipes.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Move the boot event orchestration into a preset config buffer so the
"init" and (optional) "netinit"/"finalinit" events are triggered as a
serialized chain rather than queued back-to-back in main(). This fixes
the timing between preset event initialization and board initialization.
Adapted for the community tree: BOARDIOC_INIT has been removed upstream
(replaced by CONFIG_BOARD_LATE_INITIALIZE), so no board_init/board_finalinit
builtins are added and no boardctl(BOARDIOC_INIT)/boardctl(BOARDIOC_FINALINIT)
calls are reintroduced; board device init is now performed by the kernel
before init starts.
netinit is not a boardctl call, so it is kept in the serialized event
chain like the original: add a "netinit" builtin that calls
netinit_bringup(), driven by "on init -> trigger netinit -> on netinit",
instead of calling netinit_bringup() directly in main(). finalinit
remains a pure event for user-defined services to hook.
Assisted-by: GitHubCopilot:claude-opus-4.8
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Add support for booting a new application firmware image.
Depends on `BOARDCTL_BOOT_IMAGE`.
When the built-in boot command of nsh is enabled, the built-in boot
command of Init will take precedence (see init_builtin_run()). To use
the built-in boot command of nsh, use: `exec -- sh boot [args...]`.
Referred to nshlib/nsh_syscmds.c: cmd_boot()
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Add the parser[n].check validation loop to init_parse_config_buffer(),
matching the same pattern already used in init_parse_config_file().
This ensures that services and actions parsed from in-memory buffers
are properly validated after parsing.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Rename atomic_fetch_xxx to atomic_xxx (e.g., atomic_fetch_add ->
atomic_add) and atomic_store/atomic_load to atomic_set/atomic_read,
to match the <nuttx/atomic.h> API rename in the companion nuttx PR.
The atomic_fetch_xxx naming is reserved by the C/C++ standard and
conflicts with standard library declarations when <atomic>/
<stdatomic.h> is included by third-party code.
Files changed:
- crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c
- testing/libc/atomic/atomic_main.c
- testing/ostest/roundrobin.c
- testing/ostest/spinlock.c
Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
Add a touchscreen calculator with cooperative shutdown and board initialization through BOARDIOC_FINALINIT.
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
Allow cgol, match4, and snake to build as modules. Let cgol handle SIGTERM from its render loop and release the framebuffer.
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
Add CMocka regression test case to verify local socket SCM_RIGHTS
behavior when the file descriptor table is exhausted.
Signed-off-by: Bogdan <Bogdan4ik0759@gmail.com>
Expose the upstream HIGH_PERFORMANCE mode through
CONFIG_LIB_MQTT5_HIGH_PERFORMANCE and enable it by default. This keeps
normal embedded builds lightweight while allowing developers to restore
Paho heap and call-stack diagnostics when investigating library issues.
Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: OpenAI Codex:gpt-5
Add CONFIG_LIB_MQTT5_THREAD_STACKSIZE for threads created
internally by Paho and use it in Thread.c.
Keep CONFIG_UTILS_MQTT5_STACKSIZE scoped to the two utility
application tasks.
This permits S2OPC to enable MQTT through LIB_MQTT5 without
also building unrelated command-line utilities.
Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: OpenAI Codex:gpt-5
The bundled patch still contains an MQTTPacket.h hunk for a bool
typedef that no longer exists in Paho 1.3.15. Make and CMake both
hide the resulting rejection, allowing a partially patched source
tree to be compiled. Remove the stale hunk and make patch failures
fatal.
The Make context target also allows VersionInfo.h generation to
race source extraction under parallel builds. Make the generated
header depend on the extraction target so the input template is
present first.
The publisher and subscriber samples live below src/samples but
include public headers from src. Add the Paho source include directory
to the Make flags, matching the CMake targets, so CONFIG_UTILS_MQTT5
builds both utilities.
Finally, define distclean independently of whether the downloaded
tree exists when Make parses the file. Remove package-owned archives
and sources while preserving a developer Git checkout, and ignore
those downloaded paths.
Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: OpenAI Codex:gpt-5
Convert event-mode keyboard records into the TTY input and signals NSH expects.
Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
Use the full framebuffer instead of the example's centered three-quarter window.
Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
The init_parse_arguments() function checked for '--' by only
comparing the first two characters, causing options like --system,
--nofork to be misinterpreted as the '--' argument separator. This
truncated the remaining arguments. Add an isblank() check on the
third character to ensure only standalone '--' followed by whitespace
triggers the separator logic.
Assisted-by: GitHubCopilot:claude-4.6-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
On the basis of init.rc, add default parsing of cpu-specific configs.
- /etc/init.d/init.rc
- /etc/init.d/init.cpu${CPUID}.rc
Refactor function `init_parse_configs()` to parse files from the default path
instead of identifying and parsing directories or files, as the functionality
is unnecessary.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
* Introduce EXPORTED_INCLUDES in apps/Make.defs; every entry is
prefixed with INCDIR_PREFIX and added to CFLAGS/CXXFLAGS so it
takes effect in the in-tree build as well
* The export target in apps/Makefile copies the content of the listed
directories into the include directory of the export package, so
out-of-tree applications built from the package can still find the
public headers
Signed-off-by: Acfboy <AcfboyU@outlook.com>
* Add CONFIG_MICROWINDOWS_NANOX_NONETWORK which builds the Nano-X
client library and server in the linked-in (NONETWORK) mode, so
client applications are linked directly with the server and run in
the same task, requiring no network stack or socket at all
* Reorganize the source lists: the drawing sources (nxdraw, nxutil,
nxtransform, nxpaintnc) are shared by both modes, while the server
is built from srvnet.c in the network mode and srvnonet.c in the
NONETWORK mode
* Use MULTITHREAD_SERVER in the network mode so that several client
tasks can run at the same time in the flat build
* Let the examples/nanoxterm start the server task only in the
network mode (NONETWORK applications run the server inside main)
Assisted-by: OpenCode:DeepSeek-V4-Flash
Signed-off-by: Acfboy <AcfboyU@outlook.com>
* Port the nxterm demo from Microwindows
* Starts the Nano-X server as a separate task before connecting
* Runs an NSH shell instance on a pseudo terminal in the spwaned child
instead of exec /bin/sh (no filesystem binaries in flat builds)
Assisted-by: OpenCode:DeepSeek-V4-Flash
Signed-off-by: Acfboy <AcfboyU@outlook.com>
* Port the nxcalc demo from Microwindows
* Connects to the Nano-X server started by examples/nanoxterm
* Requires CONFIG_LIBC_FLOATINGPOINT for the result formatting
Signed-off-by: Acfboy <AcfboyU@outlook.com>
Build the Nano-X client library, server and (optional) built-in window manager
from the bundled Microwindows tree
Signed-off-by: Acfboy <AcfboyU@outlook.com>