Skip to content

Commit

Permalink
feat(esp32c5): Add UART stub support
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinKondrashov authored and Dzarda7 committed Jun 28, 2024
1 parent 3b32384 commit b199534
Show file tree
Hide file tree
Showing 14 changed files with 784 additions and 24 deletions.
33 changes: 31 additions & 2 deletions esptool/targets/esp32c5.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .esp32c6 import ESP32C6ROM
from ..loader import ESPLoader
from ..reset import HardReset
from ..util import FatalError


class ESP32C5ROM(ESP32C6ROM):
Expand All @@ -29,7 +30,7 @@ class ESP32C5ROM(ESP32C6ROM):
UARTDEV_BUF_NO = 0x4085F51C # Variable in ROM .bss which indicates the port in use

# Magic value for ESP32C5
CHIP_DETECT_MAGIC_VALUE = [0x8082C5DC]
CHIP_DETECT_MAGIC_VALUE = [0x1101406F]

FLASH_FREQUENCY = {
"80m": 0xF,
Expand Down Expand Up @@ -119,5 +120,33 @@ def change_baud(self, baud):
else:
ESPLoader.change_baud(self, baud)

def check_spi_connection(self, spi_connection):
if not set(spi_connection).issubset(set(range(0, 29))):
raise FatalError("SPI Pin numbers must be in the range 0-28.")
if any([v for v in spi_connection if v in [13, 14]]):
print(
"WARNING: GPIO pins 13 and 14 are used by USB-Serial/JTAG, "
"consider using other pins for SPI flash connection."
)


class ESP32C5StubLoader(ESP32C5ROM):
"""Access class for ESP32C5 stub loader, runs on top of ROM.
(Basically the same as ESP32StubLoader, but different base class.
Can possibly be made into a mixin.)
"""

FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c
STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM
IS_STUB = True

def __init__(self, rom_loader):
self.secure_download_mode = rom_loader.secure_download_mode
self._port = rom_loader._port
self._trace_enabled = rom_loader._trace_enabled
self.cache = rom_loader.cache
self.flush_input() # resets _slip_reader


# TODO: [ESP32C5] ESPTOOL-825, IDF-8631 support stub flasher
ESP32C5ROM.STUB_CLASS = ESP32C5StubLoader
8 changes: 8 additions & 0 deletions esptool/targets/stub_flasher/stub_flasher_32c5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"entry": 1082131910,
"text": "ARG3BwBgTsaDqYcASsg3CYRAJspSxAbOIsy3BABgfVoTCQkAwEwTdPQ/DeDyQGJEI6g0AUJJ0kSySSJKBWGCgIhAgycJABN19Q+Cl30U4xlE/8m/EwcADJRBqodjGOUAhUeFxiOgBQB5VYKABUdjh+YACUZjjcYAfVWCgEIFEwewDUGFY5XnAolHnMH1t5MGwA1jFtUAmMETBQAMgoCTBtANfVVjldcAmMETBbANgoC3NYVAQRGThQW6BsZhP2NFBQa3N4VAk4eHsQOnBwgD1kcIE3X1D5MGFgDCBsGCI5LXCDKXIwCnAAPXRwiRZ5OHBwRjHvcCN7eEQBMHh7GhZ7qXA6YHCLf2hEC3N4VAk4eHsZOGhrVjH+YAI6bHCCOg1wgjkgcIIaD5V+MG9fyyQEEBgoAjptcII6DnCN23NzcAYHxLnYv1/zcnAGB8S52L9f+CgEERBsbdN7c3AGAjpgcCNwcACJjDmEN9/8hXskATRfX/BYlBAYKAQREGxtk/fd03BwBAtzcAYJjDNzcAYBxD/f+yQEEBgoBBESLEN4SEQJMHxABKwAOpBwEGxibCYwoJBEU3OcW9RxMExACBRGPWJwEERL2Ik7QUAH03hT8cRDcGgAATl8cAmeA3BgABt/b/AHWPtzYAYNjCkMKYQn3/QUeR4AVHMwnpQLqXIygkARzEskAiRJJEAklBAYKAQREGxhMHAAxjEOUCEwWwDZcAgP/ngIDjEwXADbJAQQEXA4D/ZwCD4hMHsA3jGOX+lwCA/+eAgOETBdANxbdBESLEJsIGxiqEswS1AGMXlACyQCJEkkRBAYKAA0UEAAUERTfttxMFAAwXA4D/ZwAD3jVxJstOx/1yhWn9dCLNSslSxVbDBs+ThIT6FpGThwkHppcYCLOE5wAqiSaFLoSXAID/54CgTpOHCQcYCAVqupezikdBMeQFZ311kwWF+pMHBwcTBY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glcDp4iwg6UNAB2MHY8+nLJXI6TosKqLvpUjoL0Ak4fKAJ2NAcWhZ2OW9QBahV04I6BtAQnE3ESZw+NAcPlj3wsAkwdwDIW/hUu3PYVAt4yEQJONjbqTjMwA6b/jlQue3ETjggeekweADLG3g6eLAOObB5wBRZfwf//ngCA5CWUTBQVxl/B//+eAwDSX8H//54DAOU26A6TLAOMGBJoBRZfwf//ngIA2EwWAPpfwf//ngEAyApRBuvZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgAAA",
"text_start": 1082130432,
"data": "DACEQO4IgEA6CYBAkgmAQGAKgEDMCoBAegqAQLYHgEAcCoBAXAqAQKYJgEBmB4BA2gmAQGYHgEDICIBADAmAQDoJgECSCYBA2giAQCAIgEBQCIBA1giAQCQNgEA6CYBA5AuAQNgMgECyBoBAAg2AQLIGgECyBoBAsgaAQLIGgECyBoBAsgaAQLIGgECyBoBAgAuAQLIGgEAADIBA2AyAQA==",
"data_start": 1082469288,
"bss_start": 1082392576
}
8 changes: 4 additions & 4 deletions esptool/targets/stub_flasher/stub_flasher_32c5beta3.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"entry": 1082132164,
"text": "QREixCbCBsa39wBgEUc3BIRA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJhEAmylLEBs4izLcEAGB9WhMJCQDATBN09D8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hUBBEZOFhboGxmE/Y0UFBrc3hUCThweyA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4RAEwcHsqFnupcDpgcIt/aE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d2NwRWpOm287/AP2oG3A8Q7AIPHKwATjIsBIgRdjNxEQRTF45FHhUtj/ocIkweQDNzIebQDpw0AItAFSLOH7EA+1oMnirBjc/QADUhCxjrE7/CP1SJHMkg3hYRA4oV8EJOGygAQEBMFRQKX8H//54AASje3hECTCMcAglcDp4iwg6UNAB2MHY8+nLJXI6TosKqLvpUjoL0Ak4fKAJ2NAcWhZ2OW9QBahV04I6BtAQnE3ESZw+NAcPlj3wsAkwdwDIW/hUu3PYVAt4yEQJONjbqTjMwA6b/jlQue3ETjggeekweADLG3g6eLAOObB5wBRZfwf//ngCA5CWUTBQVxl/B//+eAwDSX8H//54DAOU26A6TLAOMGBJoBRZfwf//ngIA2EwWAPpfwf//ngEAyApRBuvZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgAAA",
"text_start": 1082130432,
"data": "FACEQGwKgEC8CoBAFAuAQOILgEBODIBA/AuAQDgJgECeC4BA3guAQCgLgEDoCIBAXAuAQOgIgEBGCoBAjAqAQLwKgEAUC4BAWAqAQJwJgEDMCYBAVAqAQKYOgEC8CoBAZg2AQF4OgEAoCIBAhg6AQCgIgEAoCIBAKAiAQCgIgEAoCIBAKAiAQCgIgEAoCIBAAg2AQCgIgECEDYBAXg6AQA==",
"data_start": 1082469296,
"data": "DACEQO4IgEA6CYBAkgmAQGAKgEDMCoBAegqAQLYHgEAcCoBAXAqAQKYJgEBmB4BA2gmAQGYHgEDICIBADAmAQDoJgECSCYBA2giAQCAIgEBQCIBA1giAQCQNgEA6CYBA5AuAQNgMgECyBoBAAg2AQLIGgECyBoBAsgaAQLIGgECyBoBAsgaAQLIGgECyBoBAgAuAQLIGgEAADIBA2AyAQA==",
"data_start": 1082469288,
"bss_start": 1082392576
}
6 changes: 6 additions & 0 deletions flasher_stub/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ STUB_ELF_32H2_BETA_1 = $(BUILD_DIR)/$(STUB)_32h2beta1.elf
STUB_ELF_32H2_BETA_2 = $(BUILD_DIR)/$(STUB)_32h2beta2.elf
STUB_ELF_32C2 = $(BUILD_DIR)/$(STUB)_32c2.elf
STUB_ELF_32C6 = $(BUILD_DIR)/$(STUB)_32c6.elf
STUB_ELF_32C5 = $(BUILD_DIR)/$(STUB)_32c5.elf
STUB_ELF_32C5_BETA_3 = $(BUILD_DIR)/$(STUB)_32c5beta3.elf
STUB_ELF_32H2 = $(BUILD_DIR)/$(STUB)_32h2.elf
STUB_ELF_32P4 = $(BUILD_DIR)/$(STUB)_32p4.elf
Expand All @@ -94,6 +95,7 @@ STUBS_ELF += \
$(STUB_ELF_32H2_BETA_2) \
$(STUB_ELF_32C2) \
$(STUB_ELF_32C6) \
$(STUB_ELF_32C5) \
$(STUB_ELF_32C5_BETA_3) \
$(STUB_ELF_32H2) \
$(STUB_ELF_32P4)
Expand Down Expand Up @@ -171,6 +173,10 @@ $(STUB_ELF_32C6): $(SRCS) $(BUILD_DIR) ld/stub_32c6.ld
@echo " CC(32C6) $^ -> $@"
$(Q) $(CROSS_ESPRISCV32)gcc $(CFLAGS_ESPRISCV32) -DESP32C6=1 -Tstub_32c6.ld -Wl,-Map=$(@:.elf=.map) -o $@ $(filter %.c, $^) $(LDLIBS)

