Commit graph

3288 commits

Author SHA1 Message Date
Michal Lenc
56dbfe7bb3 Documentation: add pages for supported MTD devices
This moves mtd.rst from special/ directory to its own special/mtd
subdirectory and adds pages for supported devices (NOR/NAND flashes and
EEPROMS) with some basic configuration and initialization description.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-12-31 11:37:49 +08:00
dongjiuzhu1
e1991fd14b Documentaion/ptp: add documentaion about system ptpd
add introduction about ptpd

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 10:22:09 -03:00
dongjiuzhu1
890a7a6382 Documentation: Add PTP clock driver framework documentation
This patch adds comprehensive documentation for the PTP (Precision Time
Protocol) clock driver framework in NuttX.

The documentation covers:

1. Overview and Architecture:
   - IEEE 1588 PTP clock framework introduction
   - Upper-half and lower-half driver architecture
   - Integration with POSIX clock APIs

2. Configuration Options:
   - CONFIG_PTP_CLOCK: Main framework configuration
   - CONFIG_PTP_CLOCK_DUMMY: Dummy driver for testing
   - CONFIG_CLOCK_ADJTIME: clock_adjtime() system call support

3. Device Interface:
   - Character device interface (/dev/ptpN)
   - IOCTL commands: PTP_CLOCK_GETTIME, PTP_CLOCK_SETTIME,
     PTP_CLOCK_GETRES, PTP_CLOCK_ADJTIME, PTP_CLOCK_GETCAPS,
     PTP_SYS_OFFSET, PTP_SYS_OFFSET_PRECISE

4. POSIX Clock API (CLOCKFD):
   - Using CLOCKFD() macro to access PTP clocks
   - clock_gettime(), clock_settime(), clock_getres() examples
   - clock_adjtime() with various adjustment modes
   - ADJ_OFFSET, ADJ_FREQUENCY, ADJ_SETOFFSET support

5. Dummy PTP Clock Driver:
   - Software-based implementation for testing
   - Features and initialization details

6. Example Usage:
   - Basic time operations
   - Frequency adjustment examples
   - Time offset adjustment examples

7. Implementing Lower-Half Drivers:
   - Step-by-step guide for hardware driver implementation
   - Required operations and structures
   - Registration process

8. Integration with PTP Daemons:
   - ptp4l, timemaster, ptpd compatibility
   - Standard POSIX clock API usage

9. Performance Considerations:
   - Hardware timestamping requirements
   - Cross-timestamping support
   - Frequency adjustment resolution

10. Debugging:
    - Debug configuration options
    - Debug output examples

The documentation is added to:
- Documentation/components/drivers/special/ptp.rst (new file)
- Documentation/components/drivers/special/index.rst (updated)

This provides developers with complete reference material for using
and implementing PTP clock drivers in NuttX.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 10:22:09 -03:00
wangchen
302731ad1a docs: add ICMP ping guide (usage, options, examples)
Add index.rst: ping usage, flags (-c -i -W -s -I), output, examples, errors.

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-29 22:41:40 +08:00
zhanghongyu
2ad01e2aab net/tcp: support recv packet in the TCP_FIN_WAIT_1/2 state
shutdown should send TCP_FIN packet.

close should send TCP_RST packet when the data in readahead has not been
                                 read and NEW_DATA has arrived.
             send TCP_FIN packet when in other cases.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-29 19:22:23 +08:00
Matteo Golin
0885b324a1 docs/cmocka: Fill out documentation for cmocka
Write documentation for cmocka.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-12-29 19:16:21 +08:00
zhangshuai39
4eb222f0a7 netlib: Supplementing the netlib_check_ipconnectivity documentation
A brief introduction to the interface functions, parameters, and return values.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-29 19:14:59 +08:00
rovinyu
906279e37a Modify `do while` Statement typo
The following should be correct sample:
do
  {
    ready = !notready();
  }
while (!ready);

senddata();

do
  {
    ptr++;
  }
