Commit graph

2415 commits

Author SHA1 Message Date
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
wangjianyu3
f95b53d15b examples/camera: add -m option for horizontal mirror preview
Add -m command line option to enable horizontal mirror on the
camera sensor via VIDIOC_S_CTRL + V4L2_CID_HFLIP.  This uses
the sensor hardware mirror (e.g. GC0308 register 0x14 bit[0])
with zero CPU overhead.

Also refactor parse_arguments to use a loop-based parser so
options can appear in any order.

Usage: camera 0 -m    (mirror preview)
       camera -jpg -m (mirror still capture)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-09 10:34:06 -03:00
wangjianyu3
21dd3082c1 examples/camera: handle RGB565X (BE) format from 8-bit DVP camera
Some image sensors on 8-bit DVP buses (e.g. GC0308) produce RGB565X
(big-endian) pixel data — the high byte is clocked out first and
stored first in PSRAM by the ESP32-S3 CAM controller.

The V4L2 framework does not negotiate formats automatically, so try
RGB565 first and fall back to RGB565X if S_FMT fails.

When the sensor reports RGB565X:
 - Invalidate D-Cache after DQBUF so the CPU reads fresh DMA data
 - Byte-swap each pixel in place from BE to LE RGB565 for display

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-09 10:34:06 -03:00
wangjianyu3
52b36deb13 examples/camera: use MMAP with USERPTR fallback and fix NX stride
Use MMAP buffer allocation by default so the driver can manage
DMA-capable memory with proper alignment and cache attributes.
Fall back to USERPTR if the driver does not support MMAP.

Also fix NX framebuffer stride calculation to use the actual
display width instead of hardcoded values.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-09 10:34:06 -03:00
raiden00pl
5c867b21e6 examples/nxscope: control stream interval from CLI
add the ability to control the stream interval from the CLI
which is useful for performance testing

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-02 10:02:16 -03:00
wangjianyu3
073df9d1de examples/uvc_cam: add UVC camera streaming app
Usage: uvc_cam [nframes] [video_dev] [uvc_dev]

V4L2 capture -> write UVC gadget device.
Uses boardctl to initialize/deinitialize UVC gadget.
Queries sensor pixel format, resolution and frame rate via V4L2.
Uses poll() to wait for USB host streaming state.
Supports optional device path arguments (default /dev/video0, /dev/uvc0).
Supports configurable frame count (0=infinite).

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-30 14:52:06 +08:00
raiden00pl
7884410be2 examples/nxscope: add UDP interface
add UDP interface for examples/nxscope

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-03-18 12:43:50 -03:00
wangjianyu3
8cd9e9acc2 examples/camera: fix spelling errors
Fix typos found by codespell:
- camera_bkgd.c: defaul -> default
- camera_main.c: memorys -> memories (2 occurrences)
- camera_main.c: freame -> frame
- camera_main.c: valiable -> variable

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-16 17:45:24 +01:00
wangjianyu3
10056077f4 examples/camera: fix build error and still capture logic
Add missing #include <sys/boardctl.h> in camera_bkgd.c to fix
implicit declaration of boardctl() and undeclared BOARDIOC_NX_START.

Also fix capture_num check in camera_main.c to only apply still
capture size enumeration when capture_type is STILL_CAPTURE.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-16 17:45:24 +01:00
Filipe Cavalcanti
3a156581ca examples/rmtchar: fix source file ordering for RMTCHAR
rmtchar_main.c is coming after rmtchar_common.c, which causes an
undefined reference error. This change fixes the problem.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-03-15 15:42:00 -04:00
Mihai Pacuraru
7d13ee204b examples/mqttc: Fix mqtt_init() failed message typo (ERRPR -> ERROR).
Modify the message logged when mqtt_init() failed to execute properly.

Signed-off-by: Mihai Pacuraru <mpacuraru@protonmail.com>
2026-03-02 17:14:44 +01:00
Mihai Pacuraru
c46ed184ed examples/mqttc: Fix QOS arguments parsing (char->long).
Modify the switch cases in parsearg function for QOS levels definition.
The comparison was made between a long value and a char.