$(STUB_ELF_32C5): $(SRCS) $(BUILD_DIR) ld/stub_32c5.ld
@echo " CC(32C5) $^ -> $@"
$(Q) $(CROSS_ESPRISCV32)gcc $(CFLAGS_ESPRISCV32) -DESP32C5=1 -Tstub_32c5.ld -Wl,-Map=$(@:.elf=.map) -o $@ $(filter %.c, $^) $(LDLIBS)

$(STUB_ELF_32C5_BETA_3): $(SRCS) $(BUILD_DIR) ld/stub_32c5_beta_3.ld
@echo " CC(32C5BETA3) $^ -> $@"
$(Q) $(CROSS_ESPRISCV32)gcc $(CFLAGS_ESPRISCV32) -DESP32C5BETA3=1 -Tstub_32c5_beta_3.ld -Wl,-Map=$(@:.elf=.map) -o $@ $(filter %.c, $^) $(LDLIBS)
Expand Down
3 changes: 1 addition & 2 deletions flasher_stub/compare_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ def diff(path_to_new, path_to_old):
same = True
for chip in esptool.CHIP_LIST:
print("Comparing {} stub: ".format(chip), end="")
# TODO: [ESP32C5] ESPTOOL-825 remove when supported stub flasher
# TODO: [ESP32C61] IDF-9241 remove when supported stub flasher
if chip in ["esp32c5", "esp32c61"]:
if chip in ["esp32c61"]:
print(f"{chip} has not supported stub yet, skipping...")
continue

Expand Down
4 changes: 2 additions & 2 deletions flasher_stub/include/rom_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ int uart_rx_one_char(uint8_t *ch);
uint8_t uart_rx_one_char_block();
int uart_tx_one_char(char ch);

#if ESP32C6 || ESP32H2 || ESP32C5BETA3 || ESP32P4
#if ESP32C6 || ESP32H2 || ESP32C5 || ESP32C5BETA3 || ESP32P4
/* uart_tx_one_char doesn't send data to USB device serial, needs to be replaced */
int uart_tx_one_char2(char ch);
#define uart_tx_one_char(ch) uart_tx_one_char2(ch)
#endif // ESP32C6 || ESP32H2 || ESP32C5BETA3 || ESP32P4
#endif // ESP32C6 || ESP32H2 || ESP32C5 || ESP32C5BETA3 || ESP32P4

void uart_div_modify(uint32_t uart_no, uint32_t baud_div);

Expand Down
Loading

0 comments on commit b199534

Please sign in to comment.