Skip to content

Commit 8bc2c50

Browse files
committed
fix(esp32c3): fix usb-serial detection for rev1.1
1 parent 46a2047 commit 8bc2c50

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

esptool/targets/esp32c3.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,16 @@ class ESP32C3ROM(ESP32ROM):
7373

7474
FLASH_ENCRYPTED_WRITE_ALIGN = 16
7575

76-
UARTDEV_BUF_NO = 0x3FCDF07C # Variable in ROM .bss which indicates the port in use
76+
# Variable in ROM .bss which indicates the port in use
77+
@property
78+
def UARTDEV_BUF_NO(self):
79+
"""Variable .bss.UartDev.buff_uart_no in ROM .bss
80+
which indicates the port in use.
81+
"""
82+
BUF_UART_NO_OFFSET = 24
83+
BSS_UART_DEV_ADDR = 0x3FCDF064 if self.get_chip_revision() < 101 else 0x3FCDF060
84+
return BSS_UART_DEV_ADDR + BUF_UART_NO_OFFSET
85+
7786
UARTDEV_BUF_NO_USB_JTAG_SERIAL = 3 # The above var when USB-JTAG/Serial is used
7887

7988
RTCCNTL_BASE_REG = 0x60008000

0 commit comments

Comments
 (0)