Signed-off-by: Mihai Pacuraru <mpacuraru@protonmail.com>
2026-03-02 17:14:44 +01:00
Matteo Golin
e0d118e349 examples/powerled: Fix board initialization compilation
When NSH_ARCHINIT is not enabled, initialization is to be performed by
boardctl(BOARDIOC_INIT). However, the boardctl header is not included so
this causes compilation to fail. This commit corrects that issue.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-26 12:10:01 +08:00
hujun5
8aa48c4fb6 examples: foc: Add critical section protection to FOC control loop
Introduce CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC configuration option to enable
critical section protection in the FOC (Field-Oriented Control) motor control
examples. This adds irq-safe critical sections around the main control loop
processing to prevent race conditions and ensure atomic updates of motor
control state and parameters during interrupt handling.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-27 20:48:04 +08:00
hongfengchen
d0e949cb24 testing: add unistd.h and pthread.h headers
Add unistd.h and pthread.h for memorystress_main.c, unistd.h for
dhm.c and cachetest_main.c, and pthread.h for kv_test_019.c to fix
missing declarations.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
mazhuang
5c822ea4d3 rpmsgsocket:add rpmsg socket test cases
Signed-off-by: mazhuang <mazhuang@xiaomi.com>
2026-01-24 17:07:42 +08:00
wangzhi16
f16a45a854 examples/pipe: bugfix testcase of fifo
There are three bug in fifo testcase.

1. line 211 and line 295 should be nbytes not ret.
2. coverity report error:
CID 1667262: (#4 of 11): Double close (USE_AFTER_FREE)
11. double_close: Calling close(int) will close the handle fd that has already been closed. [Note: The source code implementation of this function has been overwritten by the built-in model.]

Double close will ocurr when line 234 is true and goto line 341, close again!
Now, Using the previous code logic, Use a tid and an errout_with_null_thread to avoid uninitialized problems.

3. since line 295 is used ret not nbytes, error not expose before.

When the end of read and write are opened, end of write will write successfully even if end of read not read.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
yukangzhi
122a4a6f4e apps/examples/popen: Modify kconfig file
This test depends on !DISABLE_POSIX_TIMERS.

arm-none-eabi/bin/ld:
apps/examples/popen/libapps_popen.a(popen_main.c.obj):
in function `popen_main':
apps/examples/popen/popen_main.c:62:(.text.popen_main+0x1c):
undefined reference to `timer_create'

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-22 19:52:02 +08:00
Côme VINCENT
85b1a1c8c1 fix(macro): fix CAPIO_FREQUENCY macro typo
Going from CAPIOC_FREQUENCE to CAPIO_FREQUENCY according to nuttx/pull/16925

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2026-01-21 16:59:08 +01:00
wangchengdong
d9afe2db8c signals: fix build and runtime issues when signals all isabled
Fix build and runtime issues when signals all disabled.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-19 22:55:19 +08:00
guanyi3
a75fa37090 usrsocktest: fix TEST_ASSERT_EQUAL fail for POLLIN
This assertion should be removed because the POLLIN event is now only
raised when there is data pending to be received. Previously, POLLIN
was incorrectly set as soon as the connection was established, even
when no data was available, which was not consistent with the expected
behavior.

Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
2026-01-19 22:46:45 +08:00
anjiahao
63e2650487 elf:avoid interference between different ELFs generated by symtab
if defined CONFIG_EXAMPLES_ELF and CONFIG_EXAMPLES_MODLUE,
elf will generated BINDIR, so generated symtab will interference.
It supports inputting multiple specified files in mksymtab.sh to
avoid interference.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-16 21:07:56 +08:00
v-tangmeng
6630c08783 examples/elf: add support for CONFIG_DISABLE_SIGNALS
make the example elf can work with SIGNAL disabled

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2026-01-16 21:07:56 +08:00
anjiahao
27e0811312 elf:Delete unnecessary generation, elf does not use kernel api
delete the mod_symtab.c generate procedure

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-16 21:07:56 +08:00
anjiahao
91f55245eb apps:modify examples elf compile method
rearrange the elf test directory, make the sub-testcase in separate
directory

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-16 21:07:56 +08:00
wangchengdong
60d814efa2 sched/signal: Add support to disable partial or all signals
Fix dependency issue when signals are partially or fully enabled

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-15 15:48:54 +08:00
Huang Qi
4e8a0ae4c4 style: Fix coding style violations in nuttx-apps
Fix various coding style issues including:
- Case statement formatting
- Include placement and ordering
- Whitespace issues
- Long line formatting
- Bracket alignment

Affected modules:
- audioutils, examples, include
- netutils, system

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-12 00:54:48 +08:00
Felipe MdeO
ca11a7e093 system/smf: Port SMF .c/.h files to NuttX
This commit add state machine framework lib to the NuttX project. Also an example is added to help users understand and use this feature.

Changes: Added some files. No impact in other features are expected.

Adjust SMF macro names

Fix issues requested during MR review

update kconfig

fix ci-cd issue

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-01-05 12:50:04 -05:00
Zhe Weng
4f93ec0a43 pkt: Set sll_protocol for raw socket to ETH_P_ALL
Ref: https://man7.org/linux/man-pages/man7/packet.7.html

We should either set protocal when creating socket or binding, otherwise
we cannot capture any packet.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-04 21:41:21 +08:00