Repository navigation
Conversation
This was referenced Oct 27, 2026
2 of 6 tasks
…DF 6.0.3 u64ctrl moves to ESP-IDF 6.0.3 (mbedTLS 4) and bumps the module version so the updater installs it. This changes the toolchain of the C64 Ultimate's power controller, not only of its WiFi: the module runs power, button and keepalive handling. It is one commit because none of its parts builds alone: the CMake check stops CI's ESP-IDF 5.3.1 build, and the recovery code does not compile under mbedTLS 4. - my_uart.c: uart_periph.h moved from soc/ to hal/, and uart_isr_handle_t (a typedef of intr_handle_t) is gone. The same two changes GideonZ#996 makes for raw_u64. - CMakeLists.txt: configure stops on an ESP-IDF older than 6. - sdkconfig: regenerated by idf.py build from the ESP-IDF 5.3.1 file. Values present in both versions are carried; of the 1498 options in the 5.3.1 file only the esptool before/after spelling, DHCP option length (68 to 69), X509 trusted cert callback and ESP_NETIF_RECEIVE_REPORT_ERRORS changed value (SOC_ constants aside). Options that are new take ESP-IDF 6's defaults, among them picolibc instead of newlib and the FreeRTOS and ring-buffer functions running from flash rather than IRAM. Brownout level 7 and the 100 Hz tick are carried. - rpc_dispatch.h: the module version is the next minor above master's, see the history line. The maintainer assigns the number at merge. - CI builds u64ctrl in espressif/idf:v6.0.3, pinned by digest in $IDF6_IMAGE; raw_u64 and raw_c3 stay in my_docker_image. The ESP32 cache key names both images. README.txt and software/u64ctrl/README.md say how to build it. The recovery code from the Wi-Fi recovery change is ported to mbedTLS 4 and PSA Crypto, because it did not compile: mbedTLS 4 has no public mbedtls/sha256.h and no mbedtls_pk_get_type(). The mbedTLS 4 port is of code written for mbedTLS 3. - recovery_verify.c: the key type comes from mbedtls_pk_get_key_type() (an ECC public key); the manifest hash is psa_hash_compute(); psa_crypto_init() is always called, so the init does not depend on MBEDTLS_USE_PSA_CRYPTO, which is still defined as a legacy symbol that is slated for removal. A failure to start is reported as RECOVERY_ERR_CRYPTO ("crypto library failed"), not as a bad signature. The signature itself is still checked by mbedtls_pk_verify() with a DER ECDSA signature, as before. - recovery_verify.h, recovery_verify.c: the streaming hash of a downloaded file moves out of recovery.c into recovery_hash_*(), on psa_hash_*(), so the host test can run it. It also holds the compare with the manifest's hash, reported as RECOVERY_ERR_HASH_MISMATCH. - recovery.c: stream_file() uses it. The checks, their order and the log line for a differing hash are as before; a failure of the crypto library is logged by name. - Two result codes are added after the existing ones; nothing that was returned before changes. - The host test links TF-PSA-Crypto from ESP-IDF 6, so it moves out of make host_tests, which CI runs in ESP-IDF 5.3.1, into host_tests_idf6 and its own CI step in $IDF6_IMAGE. Tests, written first and red against the unported code (recovery_verify.c cannot include mbedtls/sha256.h under ESP-IDF 6), check by the error each case names: - a valid manifest is accepted; - the wrong key, a tampered manifest, and a manifest correctly signed by an RSA key (rsa512.manifest) are refused as a bad signature; - a changed or truncated image or bitstream is refused as a hash mismatch, and so is a file whose manifest hash differs in its first, middle or last byte, which a compare that stopped early would accept; - a crypto library that will not start, or a hash that fails in its update or finish, is reported as such, never as a bad signature or a match. The test forces these through --wrap=psa_crypto_init, psa_hash_update and psa_hash_finish, so the product code carries no test hook. The signed vectors are unchanged; the two RSA files are new. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
On mbedTLS 4, PSA's key slots are protected by a mutex only with MBEDTLS_THREADING_C. It is ESP-IDF 6's default; the regenerated sdkconfig had carried 5.3.1's "not set". The WiFi supplicant (ESP_WIFI_MBEDTLS_CRYPTO, on in this project) imports and destroys PSA keys now, and it runs next to anything else that uses PSA. The pthread implementation comes with it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…T buffer When no UART buffer is free, the receive hook returned ERR_BUF and wlanif_input() freed the packet. On ESP-IDF 5.3.1 the WiFi driver was then told ESP_OK; on ESP-IDF 6 esp_netif_receive() passes the error on, so the driver would see ESP_FAIL on this path. Stock ESP-IDF 6 already returns ESP_FAIL whenever lwIP's input mailbox is full, so the driver handles it; free the packet here and return ERR_OK only to leave this path exactly as before. The packet is dropped either way. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
UART1 is routed to the FPGA pins in two places: at boot, in setup_modem(), and whenever the machine is switched on, in regulator_enable(). Before either, the pins hold their reset state or, after check_fpga() or a power off, a pull-down (check_fpga() sets it on RXD only; the power-off path sets it on all four). ESP-IDF 5.3.1's uart_set_pin() put a pull-up on RXD and CTS before connecting them, replacing it. ESP-IDF 6's uart_set_pin() never touches pulls, so RXD would stay pulled down and CTS at its reset state while the FPGA configures, reading as a break and as clear to send where 5.3.1 read idle and not clear. One helper, my_uart_connect_pins(), sets the pull-ups and then routes the pins, in that order as 5.3.1 did, and both places call it. While the machine is off RX and CTS stay routed, pulled down; a boot that stays off has the pull-ups on for about 100 ms until regulator_enable(0), the same as on 5.3.1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ESP-IDF 6's brownout interrupt waits for every enabled UART's transmitter to drain before it resets the chip; 5.3.1 reset at once. UART1 honours CTS, and CTS idles high through its pull-up when the FPGA loses power with the machine, so bytes left in the transmit FIFO would never leave and the wait would last until the 300 ms interrupt watchdog, ending in a panic reset instead of a brownout reset. Register a brownout callback, which runs in IRAM ahead of that wait, that turns CTS flow control off so the FIFO drains. A failed registration is logged and does not stop the boot. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The host test only used keys of its own. Load every key in recovery_trusted_keys as an EC public key, require a spare next to the main key, require that no two shipped keys are the same, and check that a manifest is verified by a key placed behind all of them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ESP-IDF 6 moved the FreeRTOS queue/task and ring buffer functions to flash by default (CONFIG_FREERTOS_IN_IRAM and CONFIG_RINGBUF_IN_IRAM are off); ESP-IDF 5.3.1 had them in IRAM. Every frame passes xQueueGenericSend, xQueueReceive and xRingbufferReceive in both directions, so each call can wait on a flash cache miss. Set both options to put them back in IRAM (12,140 B more shared IRAM/DRAM, 157,151 B of 341,760 stay free; flash code drops by 13,024 B). The effect was measured on the U64E's classic ESP32 module only (raw_u64: writemem p50/p90/p99 back in the IDF 5.3.1 range, the REST probe and FTP get not fully). On this module it is not measured yet; the C64U bench run is pending. The change is the same two sdkconfig lines. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…flash The WiFi task runs on core 0. esp_intr_alloc() binds an interrupt to the core it is called on, so my_uart_init() now runs from a short task pinned to core 1, which keeps the UART ISR off the core the WiFi driver is using. The ISR, the UART buffer code, hacked_recv(), dispatch() and cmd_send_eth_packet() move to IRAM with a linker fragment (noflash). The ISR flags stay 0, so the interrupt is masked while the flash cache is off (NVS writes) and nothing in the handler has to be safe to run then; the overflow branch calls the flash function uart_hal_rxfifo_rst(), but RXFIFO_OVF is not in the enable mask, so it does not run. The dispatch task is pinned to core 1 at priority 19 so it runs where the ISR feeds it. Also check the init semaphore and the task create. The whole of my_uart.c is noflash, so my_uart_connect_pins() and the brownout callback now sit in IRAM too (the callback already was IRAM_ATTR), and the callback is registered from the core 1 task. Neither depends on the core: the brownout interrupt is a separate system interrupt, and the pin routing is called as before from task context. This is harmless. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The RX full threshold drops from 120 to 64 and the TX empty threshold from 10 to 64 (the hardware flow control threshold of 122 is unchanged). At 5 Mbaud the interrupt latency budget before RTS asserts goes from 2 bytes (4 us) to 58 bytes (116 us), and the TX FIFO has 128 us instead of 20 us to be refilled. The margin after RTS asserts stays 6 bytes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…IFI_EXTRA_IRAM_OPT) The option is off by default for the ESP32-S3 and places more of the WiFi driver send and receive code in IRAM. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Place esp_netif_transmit/receive/free_rx_buffer, wlanif_input, esp_pbuf_allocate/free, wifi_transmit/free, esp_wifi_internal_free_rx_buffer, pbuf_free, pbuf_alloced_custom, pbuf_init_alloced_pbuf, mem_malloc, mem_free, sys_arch_protect/unprotect and sys_mutex_lock/unlock in IRAM (noflash), so the per-packet path between the WiFi driver and the UART bridge no longer calls flash-resident code. What is left in flash is off that path: the one-time sys_mutex_new, the esp_event_post calls guarded by the runtime tx_rx_events_enabled flag, and the command handlers that dispatch() calls for non-packet commands. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JC-000
force-pushed
the
pr/idf6-u64ctrl
branch
from
October 31, 2026 13:11
9e5d59c to
5b96672
Compare
This was referenced Oct 31, 2026
chrisgleissner
requested changes
Nov 10, 2026
chrisgleissner
left a comment
Collaborator
There was a problem hiding this comment.
@JC-000 thanks for the ESP-IDF 6 migration. The branch conflicts with master. Please merge or rebase master.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JC-000
added a commit
to JC-000/1541ultimate
that referenced
this pull request
Nov 10, 2026
Brings in GideonZ#1028's updated branch, which already holds master. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JC-000
added a commit
to JC-000/1541ultimate
that referenced
this pull request
Nov 10, 2026
Brings in GideonZ#996's updated branch, which already holds master and GideonZ#1028. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JC-000
added a commit
to JC-000/1541ultimate
that referenced
this pull request
Nov 10, 2026
Brings in GideonZ#1029's updated branch, which already holds master and GideonZ#1028/GideonZ#996. The tree was merged against the old WiFi series tip so that GideonZ#953's own changes apply on top of the merged GideonZ#1041, not on the earlier copy of it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JC-000
added a commit
to JC-000/1541ultimate
that referenced
this pull request
Nov 10, 2026
Brings in GideonZ#953's updated branch, which already holds master, GideonZ#1028, GideonZ#996 and GideonZ#1029. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> # Conflicts: # Makefile
Contributor
Author
|
Merged the current master into this branch (50aa426). The only conflict was in the Makefile's host_tests list: master added the new uart_tests, and this PR keeps the manifest check in host_tests_idf6, so the merge keeps both. The module version is still above master's, and the diff is still only this PR's own change. Written with Claude Sonnet 5.5 in Claude Code. |
JC-000
added a commit
to JC-000/1541ultimate
that referenced
this pull request
Nov 12, 2026
…ideonZ#996) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JC-000
added a commit
to JC-000/1541ultimate
that referenced
this pull request
Nov 12, 2026
…(base update for GideonZ#1029) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JC-000
added a commit
to JC-000/1541ultimate
that referenced
this pull request
Nov 12, 2026
…ci-net-get-random (base update for GideonZ#953) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> # Conflicts: # software/io/network/network_target.h
JC-000
added a commit
to JC-000/1541ultimate
that referenced
this pull request
Nov 13, 2026
…aster) into pr/3-tls-r1 (base update for GideonZ#997) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CI and the build instructions move from the 6.0.3 image to espressif/idf:v6.1.1, pinned by digest. The sdkconfig is regenerated by 6.1.1; every value the module sets is unchanged, including the IRAM placement options (FreeRTOS, ring buffer and Wi-Fi in IRAM). Its mbedTLS is the same Mbed TLS 4.1.1 commit as 6.0.3. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The reason codes WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT, _AUTH_FAIL and _HANDSHAKE_TIMEOUT keep the values 15, 202 and 204 in ESP-IDF 6.1.1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The 1.31 line of the version history said the module was built with ESP-IDF 6.0.3. It is now built with 6.1.1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ESP-IDF 6.1.1 added CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_SOFTAP, which defaults to y. 6.0.3 had no such option, and the module only runs as a station, so it is set to n to keep the 6.0.3 behavior and not link soft-AP code. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Conflicts resolved: - software/u64ctrl/main/rpc_dispatch.h: master's GideonZ#1097 took V1.30 for the root list change; this branch keeps its own V1.31 (ESP-IDF 6.1.1) and carries master's 1.30 history note below it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base: master (3db34d2, which has #1012, #1027 and #1034). Commits 1 to 11 move the module to ESP-IDF 6, and commits 12 to 15 move it on to 6.1.1.
This is the first of three ESP-IDF 6 PRs, each built on the one before: this one (u64ctrl), then #996 (raw_u64), then #1029 (raw_c3, draft). If they are accepted, this one should merge first. #1027 (SSID and password terminators, in all three modules) is already on master.
It takes #1034's custom certificate bundle:
sdkconfigkeepsCONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE=y,CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE=yand the pathca/cacert.pem, andtests/lib/u64ctrl_ca_test.pypasses on this head.Why move
The pin is ESP-IDF 6.1.1:
espressif/idf:v6.1.1, by digest (sha256:2b4f966c37eaedc19542b0637a5f850b2eff9478d8e858192aa0073d92c2dc91). Its Mbed TLS is the same 4.1.1 commit as in 6.0.3 (espressif/mbedtlsce3f3485a121). The closed Wi-Fi libraries are newer than in 6.0.3; the PHY library is identical.The move changes the toolchain of the whole module: its power, button and keepalive handling as well as its Wi-Fi. So the commits are split by behaviour change, and each one says what it keeps the same as 5.3.1.
The Wi-Fi recovery code from #1012 did not compile under mbedTLS 4, which has no public
mbedtls/sha256.hand nombedtls_pk_get_type(). The first commit ports it. A valid or an invalid manifest gives the same result as before; only crypto-library failures are reported differently. I read the rest of what #1012 added (recovery_trust.c,wifi_modem.c, andrecovery.capart from the streaming hash described below) for crypto API use and found none.Commits
Commits 1 to 11 were written and first built against ESP-IDF 6.0.3, and their names say so. Commits 12 to 15 move the pin to 6.1.1; the head is what CI builds.
1. Build u64ctrl with ESP-IDF 6.0.3
This is one commit because none of its parts builds alone.
my_uart.c.uart_periph.hmoved fromsoc/tohal/, anduart_isr_handle_tis gone. These are the same two changes Build the U64 WiFi module firmware (raw_u64) with ESP-IDF 6.1.1 #996 makes for raw_u64.CMakeLists.txt. Configure stops on an ESP-IDF older than 6.sdkconfig. It was regenerated byidf.py buildfrom the 5.3.1 file.ESP_NETIF_RECEIVE_REPORT_ERRORS(forced on by ESP-IDF 6) and a read-only chip constant,SOC_CPU_WATCHPOINT_MAX_REGION_SIZE. Commits 2 and 10 set the other two,MBEDTLS_THREADING_CandESP_WIFI_EXTRA_IRAM_OPT.ca/cacert.pem), andtests/lib/u64ctrl_ca_test.pypasses.rpc_dispatch.h. The module version is the next minor above master's, so the updater installs the module. Renumber it at merge if you prefer. The updater only installs a newer module (update_u64ii.cc), so a module change numbered below this version would not be installed on units that have this one.espressif/idf:v6.1.1(commit 12; commit 1 used 6.0.3), pinned by digest in$IDF6_IMAGE. raw_u64 and raw_c3 (U2+L) stay inmy_docker_imageand are untouched by this PR: their sources andsdkconfigfiles are unchanged, and they are built in the same image, now by target name (make esp32_raw_u64 esp32_raw_c3), so nothing is stranded. The ESP32 cache key names both images.README.txtandsoftware/u64ctrl/README.mdsay how to build u64ctrl.recovery_verify.c):mbedtls_pk_get_key_type().psa_hash_compute().psa_crypto_init()is always called.RECOVERY_ERR_CRYPTO, not as a bad signature.mbedtls_pk_verify()on a DER ECDSA signature.recovery.cintorecovery_hash_*(), so the host test can run it. The checks, their order and the log line for a differing hash are as before.2. Lock the mbedTLS key store (
MBEDTLS_THREADING_C)On mbedTLS 4, PSA key slots are mutex-protected only with this option. It is ESP-IDF 6's default, but the regenerated sdkconfig had carried 5.3.1's "not set". The Wi-Fi supplicant now imports and destroys PSA keys.
3. Keep dropping Wi-Fi packets quietly when there is no UART buffer
On 5.3.1 the driver was told OK after the packet was freed. On 6,
esp_netif_receive()passes the error on. The hook now frees the packet and returnsERR_OK, so this path behaves as before.4. Keep the pull-ups on the UART RX and CTS pins
5.3.1's
uart_set_pin()put a pull-up on RXD and CTS. 6's never touches pulls, so RXD could stay pulled down while the FPGA configures and read as a break. One helper sets the pull-ups and then routes the pins, in the 5.3.1 order, and both call sites use it.5. Stop UART1 flow control in the brownout interrupt
ESP-IDF 6's brownout handler waits for every enabled UART to drain before it resets. 5.3.1 reset at once. When the FPGA loses power, CTS idles high, so the wait ran into the 300 ms interrupt watchdog and ended in a panic reset instead of a brownout reset. A brownout callback, which runs in IRAM, now turns CTS flow control off first.
6. Test the keys the module ships with
The host test used only keys of its own. Now it also checks:
recovery_trusted_keysloads as an EC public key;7. Keep FreeRTOS and the ring buffer in IRAM
ESP-IDF 6 moved the FreeRTOS queue and task functions and the ring buffer to flash by default (
CONFIG_FREERTOS_IN_IRAMandCONFIG_RINGBUF_IN_IRAMare off). 5.3.1 had them in IRAM. Every frame passes them in both directions, so each call can wait on a flash cache miss. This commit sets both options, which are the only two lines it changes. On 6.0.3 it cost 12,140 bytes of shared IRAM/DRAM and took 13,024 bytes out of flash code; the totals at the head are under "Memory".The same change on the U64 Elite's ESP32 module (#996) brought the WiFi write latency back to the 5.3.1 range on a quiet channel. For this module, see "Tested on hardware": two idle runs that are not worse than master's, with no speed claim.
8. Run the UART interrupt and dispatch on core 1, out of flash
The WiFi driver runs on core 0.
esp_intr_alloc()binds an interrupt to the core it is called on, somy_uart_init()now runs from a short task pinned to core 1, which keeps the UART interrupt off the core (and cache) the WiFi driver uses.my_uart,cmd_buffer,hacked_recv(),dispatch()andcmd_send_eth_packet()go to IRAM with a linker fragment (main/linker.lf,noflash). The interrupt flags stay 0, so the interrupt stays masked while the flash cache is off. The dispatch task is pinned to core 1 at priority 19, where the interrupt feeds it. The init semaphore and the task create are checked.Because the whole of
my_uartis in IRAM,my_uart_connect_pins()is too. It runs from task context and calls flash functions, which is fine. The brownout callback was already in IRAM; it is now registered from the core-1 task, and the brownout interrupt is a separate system interrupt that does not depend on the core. The FPGA pin routing and the brownout code are otherwise unchanged. About 3.4 KB of shared IRAM/DRAM.9. Lower the UART FIFO thresholds
Receive 120 to 64, transmit 10 to 64. The flow-control threshold stays at 122. The time budget between the receive interrupt and the sender being stopped goes from 2 bytes to 58 bytes of line time; the margin after RTS is raised stays 6 bytes. I chose the values from the interrupt timing, not from a sweep. The receive interrupt fires about twice as often, now on core 1. No memory cost.
10. Keep more of the WiFi driver in IRAM (
CONFIG_ESP_WIFI_EXTRA_IRAM_OPT)One
sdkconfigline. It moves the WiFi transmit path (ieee80211_output_do,esf_buf_alloc_dynamic) and some WiFi library code to IRAM. About 4.6 KB.11. Run the netif, pbuf and heap path from IRAM
noflashentries for the per-frame functions between the WiFi driver and the UART:esp_netif_transmit/receive/free_rx_buffer,wlanif_input,esp_pbuf_allocate/free,pbuf_free,pbuf_alloced_custom,pbuf_init_alloced_pbuf,wifi_transmit,wifi_free,mem_malloc,mem_free,sys_arch_protect/unprotect,sys_mutex_lock/unlock(sys_arch_protectcallssys_mutex_lock, so moving only the first would not help) andesp_wifi_internal_free_rx_buffer. I checked the linked ELF withobjdump: none of these functions calls into flash on the packet path. What stays in flash is not per packet: the command handlers,uart_hal_rxfifo_rston a FIFO overflow (that interrupt is not enabled), andesp_event_postbehind a runtime flag that is off.12. Build the control module with ESP-IDF 6.1.1
CI and the build instructions move from the 6.0.3 image to
espressif/idf:v6.1.1, pinned by digest.sdkconfigis regenerated by 6.1.1. Every value the module sets is unchanged, includingFREERTOS_IN_IRAM,RINGBUF_IN_IRAMandESP_WIFI_EXTRA_IRAM_OPT. 6.1.1 adds about 100 options with its defaults, drops a few (FREERTOS_SMPand someSOC_*constants), and turnsESP_WIFI_REMOTE_ENABLEDon by default; no wifi-remote object is linked into the module. The Mbed TLS is the same 4.1.1 commit as in 6.0.3.13. and 14. Say 6.1.1 in two comments
The module's version history said it was built with ESP-IDF 6.0.3, and it now says 6.1.1. The comment on the Wi-Fi password-failure reason codes (
WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT,_AUTH_FAIL,_HANDSHAKE_TIMEOUT) now names 6.1.1: they keep the values 15, 202 and 204. Comments only.15. Leave the Wi-Fi OWE soft-AP support out of the control module
ESP-IDF 6.1.1 added
CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_SOFTAP, which defaults to y. 6.0.3 had no such option and the module only runs as a station, so it is set to n. That keeps the 6.0.3 behaviour, does not link soft-AP code, and saves about 1.5 KB of flash.Not in this PR:
-O2The other modules in the series build with
-O2; this one does not. It does not build at-O2as it stands:jtag.cfails-Werror=maybe-uninitialized(user_id), and the recovery hotspotstrncpycalls intossid[33]andpw[68]failstringop-truncation. Thejtag.cbit-bang also depends on call timing that its own comment calls proven, it runs only during a Wi-Fi recovery, and I cannot exercise that safely. So I left it out.Memory
From
idf.py size(the 6.1.1 row is read from the linker map of the head):u64ctrl.binis 1,086,944 bytes (1,072,656 on 6.0.3); 65% of the 3 MB partition is free. The 16 KB IRAM block stays full, as before. The 6.1.1 build prints 5 CMake warnings and some Kconfig deprecation notes from ESP-IDF itself; the module's own code adds none.TLS under mbedTLS 4
Key exchange. mbedTLS 4 has no static-RSA or static-ECDH key exchange, so the module's TLS 1.2 now offers ECDHE only. TLS 1.3 stays off, as on master; enabling it, along with DTLS, is left to the TLS offload work that builds on this port.
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=yis still insdkconfigbut no longer does anything.The built-in servers. On 23 October,
openssl s_clientshowed that bothrecovery.ultimate64.comandultimate64.ddns.net:So the built-in servers are unaffected. A recovery server set from the menu has to offer ECDHE.
Certificates. They are now checked through the certificate bundle's trusted-certificate callback. Both servers' chains end at ISRG Root X1/X2, and both roots are in the custom bundle (
ca/cacert.pem).Tests
The new host test.
make host_tests_idf6is a new target, and a new CI step runs it in the ESP-IDF 6 image:recoverymanifest, 102 checks.make host_tests, which CI runs in ESP-IDF 5.3.1, because it links TF-PSA-Crypto from ESP-IDF 6.Cases, named by the error they expect:
A valid manifest is accepted.
The wrong key, a tampered manifest, and a manifest correctly signed by an RSA key (
rsa512.manifest, new) are refused as a bad signature.These are refused as a hash mismatch:
These are reported as a crypto failure, never as a bad signature or a match:
The test forces these with
--wraponpsa_crypto_init,psa_hash_updateandpsa_hash_finish, so the product code carries no test hook.The shipped keys (commit 6).
Written first. The tests are red against the unported code, because
recovery_verify.ccannot includembedtls/sha256.hunder ESP-IDF 6.Mutants. I also mutated the product code.
recovery_verify.c. The survivor keeps the oldMBEDTLS_USE_PSA_CRYPTOguard aroundpsa_crypto_init(). It is equivalent, because that macro is still defined.Per commit. Each of the first 6 commits builds u64ctrl under ESP-IDF 6.0.3 and passes
make host_testsin the riscv build image. The ESP-IDF 5.3.1 image still refuses to configure u64ctrl, by design (the version check). For commits 7-11, the head and commits 8 and 11 were built; commits 9 and 10 only change two threshold lines and onesdkconfigline, and were not built one by one. I did not runmake host_testson them (no code under test changed). The only compiler warning is the old unused variable_errinrpc_dispatch.c.The two new CI commands. I ran them locally exactly as written in
build.yml, inespressif/idf:v6.1.1under amd64 emulation, at the head:idf.py build: OK, andsdkconfigis unchanged by the build.The same two ran on 6.0.3 for commits 1 to 11 with the same results.
Local builds
After this PR, u64ctrl needs ESP-IDF 6 while raw_u64 and raw_c3 still need 5.3.1.
make(all),make esp32andmake cleancannot complete with a singleIDF_PATH.make u64iineeds an ESP-IDF 6.make u64andmake u2plneed 5.3.1.software/u64ctrl/README.mdshows (the same container command CI uses), then runmake u64ii_no_esp.build.shrunsmake u64iiinghcr.io/gideonz/riscv, which has ESP-IDF 5.3.1, so after this PR it stops at u64ctrl's version check and cannot build u64ii. I did not change it. I can send a follow-up PR that moves the Dockerfile andbuild.shto ESP-IDF 6 if you want one.Overlaps with other PRs:
build.ymlandREADME.txtchange once per step instead of conflicting.mbedtls_ssl_conf_rng(), which mbedTLS 4 removed, so Add authenticated HTTPS to the existing target 6 HTTP interface #936 would need porting after this PR.Host tests on the 6.1.1 head (CI image, as
build.ymlruns them):make host_tests_idf6RC=0 (102 checks, 0 failed),tests/lib/u64ctrl_ca_test.pyOK, lint OK. Theu64ctrlmodule build finishes with RC=0.make host_testsruns in the riscv image (ESP-IDF 5.3.1), which the move to 6.1.1 does not touch; it passed on the 6.0.3 head (2026-10-30).Tested on hardware
ESP-IDF 6.1.1
Bench image. One work-in-progress build (git hash
1a0778724) carries this PR together with the stack above it (#997, #1095, #953), #835 and test-only fixes that belong to no PR here. It was installed on the C64U with the updater, the ROMs were written back, and the configuration was reset. The build before it (git hash59672246e) had the 6.0.3 module; the 6.0.3 figures in brackets are from it, on the same device and the same bench network. The 6.1.1 image also carries the #1095 changes made since that build.The move from 6.0.3 to 6.1.1 is a toolchain change, so again there is no red/green pair. The closed Wi-Fi library changed between the two versions, so the suites and the soak were repeated. Hardware: C64 Ultimate (C64U), firmware 3.15a, core 1.50.
run-tests --e2e --profile quickinput,browser-cbm-names,usb-mouse) failed because an object was resting on a key; with it removed they pass 3 of 3, and they also passed inside the standard profile below.run-tests --e2e --profile standardobservability).uci-net-target, deep profileWiFi throughput, ESP-IDF 6.0.3 module against 6.1.1, one run each, recorded, not a speed claim:
TLS on this module is #1095; the TLS results of this image are there.
Earlier round, ESP-IDF 6.0.3
Bench image. One work-in-progress build (git hash
fdb59b059) carried the whole stack for Round B: this PR and every PR below it in the stack, the WiFi PR (#1041), #953 and #997, plus test-only commits that belong to no PR here (the lwIP pbuf pool change that fixesSEND ERROR: 12, #1035, and #835). All six PR heads are ancestors of that commit, so the patches of each PR are the bench's patches; the WiFi PR was rebased onto this stack for the build andgit range-diffshows only conflict resolutions and module version numbers against its own branch. The hardware rows below therefore test this PR together with the others, and say so. Module version numbers are placeholders for the maintainer to assign at merge.Before the flash. Each device was on the previous work-in-progress build (git hash
492c587e9): ESP-IDF 5.3.1 modules, no TLS commands, noGET_RANDOM. After the flash the config was reset and only the settings each run needs were set.This PR is a toolchain move, so there is no red/green pair for it: the check is that the same steps and suites give the same results on the ESP-IDF 6 module as on the 5.3.1 one. The module in this PR is
u64ctrl, so the machine is the C64 Ultimate (C64U): firmware 3.15a, core 1.50. The C64U ran the module of this PR together with the WiFi PR and #953 (both also changeu64ctrl); the rows do not separate them.run-tests --e2e --profile quickuci-net-target, deep profileSEND ERROR: 12. The image carries the lwIP change that fixes that error, so this row partly measures the lwIP change, not this PR.WiFi throughput, ESP-IDF 5.3.1 module (before, same day, same position) against this stack (after), one run each, recorded, not a speed claim:
The earlier measurements on this PR's previous heads (the 27 October runs of commits 7-11, with ping, REST, FTP and
writememfigures) were on a different day and set of images; they are superseded by the table above and are not repeated here.No result is claimed for:
CMD_GET_TIME, now on picolibc): nothing in the Ultimate calls it, and the test harness cannot read it.u64ctrlandtarget/u64iias the C64U).Written with Claude Opus 5.5 in Claude Code.