while (*ptr != '\0');
2025-12-29 09:40:54 +08:00
zhanghongyu
746d68916f net/tcp: add support for the CLOSE_WAIT state
CLOSE-WAIT - represents waiting for a connection termination request
             from the local user.
      TCP A                                                TCP B

  1.  ESTABLISHED                                          ESTABLISHED
  2.  (Close)
      FIN-WAIT-1  --> <SEQ=100><ACK=300><CTL=FIN,ACK>  --> CLOSE-WAIT
  3.  FIN-WAIT-2  <-- <SEQ=300><ACK=101><CTL=ACK>      <-- CLOSE-WAIT
  4.                                                       (Close)
      TIME-WAIT   <-- <SEQ=300><ACK=101><CTL=FIN,ACK>  <-- LAST-ACK
  5.  TIME-WAIT   --> <SEQ=101><ACK=301><CTL=ACK>      --> CLOSED
  6.  (2 MSL)
      CLOSED

in the current state, we can continue to send data until the user
calls shutdown or close, then directly enter the TCP_LAST_ACK state

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-27 21:06:23 +08:00
Matteo Golin
18a5ec8410 docs/testing/nuts: Include preliminary documentation for NUTS
Documentation for the NuttX Unit Test Selection (NUTS) app. Includes
information about the configuration options, build dependencies,
currently included test cases and how to extend the test collection with
new unit tests.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-12-27 20:43:32 +08:00
gaohedong
44bc5ed635 net/vlan: add some macro for vlan
Refer:
https://github.com/torvalds/linux/blob/v6.8/include/linux/if_vlan.h#L73-L76

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-27 11:36:39 +08:00
zhangshuai39
776a6a5d0b netlib: Add IOB statistics interface description
Includes an introduction to the interface, and details about the input parameters and return values.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-25 08:37:26 -03:00
zhangshuai39
1ec63f72ac paho_mqtt: Add paho_mqtt repository description file
The description includes an introduction to paho_mqtt, configuration management, tool usage, etc.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-25 13:14:50 +08:00
zhanghongyu
6ad864ff0c mm/iob: add iob_init method to support external buffer init as iob structure
This interface allows different protocol modules to use their own unique IOB
buffer sources and allocation strategies without interfering with each other.
Representative examples are the IP protocol and the CAN protocol. The IP
protocol generally transmits packets of varying lengths and requires
relatively high peak throughput. In this case, to ensure higher performance,
IOB_BUFSIZE is often configured to be relatively large, such as greater than
500. The CAN protocol generally transmits short packets of fixed length.
In this case, to improve memory utilization, IOB_BUFSIZE is often configured
to be relatively small, such as 16 or 64. To optimize the memory utilization
when the IP protocol and the CAN protocol share the same core,
this interface was added.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-25 10:08:49 +08:00
zhanghongyu
1fd47357f7 net/packet: add PACKET_<ADD|DROP>_MEMBERSHIP support
Some third-party network libraries use PACKET_ADD_MEMBERSHIP to add MAC
addresses to devices, and this patch can add support for this.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-25 10:01:43 +08:00
chenzihan1
43b16fdb7c libc/search: add foreach api for hcreate_data
add foreach api for hash table

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-12-25 09:39:03 +08:00
zhangshuai39
994a786336 netlib: Introduction to IP conflict detection functions
The documentation includes descriptions of the IP conflict function's prototype, parameters, and return value.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-24 16:53:13 +08:00
zhangshuai39
9a75fc2162 netpkt: Introduction to using netpkt example
The introduction includes an overview, the configuration items that need to be enabled, and how to use them.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-24 16:50:27 +08:00
rongyichang
3d0f6fcbad boards/risc-v: Add lvgl64_vector configuration for RISC-V QEMU
Add new RISC-V 64-bit QEMU configuration with:
- 64-bit RISC-V (RV64) architecture support
- RISC-V Vector Extension (RVV/V-extension) enabled
- LVGL graphics framework integration
- VirtIO GPU and input device support
- NSH shell with built-in applications

This configuration enables developers to build and test LVGL graphical
applications on 64-bit RISC-V targets with Vector extension support,
providing a foundation for future SIMD optimization work.

