37634 Commits

Author SHA1 Message Date
evan 09616c2093 fix(esp32c3): emulate GPIO interrupts 2026-07-26 15:34:45 -04:00
evan 21de913b7e fix(xteink): restore fast panel refresh timing 2026-07-26 15:29:29 -04:00
evan 4cfbdfbd15 feat(xteink): expose the panel frame generation over QOM
The wasm front end already tracked panel refreshes; make the counter
unconditional and alias it onto the machine so native front ends can
redraw on refresh instead of on a timer.
2026-07-26 11:18:28 -04:00
evan d613b079ef feat(xteink): count guest ADC reads per channel
Host tooling needs to know when the guest has actually sampled a button,
since the firmware only polls the resistor ladder between e-ink refreshes.
2026-07-26 11:18:28 -04:00
evan 55d801ca9e refactor(xteink): drop no-op JTAG interrupt clear handling 2026-07-26 09:27:15 -04:00
evan 5721bd8102 feat(xteink): wire USB serial JTAG interrupts
Report SOF and serial-in-empty as always pending and route the peripheral
IRQ through the interrupt matrix so the ESP-IDF console driver progresses.
Merge emulator stdout into serial.log so crash output lands in one place.
2026-07-26 09:21:43 -04:00
evan 5906b67287 feat(xteink): add interactive emulator mode 2026-07-24 18:56:11 -04:00
evan fe35cb68d6 feat(xteink): add ESP32-C3 Wi-Fi emulation with qemu AP
Ports the ESP32 Wi-Fi emulation (esp32c3_wifi, esp32_wifi_ap, esp32_wlan_*)
from the lcgamboa/PICSimLab QEMU fork and integrates it behind the
esp32c3_wifi NIC model, plus the supporting radio peripherals
(ANA/PHYA/FE/PWR manager).

- Exposes an open SSID 'qemu' bridged to the host via QEMU user-mode NAT
  (libslirp, now enabled in the native build).
- Adds ESP-IDF 5.5 compatibility fixes: channel resolution from the
  beacon DS Parameter Set IE / AP lookup, persistent SYSCON register
  backing (phy_module_has_clock_bits), DMA inlink/outlink descriptor
  mirroring, RX descriptor ring reset on item.next==0, and descriptor
  ownership/length semantics.
- xteink-emu now starts with -nic user,model=esp32c3_wifi and synthesizes
  an eFuse image with a fixed guest MAC.

Verified against a stock Arduino-ESP32 sketch: scans, finds 'qemu',
associates, gets DHCP 192.168.4.15, and completes an outbound TCP
connection. Unmodified CrossPoint firmware still needs the power-button
hold during boot (tracked separately).
2026-07-24 16:21:12 -04:00
evan cbeba3fbe9 fix(display): classify X3 grayscale from loaded LUTs 2026-07-21 11:42:04 -04:00
evan ede6e5b9f3 Render X3 reader grayscale correctly (persistence + 4-level overlay)
The reader draws a crisp BW page, then a 4-level grayscale antialiasing
pass with inverted plane polarity (white = level 0 = both planes clear)
and near-empty planes. The old model replaced the whole frame with those
planes, wiping the page to an inverted muddle.

Model it as e-ink actually behaves: keep a persistent surface, detect
grayscale vs BW by DTM2's set-fraction (background is the white
majority), and in grayscale treat level 0 as no-drive (keep pixel) so
only the sparse antialiased edges repaint over the retained BW page. BW
refreshes still repaint every pixel. Reader text now renders sharp.
2026-07-21 10:27:17 -04:00
evan 3623a36693 Fix SPI-SD write-token timing and CMD13 response
ssi-sd now enters token mode as it returns the final R1 byte, so the
write-data token that immediately follows is not discarded. SPI CMD13
returns the internal sd_r1 response (upstream fix) instead of sd_r2_s,
which the adapter converts to the two-byte SPI R2 status; this stops the
repeated "Unexpected response to cmd 13" loop on guest status polls.

