Skip to content

Commit

Permalink
Updated patches for esp-idf 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ducalex committed Aug 27, 2024
1 parent 0f8febb commit 1921639
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
File renamed without changes.
24 changes: 24 additions & 0 deletions tools/patches/panic-hook (esp-idf 5).diff
Original file line number Diff line number Diff line change
@@ -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)
File renamed without changes.
12 changes: 12 additions & 0 deletions tools/patches/sdcard-fix (esp-idf 5).diff
Original file line number Diff line number Diff line change
@@ -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 {

0 comments on commit 1921639

Please sign in to comment.