Commit graph

61560 commits

Author SHA1 Message Date
zhanxiaoqi
29114efb41 sched/misc: Optimize thread saving order in coredump for easier gdb debug
When GDB opens a coredump file, it first selects a "current thread",
and the bt command by default only performs backtracing on this current
thread. When there is no dedicated "crash thread marker" for this current
thread in NuttX's coredump.elf, it usually degenerates to
"the first thread parsed in the core file".

Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
2026-04-14 19:33:14 +08:00
Abhishek Mishra
ba6a4d55fe !Documentation: describe build-time passwd generation workflow.
Document the new mkpasswd-based password generation system and its
integration with the build process.

Changes:
* Add comprehensive mkpasswd tool documentation to components/tools
* Update SIM board docs to explain generated passwd workflow
* Update ESP32-C3-legacy board docs for passwd generation
* Update RX65N board docs with credential handling guidance
* Document how to configure and use BOARD_ETC_ROMFS_PASSWD_* options
* Explain security benefits of build-time generation vs static files
* Update all doc examples from default username "admin" to "root"

BREAKING CHANGE: Boards using static /etc/passwd files in ETC_ROMFS
must migrate to the new build-time generation workflow documented in
Documentation/components/tools/index.rst. The old static passwd files
are no longer present in migrated boards; boards that relied on them
will fail to build until credentials are configured via Kconfig.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-04-14 16:06:30 +08:00
Abhishek Mishra
86a7fa9246 !boards: migrate SIM and ESP32-C3-legacy to generated passwd files.
Migrate boards from static /etc/passwd files to build-time generation:

* Remove static etc/passwd files from SIM and ESP32-C3-legacy boards
* Update board configurations to enable BOARD_ETC_ROMFS_PASSWD_ENABLE
* Configure SIM board with login demo user (root/Administrator)
* Update board build rules to use newly generated passwd files
* Remove CMakeLists.txt dependency on static passwd in SIM
* Update MOTD string from username=admin to username=root

This completes the infrastructure migration for boards supporting
login functionality.

BREAKING CHANGE: The static etc/passwd files have been removed from
  boards/sim/sim/sim/src/etc/passwd
  boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/src/etc/passwd
These boards now require CONFIG_BOARD_ETC_ROMFS_PASSWD_ENABLE=y and a
configured password. Any board carrying a custom static passwd file must
set RCRAWS to exclude etc/passwd and manage credentials via the new
Kconfig options or provide their own passwd generation. To fix: run
'make menuconfig' and navigate to:
  Board Selection --->
    Auto-generate /etc/passwd at build time --->
      Admin password

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-04-14 16:06:30 +08:00
Abhishek Mishra
ab6b1fd6f9 !build: add build-time password generation with mkpasswd tool.
Introduce mkpasswd, a pure-C host tool for generating encrypted password
files at build time using TEA encryption. This enables secure,
credential-free firmware images while allowing build-time password
configuration.

Changes:
* Add mkpasswd.c host tool for TEA-based password hashing and encryption
* Integrate mkpasswd into Make build system (tools/Makefile.host)
* Add CMake support for mkpasswd compilation and ROMFS passwd generation
* Add CONFIG_BOARD_ETC_ROMFS_PASSWD_* configuration options to Kconfig
* Implement credential exclusion from defconfig to prevent password leaking
* Update savedefconfig.cmake to strip sensitive credentials
* Fix mkdir() portability for Windows Native builds (CONFIG_WINDOWS_NATIVE)
* Change default username from "admin" to "root" (POSIX convention)
* Improve build-failure error message with full menuconfig navigation path

BREAKING CHANGE: Boards enabling CONFIG_BOARD_ETC_ROMFS_PASSWD_ENABLE
must set CONFIG_BOARD_ETC_ROMFS_PASSWD_PASSWORD to a non-empty string
of at least 8 characters. The build now fails with an explicit error if
this config is left empty. To fix: run 'make menuconfig' and navigate to:
  Board Selection --->
    Auto-generate /etc/passwd at build time --->
      Admin password

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-04-14 16:06:30 +08:00
Arjav Patel
ea161e4fa9 documentation: Document MQTT-C with Mbed TLS usage.
Add Kconfig guidance, mqttc_pub TLS options and default port, the
mqttc_mbedtls_pub example, and cross-links between the mqttc example and mbedtls overview pages

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-04-14 16:05:54 +08:00
Tiago Medicci Serrano
b28d60947a boards/xtensa/esp32/esp32-devkitc: Fix psram_usrheap defconfig
When both CONFIG_ESP32_SPIRAM and  CONFIG_ESP32_SPIRAM_USER_HEAP
are selected, the device must not select CONFIG_NSH_ARCHINIT.
Instead, CONFIG_BOARD_LATE_INITIALIZE must be selected. This is
necessary because the SPI flash initialization disables the cache,
and only internal memory is then accessible. So, if the  SPI flash
initialization is performed by the entry task (nsh_main, a regular
task), it would use the user heap to allocate memory, which would
cause a system crash when the cache is disabled. On the other hand,
by selecting CONFIG_BOARD_LATE_INITIALIZE, a kernel thread is
dedicated to perform the initialization, and the cache can be
safely disabled.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-04-14 09:21:17 +02:00
Tiago Medicci Serrano
36f07f5c44 arch/xtensa/esp32: Fix ROM strdup heap issue in USER_HEAP mode
When ESP32's flat build mode is selected with the external PSRAM
on USER_HEAP mode, the ROM strdup internally calls malloc which may
be mapped to a different heap than lib_free, causing cross-heap
allocation issues and system crashes.