Drops the experimental store-TB TCI forcing and sd-watch OOB logging now
that the raw FAT32 image path is stable.
2026-07-21 07:42:41 -04:00
xteink 543cebcb3a WIP: SD write debugging (store-TB TCI + sd-watch) and vvfat/ssi-sd fixes
Diagnostic: routes store-containing TBs through TCI and logs out-of-bounds
guest stores to isolate the SdSpiCard corruption. Also carries the FAT32
vvfat root/cluster fixes and ssi-sd command framing. Squash/split before
upstreaming.
2026-07-20 17:48:33 -04:00
evan 64d7668b49 Fix browser TB compilation and ISSI flash commands 2026-07-20 10:17:58 -04:00
evan 2ab8860a24 Add SFDP data for IS25LP128 flash 2026-07-20 09:36:15 -04:00
evan c1ee841e58 Generalize m25p80 Read-ID 0x90/0xAB beyond SST chips 2026-07-20 09:00:24 -04:00
evan ce99303135 Fix esp_sha hash callback signature mismatch for emscripten 2026-07-20 07:45:14 -04:00
evan cddd964c57 Guard esp32c3 cache XTS-AES use when gcrypt absent 2026-07-20 07:25:59 -04:00
evan b0bce6c486 Add xteink browser bridge 2026-07-20 00:20:51 -04:00
evan d58495104a Declare minimal xteink device dependencies 2026-07-19 22:06:20 -04:00
evan c4227568de Add xteink machine for wasm build 2026-07-19 21:56:40 -04:00
Omar Chebib 40edccac41 hw/riscv: fix interrupts being lost or delayed when MIE=0 on the ESP32-C3 2026-04-17 10:15:24 +08:00
159336 at Massey 33cc9a8740 Fix gdma not checking ownership and clearing the owner bit correctly.
This didn't matter in the past but recent version of the idf check that the bit has been cleared in gdma_link_mount_buffers()
2026-02-03 13:53:43 +08:00
Throows ab1bfa960a hw/xtensa/esp32s3: add sdmmc peripheral 2025-09-13 18:16:56 +02:00
Yuan Yu 18a7345ed4 hw/net/can: remove interrupt handling from ESP32 TWAI state 2025-08-27 14:55:14 +08:00
Omar Chebib 30f83141bb hw/misc: implement SPI data transfers for the PSRAM in both QPI and OPI. 2025-08-15 09:41:13 +08:00
Yuan Yu 8066b0c9d4 hw/net/can: fix CAN bus connection logic in esp32_twai.c to make sure to check if canbus is valid before connecting 2025-08-14 12:10:41 +08:00
Yuan Yu 38f153e737 hw/riscv/esp32s3: added the TWAI peripheral to the ESP32-S3 machine state and updated the machine initialization function to realize and connect the TWAI device 2025-07-31 14:42:57 +08:00
Yuan Yu d5db88447b hw/net/can: add ESP32-S3 TWAI peripheral emulation, which
inherits from the ESP32 TWAI implementation.
2025-07-31 14:42:57 +08:00
Yuan Yu b5b69aea8a hw/riscv/esp32c3: added the TWAI peripheral to the ESP32-C3 machine state and updated the machine initialization function to realize and connect the TWAI device 2025-07-31 14:42:57 +08:00
Yuan Yu 6e13d72071 hw/net/can: add ESP32-C3 TWAI peripheral emulation
Add emulation support for the ESP32-C3 TWAI (CAN bus) peripheral, which
inherits from the ESP32 TWAI implementation.
2025-07-31 14:42:57 +08:00
Yuan Yu dcf57b8d44 hw/xtensa: add CAN peripheral to ESP32 2025-07-31 14:36:30 +08:00
Yuan Yu f12f35d56e hw/net/can: add emulation of SJA1000-based CAN controller for ESP32 series of chips 2025-07-31 14:36:30 +08:00
Omar Chebib c46f68cfd3 hw/timer: modify the ESP32-C3 TimerGroup driver to override the new generic one 2025-06-24 14:55:53 +08:00
Omar Chebib 2b7742774a hw/timer: implement an ESP32-S3 TimerGroup that overrides the new generic one 2025-06-24 14:55:53 +08:00
Omar Chebib 57330b48e4 hw/timer: implement a generic TimerGoup controller for newer Espressif targets 2025-06-24 14:55:53 +08:00
Omar Chebib 248b410174 hw/misc: optimize flash decryption speed on the ESP32 2025-05-13 17:30:32 +08:00
Omar Chebib 1ede4bd3d9 riscv: fix a bug in ESP CPU that resulted in some interrupts being dismissed 2025-04-17 10:02:17 +08:00
Omar Chebib fd97b40f5a hw/timer: fix several bug related to timings, both in cycle count and TimerGroup for the ESP32-C3 2025-04-17 10:02:17 +08:00
Omar Chebib 16a219aac8 misc/ssi_psram: refactor PSRAM to use a state machine
The emulated PSRAM now internally uses a state machine, making is more sturdy
and resilient to dummy cycles.

* Fixes #57
2025-04-03 11:56:10 +08:00
Omar Chebib 9607e26254 esp32: refactor drivers to use three-stage reset instead of legacy reset 2025-03-25 17:42:45 +08:00
Omar Chebib e0bfd3961f esp32s3: refactor drivers to use three-stage reset instead of legacy reset 2025-03-25 17:24:12 +08:00
Omar Chebib 95c74f43e2 esp: refactor Espressif generic drivers to use three-stage reset instead of legacy reset 2025-03-25 16:41:56 +08:00
Omar Chebib 17207a3c3f esp32c3: refactor drivers to use three-stage reset instead of legacy reset 2025-03-25 15:36:04 +08:00
Omar Chebib ccdda32084 hw/timer: fix reset/default value for register SYSTIMER_CONF on ESP targets
* Fixes https://github.com/espressif/qemu/issues/120
2025-03-10 18:06:28 +08:00
Dmitry Yakovlev 7591824ec4 hw/xtensa: implement ESP32-S3 machine
This also includes the ESP32-S3 BIOS (ROM bootloader)
2025-02-28 16:39:03 +01:00
Dmitry Yakovlev c0cce1fc74 hw/i2c: add I2C to ESP32-S3
ESP32 implementation is used as a stub.
2025-02-28 16:39:03 +01:00
Dmitry Yakovlev 0c1bf393dc hw/misc: implement ESP32-S3 XTS-AES peripheral
Co-authored-by: Harshal Patil <harshal.patil@espressif.com>
2025-02-28 16:39:03 +01:00
Dmitry Yakovlev bd9cb721a3 hw/misc: implement ESP32-S3 Digital Signature
Co-authored-by: Harshal Patil <harshal.patil@espressif.com>
2025-02-28 16:39:03 +01:00
Dmitry Yakovlev e67f694323 hw/misc: implement ESP32-S3 RSA
Co-authored-by: Harshal Patil <harshal.patil@espressif.com>
2025-02-28 16:39:03 +01:00
harshal.patil 3629646ec5 hw/misc: Implement ESP32-S3 AES 2025-02-28 16:39:03 +01:00