Includes:
- defconfig: Complete configuration file with all necessary options
- Updated index.rst: Build and run instructions with QEMU launch command

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-12-24 09:44:01 +08:00
Luchian Mihai
172dd3959a docs/guides/lwl: move lwl's README.txt to lwl.rst
This PR moves the lwl's READEME.txt file to Documentation/guides/lwl.rst

Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
2025-12-23 15:20:06 +01:00
zhengyu9
491ce83508 drivers/mtd: add MTDIOC_ISBAD ioctl
add an ioctl item MTDIOC_ISBAD
used for flashtool command to check bad blocks

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2025-12-23 09:26:34 -03:00
zhanghongyu
37381a9e7d net/pkt: add SOCK_DGRAM support
According to the definitions of PF_PACKET and SOCK_DGRAM,
extend the current protocol stack pkt protocol to support SOCK_DGRAM mode.

Some third-party network libraries use AF_PACKET, SOCK_DGRAM type sockets
to construct packets and send/receive data, This patch can add support
for this.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-23 09:21:18 -03:00
zhengyu16
2b30ab2d0c Documentation: add flashtool utility
Add documentation for flashtool utility.

Signed-off-by: zhengyu16 <zhengyu16@xiaomi.com>
2025-12-23 08:48:26 -03:00
Alin Jerpelea
b5cb1f65a5 Documentation: add NuttX-12.12.0 release notes
Add release notes for 12.12.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-12-23 18:35:17 +08:00
ouyangxiangzhen
b5eae7d774 Documentation: Add documentation for seqcount.
This commit added ducumentation for seqcount.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 10:22:06 -03:00
ouyangxiangzhen
e5db83d7db sched/sched: Remove nxsched_alarm_expiration
This commit removed nxsched_alarm_expiration to simplify the timer
expiration.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 21:17:13 +08:00
yezhonghui
db7f292709 power/battery: fake gauge support for rpmsg communication
realize a fake gauge to support powermanger

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-22 09:15:56 -03:00
anjiahao
0a2b01950c sched:use tcb_s inside of task_tcb_s , remove all cast
Simplify the code and remove different tcb

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 17:55:45 +08:00
Alan Carvalho de Assis
29ee50aba8 doc/xtensa/esp32: Update documentation to include sx127x
This commit includes documentation to the sx127x board profile.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-22 10:22:36 +08:00
Alan Carvalho de Assis
a6af0e94f9 Doc/xtensa/esp32: Fix QEMU documentation to use new config
QEMU needs CONFIG_ESP32_IGNORE_CHIP_REVISION_CHECK enabled to work

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-21 15:18:08 -03:00
Alan Carvalho de Assis
cb4b64b6e8 Doc/xtensa/esp32: Add documentation to Heltec WiFi LoRa32
This commit adds documentation to Heltec WiFi LoRa32

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-21 15:18:08 -03:00
Huang Qi
beb0a47568 boards/esp32s3/lckfb-szpi: Add QMI8658 6-axis IMU sensor support
Add support for the QMI8658 6-axis IMU sensor (accelerometer + gyroscope)
on the lckfb-szpi-esp32s3 board.

Changes:
- New esp32s3_qmi8658.c driver initializes sensor on I2C0 at address 0x6A
- Registers uORB devices: /dev/uorb/sensor_accel0 and /dev/uorb/sensor_gyro0
- Adds esp32s3_qmi8658_initialize() function declaration to header
- Integrates with board bringup when CONFIG_SENSORS_QMI8658=y

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-12-21 00:58:58 +08:00
chenzihan1
c21405d2d5 drivers/sensors/goldfish: goldfish support more sensors
add sensors type to align android

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-12-20 09:31:23 -03:00
Justin Erenkrantz
18a1d159a7 risc-v/litex: For vexriscv_smp, match default FDT address in upstream opensbi.
The default opensbi fw_jump.bin expects to see the FDT in 0x40EF0000 per FW_JUMP_FDT_ADDR.

Definitions:

https://github.com/litex-hub/opensbi/blob/0.8-linux-on-litex-vexriscv/platform/litex/vexriscv/config.mk
https://github.com/litex-hub/opensbi/blob/1.3.1-linux-on-litex-vexriscv/platform/litex/vexriscv/objects.mk

