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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The previous method of terminating the dhcp daemon via a global variable has been removed; instead, the `kill pid` command is used. Also, because the original `dhcp_start` method creates tasks via `task_create`, which is not supported in kernel mode, `dhcp_start` is not compiled in kernel mode. The daemon can be started in kernel mode using `dhcpd xxx &`.
Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
- Modify the DHCP-client data structure to support multiple DNS addresses
- Enhance DHCP-option parsing to extract all DNS-server addresses
- Set all received DNS-server addresses
- fix some test case build error
Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
Fix invalid preprocessor directive in elf_main.c by changing
`# Warning "No file system selected"` to `# warning "No file system selected"`.
The incorrect uppercase "Warning" directive would cause compilation
errors, while the proper lowercase "warning" directive generates
the intended compiler warning when no file system is selected.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
The problem probably arises from an incompatibility issue
between the shv-libs4c and pyshv libraries. The fix is to downgrade
the library for now and then revert back.
Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
Fix two error message issues in the framebuffer example:
* Add missing newline character to fbmem2 error message in fb_init_mem2()
* Correct mmap() error message that incorrectly referenced FBIOGET_PLANEINFO
These changes improve error reporting clarity and consistency for debugging framebuffer initialization issues.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit marks the end of my GSoC 2025 project in the NuttX section.
All changes:
- Silicon Heaven protocol (SHV) implementation:
The library is cloned from github.com/silicon-heaven/shv-libs4c
and compiled here. The library has out-of-the-box support
for NuttX and possibly all posix systems.
The library is compiled with CONFIG_SHV_LIBS4C_PLATFORM define
set to "nuttx". The library's dependancy is Pavel Pisa's ULUT
and originates from Michal Lenc's GSoC.
- examples/shv-nxboot-updater:
An example which constructs a SHV tree with which you can perform
firmware updates using a SHV "file node". The file node wraps
around NXBoot's update partition.
The application also allows for NXBoot confirmation of the images.
This application is to be meant used as a "background service",
started before any apps, possibly using rcS. The tree is allocated
as GAVL (see below).
- examples/shv-test:
An example which constructs a SHV tree and gives the user
the ability to choose which type of construction should be used,
either:
- GAVL: dynamic SHV tree allocation encapsulated within
an AVL tree.
- GSA: dynamic SHV tree allocation encapsulated within
a continuous array with binary search
- GSA_STATIC: SHV tree is defined as static const, this means
all the data structures are placed in .rodata.
Extremely beneficial for embedded systems,
as .rodata is located in flash and embedded
systems usually have more flash than sram,
thus reducing sram usage. The downside is that
the definitions are rather tedious, but can
be automated in case of some code generation
(like in pysimCoder).
All of it is places in a continuous array with
binary search.
Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
This commit implements the loopback mode for the i2schar example
application. This mode - available only when both RX and TX are
enabled - allows the user to test the I2S buses when the TX pin is
connected to the RX pin. This is done by pre-filling a buffer with
known data (additionally, it checks the peripheral's data width to
format the data in the buffer accordingly) and passing it for both
the transmitter and the receiver threads. This buffer is written to
the TX and the received buffer is compared to the known buffer.
Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
Add a new example that shows how to read a sample from
an ADS7046 ADC sensor registered on the SPI bus.
Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
Add a new example that shows how to read the temperature from a
TMP112 sensor registered on the I2C bus.
Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
Top level:
- 'tee' subdirectory added to top-level CMakeLists.txt
tee/libteec:
- BINARY_PREFIX defined PUBLIC to make it accessible to consumer
apps
- added missing DEBUGLEVEL definitions
examples/optee_gp:
- added missing dependency to libteec
Signed-off-by: George Poulios <gpoulios@census-labs.com>