The 32-bit system clock has a limited range (~497 days) and the
configuration knob is no longer worth the complexity given that
practically every modern target already enables it. Make 64-bit
time_t/clock_t/sclock_t/nuttx_time_t the only supported flavor.
Specifically:
- Drop the SYSTEM_TIME64 Kconfig option and its dependent
PERF_OVERFLOW_CORRECTION/HRTIMER guards in sched/Kconfig.
- Remove every #ifdef CONFIG_SYSTEM_TIME64 branch in headers
(include/{sys/types.h,limits.h,inttypes.h,nuttx/clock.h,
nuttx/fs/hostfs.h}) and core code paths
(sched/clock/clock.h, drivers/power/pm/pm_procfs.c,
drivers/rpmsg/rpmsg_ping.c, fs/procfs/fs_procfsuptime.c,
libs/libc/wqueue/work_usrthread.c,
arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c).
- Strip CONFIG_SYSTEM_TIME64=y from every board defconfig.
- Update Documentation/guides/rust.rst accordingly.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
BREAKING CHANGE: remove PWM_MULTICHAN option
PWM_MULTICHAN option is redundant, we can just set CONFIG_PWM_NCHANNELS > 1.
At default CONFIG_PWM_NCHANNELS is set to 1, so the default behavior is preserved.
Access to single channel API is now `info->channels[0].XXX` instead of `info->XXX`
This is the first step to simplify PWM implementation and make it more portable.
Signed-off-by: raiden00pl <raiden00@railab.me>
Normalizes configurations after removal of some app-related init config
options due to simplification of NuttX init.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Since `NSH_ARCHINIT` is now removed, this commit cleans the last few
references to this option in the defconfig files that were recently
modified and escaped removal in initialization simplification commit.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
BREAKING: In an effort to simplify NuttX initialization, NSH_ARCHINIT is
removed. board_app_initialize is also removed. BOARD_LATE_INITIALIZE now
performs all board initialization logic, and is by default enabled. All
references to these symbols are removed. BOARDIOC_INIT remains, but will
result in -ENOTTY when called. It is to be removed in a later commit.
Quick fix: Boards relying on NSH_ARCHINIT should now enable
CONFIG_BOARD_LATE_INITIALIZE instead. If the application needs
fine-grained control over board initialization from userspace, the logic
performed by BOARDIOC_INIT may be copied to the board_finalinitialize
function and used instead via BOARDIOC_FINALINIT. All
board_app_initialize logic provided by NuttX is now moved to
board_late_initialize, and the same should be done for out-of-tree
boards.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
* Initial experimental / work in progress implementation.
* New board name is esp32s3-ws-lcd128.
* Supports Kconfig delectable w/wo touch variants (lcd gpios difference).
* IMU QMI8658 bringups is put into esp32s3/common/src to share with other
boards. Pin defines are located at <board>include/board.h and referenced
with `#include <arch/board/board.h>`.
* Supported configurations: nsh, ostest, coremark, touch-lvgl, notouch-lvgl,
imu-qmi8658, watchdog.
* Does not have touch panel driver yet.
* Created board documentation. Added sphinx inline cross-references.
* TODO: Fix SPI GC9A01A LCD pixel format colors.
* TODO: Create I2C CST816S touch panel driver.
Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
Remove CONFIG_LCD_PORTRAIT so the ST7789 defaults to landscape
orientation (320x240), matching the GC0308 QVGA output and the
physical screen mounting direction.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
debug.h is a NuttX-specific, non-POSIX header. Placing it in the
top-level include/ directory creates naming conflicts with external
projects that define their own debug.h.
This commit moves the canonical header to include/nuttx/debug.h,
following the NuttX convention for non-POSIX/non-standard headers,
and updates all in-tree references.
A backward-compatibility shim is left at include/debug.h that
emits a deprecation #warning and re-includes <nuttx/debug.h>,
allowing out-of-tree code to continue building while migrating.
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
The common ESP board RMT bring-up files are built whenever ESP_RMT is
enabled, but the esp_lirc declarations are only visible when DRIVERS_RC
is enabled.
Guard the esp_lirc header include and esp_lirc_rx_initialize() /
esp_lirc_tx_initialize() calls with CONFIG_DRIVERS_RC so non-RC ESP
configs continue to build while keeping the LIRC registration path for
the rmt configs.
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Add documentation for the RC/LIRC character driver subsystem covering
device registration, the LIRC interface, and usage from user space.
Remove placeholder empty files under drivers/rmt that were left over
from the rmtchar era and are no longer referenced.
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Replace the ESP-specific rmtchar upper-half with arch-local esp_lirc
adapters for Xtensa and RISC-V.
This moves the RMT upper-half out of drivers/rmt, registers LIRC
devices from the ESP board bring-up paths, and removes the old common
rmtchar driver and headers.
Also update the ESP Kconfig and build wiring to build esp_lirc when
ESP_RMT and DRIVERS_RC are enabled.
Fixes discovered during hardware validation:
- register TX as /dev/lirc1 so RX and TX do not collide
- parse the RX worker thread argument from the correct argv slot
- keep RX devices from advertising TX capability
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Add board-level support for ES7210 4-ch ADC on lckfb-szpi-esp32s3:
- configs/es7210/defconfig: Board configuration with I2C0, I2S0,
ES7210 driver enabled. I2S pins: BCLK=14, DIN=12, MCLK=38, WS=13,
sample rate 48kHz.
- src/esp32s3_board_es7210.c: Board init registering ES7210 on I2C0
bus with I2S0 as audio transport
- src/esp32s3_bringup.c: Call ES7210 board init on startup; skip
generic I2S audio device registration on I2S0 when ES7210 is
enabled to avoid conflicting audio device on the same port
- src/esp32s3-szpi.h: ES7210 I2C address and device path defines
- src/Make.defs: Build integration for CONFIG_AUDIO_ES7210
Tested: 48kHz/2ch/16bit recording on ESP32-S3 (lckfb-szpi N16R8),
verified with nxrecorder and es7210_test.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Initialize 'ret' to OK to silence -Werror=maybe-uninitialized.
When neither enable_tx nor enable_rx is set, 'ret' was returned
without being assigned.
Signed-off-by: dramalife <yangyongkang@espressif.com>
Enable CONFIG_ARCH_IRQ_TO_NDX, CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC
and CONFIG_ARCH_NUSER_INTERRUPTS=2 which are now required by the Xtensa
ESP32-S3 interrupt handling after upstream changes.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Add UVC configuration for lckfb-szpi-esp32s3 board based on gc0308
camera config, with USB OTG and UVC gadget driver enabled in
standalone (non-composite) mode.
- defconfig: enable ESP32S3_OTG, USBUVC, UVC example app
- board doc: add uvc section with usage and host verification
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit updates the common-source integration for Xtensa-based
Espressif devices (ESP32, ESP32-S2, and ESP32-S3). This is part of a larger
common-source update split by architecture for better maintainability.
Major components updated:
- IRQ allocator refactoring with intr_alloc integration
- Common-source drivers (GPIO, RMT, I2C, SPI, UART, etc.)
- Espressif components upgrade to release/master.b-test
- Peripheral drivers (ADC, PWM, LEDC, MCPWM, PCNT, Temperature Sensor, etc.)
- Wireless adapters (Wi-Fi and BLE)
- esp_timer migration to the common-source path for Xtensa devices
- Common-source power management implementation (auto-sleep and wakeup paths)
- Board defconfigs for all Xtensa Espressif boards
- SMP support improvements for ESP32-S3
- Critical section handling improvements
Key architectural changes:
- IRQ Allocator: The new interrupt allocator enables multiple mapping
options from interrupt sources to CPU interrupts, providing flexibility
required by modern peripherals. Although this introduces breaking changes
to the interrupt handling API, the required ARCH_MINIMAL_VECTORTABLE
Kconfig option is explicitly checked during startup to ensure proper
configuration. This validation prevents runtime issues from configuration
mismatches.
- Xtensa-specific interrupt handling via esp_xtensa_intr.c providing
NuttX-native implementations of xt_ints_on/off and interrupt handlers,
avoiding conflicts with NuttX's core Xtensa macros.
- Timer/RTC unification: ESP32/ESP32-S2/ESP32-S3 move from chip-specific
RTC/RT-timer code to common-source Espressif integration, including
esp_timer_adapter/esp_rtc paths and the required bringup/defconfig updates.
- Power management consolidation: Xtensa PM follows the common-source
implementation, including common-source auto-sleep behavior, UART/Wi-Fi
wakeup coordination, and tickless-safe sleep flow compatibility.
Note: This is a large commit to maintain bisectability. Breaking the
changes into smaller commits would result in non-building intermediate
states across the common-source infrastructure update.
Tested configurations:
- All defconfigs were tested, including `ostest`.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
Correct duplicate "is is" word found in 181 files throughout the
codebase.
In most cases "is is" was changed to "is", but in contexts like
"MCU is is sleep mode" it was corrected to "MCU in sleep mode".
Also fixes a "the the" typo in net/inet/inet_sockif.c.
This is a pure style/documentation fix that improves code readability.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Fix 269 occurrences of duplicate "the" word typo found in 209 files
across source code, header files, and configuration.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
The WiFi driver refactor (662c1e0bbb) renamed the Kconfig symbol
from CONFIG_ESPRESSIF_WLAN to CONFIG_ESPRESSIF_WIFI, but several
ESP32-S3 board bringup files were not updated. This caused
board_wlan_init() to be compiled out, so the wlan0 interface
never appeared.
Update the preprocessor guards in all affected boards:
- esp32s3-box
- esp32s3-eye
- esp32s3-korvo-2
- esp32s3-lcd-ev
- lckfb-szpi-esp32s3
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Removes optional keyword causing selection to fail on the
automatic bringup of SPI flash device.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
The ESP32*_SPIFLASH_AUTO_BRINGUP option allows disabling automatic bringup.
This causes /dev/mtdblock0 to show up instead of always mounting a file system.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Add a minimal GC0308 camera configuration based on nsh. Unlike the
full camera config, this only enables the GC0308 DVP camera driver
(I2C, PCA9557, LEDC, CAM, VIDEO) and camcap example, without ADB,
SDMMC, LCD, PSRAM or other peripherals.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Add camera configuration for lckfb-szpi-esp32s3 board with GC0308
sensor on DVP interface. Includes board-level camera initialization,
DVP GPIO pin mapping, and V4L2 video pipeline setup.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Fix MAC address byte order by reversing 6 bytes after reading
from eFuse. Adjust offset logic to apply after byte reversal,
ensuring Ethernet MAC is base_mac +3. Comply with Espressif's
MAC address generation specification for ESP32S3
Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` to be
consistent with other interpreters.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Refactor heap pointer storage by moving us_heap field from userspace_s
to the nested userspace_data_s structure, enabling future extensibility
of user-space data without modifying the core userspace_s interface across
all board-specific implementations.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
The sched_resumescheduler support was already removed in prior commits.
This change cleans up the now unused legacy source file.
Signed-off-by: chao an <anchao.archer@bytedance.com>
boot mode is configured
1. Explicitly define the .rtc_reserved section to ensure RTC data
that requires fixed address is correctly placed and does not
conflict with other sections
2. When legacy boot is configured, vecbase must also be set and
clear the BSS section
3. Cache must be disabled during Flash operations, so all
Flash-operation-related functions must be placed in IRAM
(internal RAM). Update the linker script for legacy boot mode
Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
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>
Upperhalf supports multiple working modes at the same time,
which is specified by NIC when register
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This defconfig uses the legacy bootloader (based on ESP-IDF's
bootloader) and, due a recent update on SPI flash support, its
initialization was missing data to be moved to the IRAM during the
boot process.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
Increase LCD PWM frequency from 100Hz to 10kHz to eliminate visible flicker
on the lckfb-szpi ESP32S3 board. The higher frequency provides smoother
backlight control and improves display visual quality.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Updates the SPI Flash driver used for user storage MTD.
Moves ESP32 and ESP32S3 to use common driver.
Updates KConfig options to keep backwards compatibility.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Nuttx currently has 2 types of sleep interfaces:
1. Signal-scheduled sleep: nxsig_sleep() / nxsig_usleep() / nxsig_nanosleep()
Weaknesses:
a. Signal-dependent: The signal-scheduled sleep method is bound to the signal framework, while some driver sleep operations do not depend on signals.
b. Timespec conversion: Signal-scheduled sleep involves timespec conversion, which has a significant impact on performance.
2. Busy sleep: up_mdelay() / up_udelay()
Weaknesses:
a. Does not actively trigger scheduling, occupy the CPU loading.
3. New interfaces: Scheduled sleep: nxsched_sleep() / nxsched_usleep() / nxsched_msleep() / nxsched_ticksleep()
Strengths:
a. Does not depend on the signal framework.
b. Tick-based, without additional computational overhead.
Currently, the Nuttx driver framework extensively uses nxsig_* interfaces. However, the driver does not need to rely on signals or timespec conversion.
Therefore, a new set of APIs is added to reduce dependencies on other modules.
(This PR also aims to make signals optional, further reducing the code size of Nuttx.)
Signed-off-by: chao an <anchao.archer@bytedance.com>
Refactor esp32s3_es8311_initialize function to accept I2C handle instead
of port number, moving I2C bus initialization responsibility to the board
bringup code. This change improves flexibility by allowing boards to
manage I2C initialization while the ES8311 driver focuses on audio
codec configuration.
* Updated function signature to accept struct i2c_master_s *i2c parameter
* Removed I2C bus initialization from ES8311 driver
* Updated function documentation to reflect new parameter
* Modified esp32s3-lcd-ev and esp32s3-korvo-2 boards to initialize I2C
before calling ES8311 initialization
* Added proper error handling for I2C initialization failures
* Moved variable declarations to function start for C89 compliance
* Fixed code style issues including line length and indentation
This change maintains backward compatibility for existing functionality
while providing better separation of concerns between I2C bus management
and audio codec configuration.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>