Signed-off-by: Justin Erenkrantz <justin@erenkrantz.com>
2025-12-20 11:09:38 +08:00
simbit18
946bd2b36e boards/risc-v/esp32c3: add Waveshare ESP32-C3-Zero
- Add initial support for Waveshare ESP32-C3-Zero.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-19 07:14:22 +08:00
raiden00pl
1b358af82f Documentation: add notes about TAP configuration for qemu
add notes how to configure QEMU network with TAP.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-18 11:39:54 -03:00
chenzihan1
a9df67e56b drivers/gpio: gpio driver added debounce and interrupt mask functions
Add handling for GPIOC_SETDEBOUNCE to set GPIO pin debounce duration.
Add handling for GPIOC_SETMASK to enable/disable GPIO interrupt mask.

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-12-18 14:52:37 +01:00
zhangshuai39
b09d402d06 nettest: Add a guide document for the nettest directory.
Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-18 21:46:43 +08:00
wangchengdong
edf89ddedd sched/hrtimer: add safe synchronous hrtimer cancel API
Add a safe synchronous hrtimer cancel API, hrtimer_cancel_sync().
If the timer callback is currently executing, this function waits
until the callback has completed and the timer state transitions
to HRTIMER_STATE_INACTIVE.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-18 18:36:28 +08:00
wangchengdong
d7ce29774c sched/hrtimer: Add motivation to hrtimer module description
Enhance the hrtimer module description by explaining its purpose
and use cases, making it more readable and understandable for humans.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-18 18:36:28 +08:00
wangchengdong
506c75069d Documentation: add documentation for the hrtimer module
This commit adds documentation for the hrtimer module, including its
design overview and intended use cases.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-18 18:36:28 +08:00
Antoine Juckler
d5633f75a8 mtd/at25ee: Use eeprom/spi_xx25xx internally
In order to reduce code duplication, use the eeprom/spi_xx25xx
driver within mtd/at25ee.

The eeprom/xxx.h includes have been merged into eeprom/eeprom.h, to
provide a common include file like mtd/mtd.h.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-12-17 19:03:54 +01:00
Tomasz 'CeDeROM' CEDRO
7069e77370 tools/nxtagspkgsfetch.sh: Fetch tags packages for NuttX and Apps.
This script downloads all NuttX RTOS and Application snapshot packages
from the upstream git repository based on the provided git tags list.
These are NOT official release packages as checkum will differ.

When launched from the local NuttX git repository clone the script will
obtain all available tags to be downloaded, otherwise list of tags needs
to be provided manually (or when just selected tag is required).
This script uses ``wget`` underneath, make sure this tool is installed.
Fetch log file is created with a timestamp in name next to the packages.

Having all tags packaged is important for changes comparison
between specific versions, testing a specific version, compatibility
checks, searching for a feature introduction timeline, etc.

Usage: `./nxtagspkgsfetch.sh [download_path] [tags_list_space_separated]`

You can provide optional download path (default `../../nuttx-packages`)
and tags list to get packages for (default all tags from local git clone).
When providing tags you also need to provide download path.

Documentation update contains new tool description (above).

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-12-17 08:12:44 -03:00
Alan Carvalho de Assis
c84e2ebfa9 doc: Add documentation to pthread_mutex_perf application
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-16 20:57:44 -03:00
wangjinjing1
8c92be874f net/can: add write buffer to support nonblock send
The sending of can socket can support more scenarios

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-15 10:19:15 +08:00
yangsong8
a87ad98343 usbhost: cdcacm exit wq after copy all received data
Fix issue: When the SIM CDCACM host receives data, the second packet
data reception is incorrect.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-14 10:37:53 -03:00
zhanghongyu
aa8ffea3cf netdev_upperhalf: convert Kconfig to variable
Upperhalf supports multiple working modes at the same time,
which is specified by NIC when register

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-14 10:01:22 +08:00
Justin Erenkrantz
d98e7a7b68 risc-v/litex: For vexriscv, point docs at linux CPU variant instead of secure.
The secure CPU variant of vexriscv immediately panics after bring up.

However, the linux CPU variant of the vexriscv core does work successfully.

Signed-off-by: Justin Erenkrantz <justin@erenkrantz.com>
2025-12-13 18:14:21 -03:00
Jiri Vlasak
f93a1b34e5 eeprom/spi_xx25xx: Add IOCTL to set Block Protect
Add IOCTL to set Block Protect, because we need a way to set Block
Protect of an EEPROM.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2025-12-13 13:33:48 +08:00
chenxiaoyi
43405d34c4 Documentation: update the gprof usage
Update the usage part to demostrate two easily accessible environments,
one QEMU and one real board.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-12-13 13:31:46 +08:00