This commit adds a new Kconfig option ESP32_DONT_USE_ROM_LIBC to
allow using NuttX libc instead of ROM newlib functions. When
USER_HEAP mode is selected, this option is automatically enabled.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-04-14 09:21:17 +02:00
461911662
877ddd06a8 arch/xtensa/esp32s3: Fix ROM strdup heap issue in USER_HEAP mode
In ESP32-S3 flat build with USER_HEAP mode, ROM strdup internally calls
malloc which may be mapped to a different heap than lib_free, causing
cross-heap allocation issues and system crashes.

This commit adds a new Kconfig option ESP32S3_DONT_USE_ROM_LIBC to
allow using NuttX libc instead of ROM newlib functions. When USER_HEAP
mode is selected, this option is automatically enabled.

Fixes: 60ca804b56 ("esp32s3: Fix bug related to the PSRAM-allocated task stack")

Signed-off-by: 461911662 <461911662@qq.com>
Reviewed-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
Reviewed-by: Almir Okato <almir.okato@espressif.com>
Reviewed-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-04-14 09:21:17 +02:00
zhanxiaoqi
e2ddb55101 nuttx/nx: compilation error occurs
Enabling CONFIG_NX_HWCURSORIMAGE or CONFIG_NX_SWCURSOR causes a compile error due to a missing semicolon after a structure variable.

Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
2026-04-14 13:35:26 +08:00
Peter van der Perk
143938777a arch/arm/imx9: eDMA5 don't enable all interrupts
Fixes irq_unexpected_isr when receiving interrupts not used
by the M7 core

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2026-04-14 04:05:52 +02:00
Michal Lenc
bc9e1ffb01 fs/fat: fix incorrect representation of SFN files created on Linux
Linux creates all files as long file name entries even if they
fit short 8.3 format. This caused issues when deleting or renaming
files as the long file name entry was not recognized and only deleted
it's short file name entry. This basically kept breaking the file
system as subsequent long file name files were not correctly stored.
The typical representation of this issue was long file name being
represented as it's short name alias.

This commit adjusts the LFN/SFN logic a bit - the code now always
fills in long file name and then checks if this could possibly be
a short file entry (we still have to do that because Windows stores
8.3 files as short file entry). This ensures compatibility with
files created both on Linux and Windows.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-04-14 09:51:20 +08:00
simbit18
587ca7b537 workflows/build.yml: job MSVC fix Filename too long
Git
  - Enabled long path support by setting the core.longpaths setting to true.

Fix
Cloning into 'esp-hal-3rdparty'...
HEAD is now at 5d8324708f5 Enable using `esp_timer` on RISC-V devices
error: unable to create file tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.h: Filename too long
fatal: Unable to checkout '582ff482038db6e4010dbf6f943d97b05ad06ea5' in submodule path 'components/mbedtls/mbedtls'
error: unable to create file tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.h: Filename too long
fatal: Could not reset index file to revision 'HEAD'.

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-13 23:55:10 +08:00
simbit18
944ba20a69 tools/ci: Added esptool for Windows Native
- Added esptool for Windows Native

