From aba0f12e9279febc50e45d99caa6c98bc85322ee Mon Sep 17 00:00:00 2001 From: Alex Duchesne Date: Tue, 27 Aug 2024 17:58:45 -0400 Subject: [PATCH] Updated patches for esp-idf 5.0 --- Dockerfile | 4 ++-- ... 4.x).diff => panic-hook (esp-idf 4).diff} | 0 .../patches/panic-hook (esp-idf 5) copy.diff | 24 +++++++++++++++++++ ... 4.x).diff => sdcard-fix (esp-idf 4).diff} | 0 tools/patches/sdcard-fix (esp-idf 5).diff | 12 ++++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) rename tools/patches/{panic-hook (esp-idf 4.x).diff => panic-hook (esp-idf 4).diff} (100%) create mode 100644 tools/patches/panic-hook (esp-idf 5) copy.diff rename tools/patches/{sdcard-fix (esp-idf 4.x).diff => sdcard-fix (esp-idf 4).diff} (100%) create mode 100644 tools/patches/sdcard-fix (esp-idf 5).diff diff --git a/Dockerfile b/Dockerfile index 8d9c6dde9..dae915337 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,8 @@ ADD . /app # Apply patches RUN cd /opt/esp/idf && \ - patch --ignore-whitespace -p1 -i "/app/tools/patches/panic-hook (esp-idf 4.x).diff" && \ - patch --ignore-whitespace -p1 -i "/app/tools/patches/sdcard-fix (esp-idf 4.x).diff" + patch --ignore-whitespace -p1 -i "/app/tools/patches/panic-hook (esp-idf 5).diff" && \ + patch --ignore-whitespace -p1 -i "/app/tools/patches/sdcard-fix (esp-idf 5).diff" # Build SHELL ["/bin/bash", "-c"] diff --git a/tools/patches/panic-hook (esp-idf 4.x).diff b/tools/patches/panic-hook (esp-idf 4).diff similarity index 100% rename from tools/patches/panic-hook (esp-idf 4.x).diff rename to tools/patches/panic-hook (esp-idf 4).diff diff --git a/tools/patches/panic-hook (esp-idf 5) copy.diff b/tools/patches/panic-hook (esp-idf 5) copy.diff new file mode 100644 index 000000000..f3a41df36 --- /dev/null +++ b/tools/patches/panic-hook (esp-idf 5) copy.diff @@ -0,0 +1,24 @@ +diff --git a/components/esp_system/panic.c b/components/esp_system/panic.c +index f320c28dca..665aea98a3 100644 +--- a/components/esp_system/panic.c ++++ b/components/esp_system/panic.c +@@ -66,6 +66,11 @@ static wdt_hal_context_t rtc_wdt_ctx = {.inst = WDT_RWDT, .rwdt_dev = &RTCCNTL}; + + #if !CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT + ++void __attribute__((weak)) esp_panic_putchar_hook(char c) ++{ ++ // nothing ++} ++ + #if CONFIG_ESP_CONSOLE_UART + static uart_hal_context_t s_panic_uart = { .dev = CONFIG_ESP_CONSOLE_UART_NUM == 0 ? &UART0 :&UART1 }; + +@@ -118,6 +123,7 @@ void panic_print_char(const char c) + #if CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG || CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG + panic_print_char_usb_serial_jtag(c); + #endif ++ esp_panic_putchar_hook(c); + } + + void panic_print_str(const char *str) diff --git a/tools/patches/sdcard-fix (esp-idf 4.x).diff b/tools/patches/sdcard-fix (esp-idf 4).diff similarity index 100% rename from tools/patches/sdcard-fix (esp-idf 4.x).diff rename to tools/patches/sdcard-fix (esp-idf 4).diff diff --git a/tools/patches/sdcard-fix (esp-idf 5).diff b/tools/patches/sdcard-fix (esp-idf 5).diff new file mode 100644 index 000000000..bdc42ba04 --- /dev/null +++ b/tools/patches/sdcard-fix (esp-idf 5).diff @@ -0,0 +1,12 @@ +diff --git a/components/driver/sdspi_host.c b/components/driver/sdspi_host.c +index 9a80188..4f35fbb 100644 +--- a/components/driver/sdspi_host.c ++++ b/components/driver/sdspi_host.c +@@ -458,6 +458,7 @@ esp_err_t sdspi_host_start_command(sdspi_dev_handle_t handle, sdspi_hw_cmd_t *cm + const bool multi_block = flags & SDSPI_CMD_FLAG_MULTI_BLK; + //send stop transmission token only when multi-block write and non-SDIO mode + const bool stop_transmission = multi_block && !(flags & SDSPI_CMD_FLAG_RSP_R5); ++ go_idle_clockout(slot); + if (flags & SDSPI_CMD_FLAG_WRITE) { + ret = start_command_write_blocks(slot, cmd, data, data_size, multi_block, stop_transmission); + } else {