Commit Graph
27309 Commits
Author SHA1 Message Date
J. Nick Koston e8f51fec88 [rp2040] Fix crash handler design flaws (#14716) 2026-03-16 09:25:19 +13:00
Keith Burzinski 7cec2d3029 [ethernet] ESP32-S3 Ethernet compilation fix (#14717) 2026-03-16 09:25:19 +13:00
J. Nick Koston 2b0c471ed7 [esp32] Add crash handler to capture and report backtrace across reboots (#14709) 2026-03-16 09:25:19 +13:00
Keith BurzinskiandJonathan Swoboda 064bd13ebb [ethernet] ESP32-P4 Ethernet compilation fix (#14714)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-16 09:25:19 +13:00
Jonathan SwobodaandClaude Opus 4.6 2627490a11 [esp32_hosted] Bump esp_hosted to 2.12.1 (#14708)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 09:25:19 +13:00
dependabot[bot] 4219d6d367 Bump tornado from 6.5.4 to 6.5.5 (#14704)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-16 09:25:19 +13:00
J. Nick Koston 3ae2d11281 Merge remote-tracking branch 'upstream/mark-leaf-classes-final' into integration 2026-03-15 10:11:06 -10:00
J. Nick KostonandClaude Opus 4.6 b256b68265 Mark leaf Component subclasses as final
Mark 12 leaf classes (no subclasses) as final to enable
compiler devirtualization of virtual calls, reducing code
size and improving performance on embedded targets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 09:51:13 -10:00
J. Nick Koston 373dedefe1 Merge branch 'devirtualize-preferences' into integration 2026-03-15 09:32:43 -10:00
Jonathan Swoboda 33f9ad9cee [esp32] Support non-numeric version extras in IDF version string (#14826) 2026-03-15 14:58:12 -04:00
18a082de30 [ci] Support URL and version extras in generate-esp32-boards.py (#14828)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-15 14:58:01 -04:00
Jonathan Swoboda 7f418d969e [multiple] Fix implicit int-to-gpio_num_t conversions for GCC 15 (#14830) 2026-03-15 14:57:52 -04:00
J. Nick Koston 9529adb049 [preferences] Devirtualize preference backend and manager classes
Eliminates virtual dispatch from ESPPreferenceBackend and ESPPreferences.
Only one implementation of each exists per platform build, so the
polymorphic design was unnecessary overhead — same pattern as OTA (#14473)
and socket (#14398) devirtualizations.

Each platform's backend class is now a standalone final class in its own
header (preference_backend.h). The preferences manager class is extracted
to the platform's preferences.h with a PreferencesMixin CRTP base for
shared template helpers. core/preference_backend.h provides the
PreferenceBackend alias, ESPPreferenceObject, and DECLARE_PREFERENCE_ALIASES
macro. core/preferences.h is a thin wrapper including the active platform.

ESPPreferenceBackend and ESPPreferences become backward-compatible type
aliases to the concrete types. Zero caller changes required.
2026-03-15 08:49:40 -10:00
Jonathan Swoboda fe9f19d9ed [mqtt] Fix ESP-IDF 6.0 compatibility for external MQTT component (#14822) 2026-03-15 09:30:12 -04:00
J. Nick Koston bfb380d002 [ethernet] Fix Starting/Stopped/Starting log on RP2040 boot
Don't set started_ = true in setup(). Let the link polling in
loop() set it when the W5500 PHY link is actually up. Previously,
setting it immediately caused a spurious state transition because
the W5500 needs time after begin() before the link is ready.
2026-03-14 17:17:02 -10:00
J. Nick Koston 2dd12de1dc [ethernet] Fix Starting/Stopped/Starting log on RP2040 boot
Don't set started_ = true in setup(). Let the link polling in
loop() set it when the W5500 PHY link is actually up. Previously,
setting it immediately caused a spurious state transition because
the W5500 needs time after begin() before the link is ready.
2026-03-14 17:16:49 -10:00
J. Nick Koston 50b0e163d5 Merge remote-tracking branch 'origin/ethernet-rp2040-w5500-impl' into integration 2026-03-14 17:14:57 -10:00
J. Nick Koston 51c61c354c [ethernet] Add LwIPLock to get_ip_addresses() on RP2040
localIP() reads netif->ip_addr which can be mutated by DHCP
callbacks from IRQ context. Lock for consistency since this is
called from API responses, not just hot-loop polling.
2026-03-14 17:13:52 -10:00
J. Nick Koston 65e4c752a7 Merge remote-tracking branch 'origin/ethernet-rp2040-w5500-impl' into integration 2026-03-14 17:09:04 -10:00
J. Nick Koston 90c10103b8 [ethernet] Throttle RP2040 link polling, fix defines.h warnings
- Throttle linkStatus()/connected() polling to 500ms intervals to
  avoid excessive SPI transactions on every loop iteration
- Guard USE_ETHERNET/USE_ETHERNET_SPI in RP2040 defines.h block
  with #ifndef to prevent macro redefinition warnings
2026-03-14 17:08:42 -10:00
J. Nick Koston 9bb28b198e Merge branch 'ethernet-rp2040-w5500-impl' into integration 2026-03-14 16:59:08 -10:00
J. Nick Koston f109473707 [ethernet] Document lock-free polling rationale in RP2040 loop
Explain why linkStatus() and connected() are called without
LwIPLock — linkStatus() only reads the W5500 PHY via SPI, and
connected() does a single atomic 32-bit read of netif->ip_addr.
2026-03-14 16:57:00 -10:00
J. Nick Koston 7fd801fe45 [ethernet] Fix lwIP locking races in RP2040 ethernet
- Copy dns_getserver() values (not pointers) under LwIPLock in
  dump_connect_params_() to avoid dereferencing stale pointers
- Read netif ip_addr/netmask/gw under LwIPLock to prevent races
  with DHCP callbacks from IRQ context
- Remove duplicate connect_begin_ assignment in start_connect_()
- Remove duplicate status_set_warning() call in start_connect_()
2026-03-14 16:55:01 -10:00
J. Nick Koston 6dd463f7db Merge branch 'status-set-warning-no-arg' into integration 2026-03-14 16:48:48 -10:00
J. Nick Koston 159485f8a9 [core] Add no-arg status_set_warning() overload, use LOG_STR for static strings
Add a separate no-argument status_set_warning() that delegates to the
LogString* overload, matching the existing status_set_error() pattern.
This allows the linker to garbage-collect the const char* overload in
firmware that only uses no-arg or LOG_STR() calls.

Migrate static string literal callers to LOG_STR() so the const char*
overload can be eliminated in most builds.
2026-03-14 16:42:54 -10:00
J. Nick Koston b24ca802be Merge branch 'ethernet-rp2040-w5500-impl' into integration 2026-03-14 16:28:07 -10:00
J. Nick Koston b457a28c53 [ethernet] Use SplitDefault for clock_speed, add typing to _to_code
- Use cv.SplitDefault for clock_speed (default only on ESP32)
- Use cv.only_on_esp32 for clock_speed and polling_interval validators
- Single SPI_SCHEMA works for both ESP32 and RP2040
- Add type annotations to _to_code_esp32 and _to_code_rp2040
2026-03-14 16:27:47 -10:00
J. Nick Koston 09d4b44ab4 Merge remote-tracking branch 'origin/integration' into integration 2026-03-14 16:21:38 -10:00
J. Nick Koston 4aae82b598 Merge branch 'ethernet-rp2040-w5500-impl' into integration 2026-03-14 16:21:23 -10:00
J. Nick Koston ad0eb6aad5 [ethernet] Make clock_speed and polling_interval ESP32-only
These options are handled by arduino-pico internally on RP2040.
Use cv.only_on([Platform.ESP32]) in the schema validators instead
of rejecting them in _validate().
2026-03-14 16:21:00 -10:00
J. Nick Koston 502728edc1 Merge branch 'ethernet-rp2040-w5500-impl' into integration 2026-03-14 16:18:18 -10:00
J. Nick Koston 54d4910795 [ethernet] Address review feedback for RP2040 W5500
- Clean up eth_ on begin() failure to prevent leak and stale pointer
- Add LwIPLock around dns_getserver() in get_dns_address()
- Add LwIPLock around dns_setserver() in start_connect_()
- Add LwIPLock around dns_getserver() in dump_connect_params_()
- Reject clock_speed and polling_interval config options on RP2040
2026-03-14 16:17:57 -10:00
J. Nick Koston cdbbcfb87d [socket] Extract lwip_bind_err() to deduplicate bind error handling
TCP bind and UDP bind_internal_ had identical ERR_USE/ERR_VAL/ERR_OK
to errno mapping. Extract into a shared helper.
2026-03-14 16:12:39 -10:00
J. Nick Koston 71da3dc2de [socket] Fix RP2040 socket_delay race: don't clear wake flag before sleep
Restore the comment explaining why s_socket_woke must not be cleared
between the early-return check and the __wfe() loop, and restore the
s_socket_woke = false after the loop to consume the wake for the next
call. Both were lost during conflict resolution.
2026-03-14 16:09:24 -10:00
J. Nick Koston 0176305d24 [socket] Restore read_locked_, SO_RCVTIMEO, and wait_for_data_ lost in merge
These features from upstream/dev were dropped when resolving conflicts
with the PR's remote branch: read_locked_/wait_for_data_ (blocking read
with SO_RCVTIMEO timeout support), recv_timeout_cs_ field, SO_RCVTIMEO
and SO_SNDTIMEO setsockopt/getsockopt handling, and the setblocking()
implementation that accepts blocking mode for SO_RCVTIMEO.
2026-03-14 16:07:15 -10:00
J. Nick Koston c81e9fd154 [socket] Deduplicate sockaddr parsing between TCP and UDP bind
Extract sockaddr_to_lwip() from LWIPRawUDPImpl static method to a
shared file-level function. Refactor LWIPRawCommon::bind() to use it
instead of inline address parsing, removing ~35 lines of duplicated
sockaddr-to-ip_addr_t conversion code.
2026-03-14 16:03:24 -10:00
J. Nick Koston 556ef1894f Merge branch 'socket-lwip-raw-udp' of https://github.com/esphome/esphome into socket-lwip-raw-udp
# Conflicts:
#	esphome/components/socket/lwip_raw_tcp_impl.cpp
#	esphome/components/socket/lwip_raw_tcp_impl.h
2026-03-14 16:00:31 -10:00
J. Nick KostonandClaude Opus 4.6 519be06e73 [socket] Add LWIP_LOCK to UDP socket methods for RP2040 safety
On RP2040, lwip callbacks run from a low-priority IRQ context and can
preempt main-loop code. All lwip API calls from the main loop must
hold the async_context lock (LWIP_LOCK) to prevent races on shared
lwip state (PCB lists, pbuf pools, IGMP groups).

The TCP implementation was already correct; the UDP methods were
missing the lock.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 15:57:57 -10:00
J. Nick Koston 1e935c128a Merge remote-tracking branch 'upstream/dev' into socket-lwip-raw-udp
# Conflicts:
#	esphome/components/socket/lwip_raw_tcp_impl.cpp
2026-03-14 15:53:39 -10:00
J. Nick Koston 162835d6da Merge remote-tracking branch 'origin/integration' into integration 2026-03-14 15:45:18 -10:00
J. Nick Koston b285f640ac Merge remote-tracking branch 'origin/ethernet-rp2040-w5500-impl' into integration 2026-03-14 15:44:18 -10:00
J. Nick Koston e20b8a9fa1 adjust 2026-03-14 15:42:58 -10:00
J. Nick Koston 3e4cb84585 adjust 2026-03-14 15:41:09 -10:00
J. Nick Koston 90a8116cc1 Merge branch 'integration' of https://github.com/esphome/esphome into integration 2026-03-14 15:25:38 -10:00
J. Nick Koston fdfbcd03af Merge remote-tracking branch 'origin/ethernet-rp2040-w5500-impl' into integration 2026-03-14 15:18:59 -10:00
J. Nick Koston c9cba2b070 [ethernet] Fix clang-tidy errors in ESP32 ethernet
- Add CONFIG_ETH_SPI_ETHERNET_W5500, CONFIG_ETH_SPI_ETHERNET_DM9051,
  CONFIG_ETH_USE_ESP32_EMAC to defines.h for clang-tidy visibility
- Fix %lu format to PRIu32 for polling_interval_
2026-03-14 15:18:02 -10:00
J. Nick Koston 0acd4ef50b Merge branch 'ethernet-rp2040-w5500' into integration 2026-03-14 14:43:24 -10:00
J. Nick Koston 4c0ab1e38a Merge branch 'ethernet-rp2040-w5500' into ethernet-rp2040-w5500-impl 2026-03-14 14:41:46 -10:00
J. Nick Koston 31a787eae1 [ethernet] Restore SPI polling version comment and add return type
Add back the useful comment about which ESP-IDF versions
support SPI Ethernet without IRQ. Add return type annotation.
2026-03-14 14:41:33 -10:00
J. Nick Koston 8ab3e8fa89 [ethernet] Add RP2040 W5500 Ethernet support
Add W5500 SPI Ethernet support for RP2040 boards using arduino-pico's
Wiznet5500lwIP class. Tested on WIZnet W5500-EVB-Pico hardware.

- Add ethernet_component_rp2040.cpp with W5500 implementation
- Add RP2040 members and setters to ethernet_component.h
- Enable RP2040 platform in SPI_SCHEMA and FILTER_SOURCE_FILES
- Add RP2040 validation, code generation, and lwIP_w5500 library
- Add W5500 RP2040 test YAML
2026-03-14 14:38:48 -10:00