- Added build for esp32-c3-zero

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-13 23:55:10 +08:00
zhanxiaoqi
f9fae3ed32 video/fb: fix compilation errors
enabling CONFIG_FB_HWCURSOR and CONFIG_FB_HWCURSORIMAGE causes a compile error: missing semicolon after a structure variable.

Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
2026-04-13 19:55:44 +08:00
zhanghongyu
34fbaa15ee net/route: fix return value of net_writeroute_ipv6
Return ntotal (total bytes written) instead of ret (result of last
write call). This matches the expected semantics and is consistent
with net_writeroute_ipv4().

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-13 08:46:57 -03:00
zhanghongyu
c6c7cf6bba net/netlink: fix memory leak in netlink_get_neighbor
Add kmm_free(alloc) before returning NULL when neigh is NULL in
netlink_get_neighbor(). Without this, the allocated memory is
leaked on the error path.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-13 08:46:57 -03:00
zhanghongyu
244ddfcc2c net/netfilter: fix match name for UDP in ipt_filter
In both convert_ipv4entry() and convert_ipv6entry(), the IPPROTO_UDP
case was incorrectly comparing against XT_MATCH_NAME_TCP instead of
XT_MATCH_NAME_UDP. This caused UDP filter rules to never match.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-13 08:46:57 -03:00
zhanghongyu
39639282d1 net/mld: remove duplicate net_unlock in mld_gendog_work
Remove a redundant net_unlock() call in the early return path of
mld_gendog_work(). The network lock is already released at the
common exit path, causing a double-unlock.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-13 08:46:57 -03:00
zhanghongyu
6cba2674fa net/icmpv6: fix wrong logical operator in recvmsg validation
Change && to || in the fromlen validation of icmpv6_recvmsg().
The original condition (fromlen == NULL && *fromlen < sizeof(...))
would never be true when fromlen is NULL due to short-circuit
evaluation. The correct logic is: reject if fromlen is NULL or
the buffer is too small.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-13 08:46:57 -03:00
zhanghongyu
0c7f8204fd net/icmp: use break instead of return in icmp_findconn
Replace return with break inside the loop in icmp_findconn() to
ensure any post-loop cleanup logic is properly executed before
returning.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-13 08:46:57 -03:00
zhanghongyu
a0b8969636 net/bluetooth: fix null pointer dereference in bluetooth_sendmsg
Move the NULL check for radio pointer before the DEBUGASSERT that
dereferences it. Previously DEBUGASSERT(radio->r_dev.d_lltype == ...)
was executed before verifying radio != NULL, which would crash when
the device is not found.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-13 08:46:57 -03:00
dependabot[bot]
4257c55eeb build(deps): bump actions/upload-artifact from 7.0.0 to 7.0.1
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v7...v7.0.1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 15:04:14 +08:00
dependabot[bot]
0e229e004a build(deps): bump actions/github-script from 8.0.0 to 9.0.0
Bumps [actions/github-script](https://github.com/actions/github-script) from 8.0.0 to 9.0.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v8...v9)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 15:03:58 +08:00
raiden00pl
e274655d1c boards/nrf5340-dk: add qencoder example
add qencoder support and enable qe example for config

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-12 19:41:52 -04:00
raiden00pl
83264bac84 boards/nrf52840-dk: add qencoder example
add qencoder support and enable qe example for jumbo config

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-12 19:41:52 -04:00
raiden00pl
1513b3e20c arch/nrf52|nrf53: add qencoder support
add qencoder support for nrf52 and nrf53

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-12 19:41:52 -04:00
raiden00pl
a448781348 boards/nucleo-c0XX: add qencoder support
add qencoder support for nucleo-c0 boards

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-12 19:41:29 -04:00
raiden00pl
5bacc302eb arch/stm32f0l0g0: add qencoder support
add QENCODER support for STM32F0/L0/G0/C0

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-12 19:41:29 -04:00
raiden00pl
afda7316e5 arch/stm32f0l0g0/tim: TIM2 is 32-bit on F0/G0/C0
fix TIM2 width - it is 32-bit on F0/G0/C0 but 16-bit on C0

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-12 19:41:29 -04:00
raiden00pl
1753efa80d boards/nucleo-c0XX: fix invalid ADC buff size
fix invalid ADC buff size that cause buffer overflow

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-13 00:21:03 +08:00
raiden00pl
6928384019 arch/stm32{f7|h7|l4|l5|u5}: remove references to CONFIG_STM32_TIMx_QECLKOUT
Remove useless references to CONFIG_STM32_TIMx_QECLKOUT

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-12 10:52:36 -04:00
raiden00pl
0af4519bd7 boards/nrf52840-dk|nrf5340-dk: remove nrf5x_timer.c
remove nrf5x_timer.c, it was moved to boards/common long time ago:

- boards/arm/nrf52/common/src/nrf52_timer.c
- boards/arm/nrf53/common/src/nrf53_timer.c

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-12 15:34:46 +02:00
Daniel Monteiro
9d5b26e769 boards/tiva: change default toolchain for tm4c123g to GNU EABI
fixes: #18668

Signed-off-by: Daniel Monteiro <monteiroquiet@gmail.com>
2026-04-11 12:26:23 -03:00
Filipe Cavalcanti
8fb8c2dca5 arch/xtensa: register Wi-Fi IRQs in non_iram mask for SPI flash
Wi-Fi used a locally allocated vector_desc, so those CPU interrupt lines
were never recorded in the HAL non_iram_int_mask.
During SPI flash, esp_intr_noniram_disable() therefore did not mask them,
and Wi-Fi ISRs could still run with the cache off.
Now, Wi-Fi IRQs are treated as non-IRAM and get masked while flash/cache is suspended.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-11 13:40:44 +08:00
Filipe Cavalcanti
e8bcbbc5d3 arch/risc-v: register Wi-Fi IRQs in non_iram mask for SPI flash
Wi-Fi used a locally allocated vector_desc, so those CPU interrupt lines
were never recorded in the HAL non_iram_int_mask.
During SPI flash, esp_intr_noniram_disable() therefore did not mask them,
and Wi-Fi ISRs could still run with the cache off.
Now, Wi-Fi IRQs are treated as non-IRAM and get masked while flash/cache is suspended.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-11 13:40:44 +08:00
wangjianyu3
0885b45256 xtensa/esp32s3: refactor cam driver to use cam_ll HAL layer
Replace direct putreg32/getreg32 register accesses in esp32s3_cam.c
with cam_ll_* inline functions from Espressif's esp_hal_cam component.
This reduces maintenance burden by using the vendor-provided HAL
abstraction instead of raw register manipulation.

Changes:
- Add lcd_cam_dev_t *hw pointer to driver struct
- Use cam_ll_start/stop/reset/fifo_reset for CAM control
- Use cam_ll_get_interrupt_status/clear_interrupt_status for ISR
- Use cam_ll_set_recv_data_bytelen for DMA buffer length
- Use cam_ll_select_clk_src/set_group_clock_coeff for clock config
- Use cam_ll_enable_vsync_filter/set_vsync_filter_thres
- Use cam_ll_enable_vsync_generate_eof/enable_rgb_yuv_convert
- Use struct access for interrupt enable (cam_ll_enable_interrupt
  requires __DECLARE_RCC_ATOMIC_ENV not available in NuttX)
- Add esp_hal_cam include paths to hal.mk

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-11 13:36:53 +08:00
simbit18
f20084225e ci/platforms/linux.sh: bump Espressif esptool
- Bump Espressif esptool 5.2.0

   #18696

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 14:34:28 -03:00
simbit18
c585e97a1b ci/platforms/ubuntu.sh: bump Espressif esptool
- Bump Espressif esptool 5.2.0

   #18696

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 14:34:28 -03:00
simbit18
f8621bc0a1 ci/platforms/darwin_arm64.sh: bump Espressif esptool
- Bump Espressif esptool 5.2.0

   #18696

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 14:34:28 -03:00
simbit18
8500421d97 ci/platforms/darwin.sh: bump Espressif esptool
- Bump Espressif esptool 5.2.0

   #18696

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 14:34:28 -03:00
Tiago Medicci Serrano
6ef0d35894 Documentation: Power Management for ESP32-P4-Function-EV-Board
This commit documents the power management defconfig for the
ESP32-P4-Function-EV-Board.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-04-10 14:33:52 -03:00
Tiago Medicci Serrano
745f7542d9 arch/risc-v: Enable low power mode for ESP32-P4
This commit introduces the necessary changes to enable low power
mode for ESP32-P4. Please check the corresponding documentation.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-04-10 14:33:52 -03:00
simbit18
e1c8f21f1a boards/risc-v/esp32p4: CMake added esp32p4-pico-wifi-wareshare board
- CMake added esp32p4-pico-wifi-wareshare board

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 13:43:41 -03:00
simbit18
327dc0a975 boards/risc-v/esp32c6: CMake added esp32c6-xiao board
- CMake added esp32c6-xiao board

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 13:43:41 -03:00
Filipe Cavalcanti
738f683b7d cmake: add -D__NuttX__ to preprocessor
This change allows for linker script files to be properly processed when
`#ifdef __NuttX__` is used.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-10 12:22:24 -03:00
Eren Terzioglu
c97a7856e3 Docs/risc-v/esp32[-c3|-c6|-h2]: Add autopm docs
Add autopm docs for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-04-10 20:34:46 +08:00
Eren Terzioglu
8cc3d49c34 boards/risc-v/esp32[-c3|-c6|-h2]: Add autopm defconfig
Add autopm defconfig for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-04-10 20:34:46 +08:00
Tiago Medicci Serrano
213a651509 arch/risc-v/esp32[-c3|-c6|-h2]: Add auto sleep
Add auto sleep for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-04-10 20:34:46 +08:00
Vlad Pruteanu
ad168fdf2d arch/xtensa/esp32: Add support for hardware accelerated PBKDF2
This adds support for the PBKDF2 algorithm in the ESP32 crypto
driver. Here, it will take advantage of the hardware-accelerated
implementation of SHA.

Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
2026-04-10 20:32:46 +08:00
simbit18
4f1a3356f9 arch/risc-v/src/common/espressif: Aligned Cmake with Make
Add:
- replace rmtchar with arch-specific lirc adapter apache#18654

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 08:34:41 -03:00