Merge branch 'feature/esp32c5_mp_gpio_support_v5.3' into 'release/v5.3'

Feature/esp32c5 mp gpio support (v5.3)

See merge request espressif/esp-idf!30884
This commit is contained in:
Michael (XIAO Xufeng)
2024-06-12 00:51:06 +08:00
54 changed files with 504 additions and 4534 deletions
+8 -9
View File
@@ -6,6 +6,7 @@
#include <string.h>
#include "soc/uart_reg.h"
#include "soc/gpio_periph.h"
#include "soc/uart_pins.h"
#include "driver/gpio.h"
#include "hal/gpio_hal.h"
#include "esp_core_dump_types.h"
@@ -147,17 +148,15 @@ static esp_err_t esp_core_dump_uart_hw_init(void)
uint32_t tm_cur = 0;
int ch = 0;
// TODO: move chip dependent code to portable part
gpio_hal_context_t gpio_hal = {
.dev = GPIO_HAL_GET_HW(GPIO_PORT_0)
};
//Make sure txd/rxd are enabled
// use direct reg access instead of gpio_pullup_dis which can cause exception when flash cache is disabled
REG_CLR_BIT(GPIO_PIN_REG_1, FUN_PU);
#if CONFIG_IDF_TARGET_ESP32P4
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_U_PAD_GPIO38, FUNC_GPIO38_UART0_RXD_PAD);
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_U_PAD_GPIO37, FUNC_GPIO37_UART0_TXD_PAD);
#else
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD_U0RXD);
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD_U0TXD);
#endif
REG_CLR_BIT(GPIO_PIN_REG_1, FUN_PU); //TODO: IDF-9948
gpio_hal_func_sel(&gpio_hal, U0RXD_GPIO_NUM, U0RXD_MUX_FUNC);
gpio_hal_func_sel(&gpio_hal, U0TXD_GPIO_NUM, U0TXD_MUX_FUNC);
ESP_COREDUMP_LOGI("Press Enter to print core dump to UART...");
const int cpu_ticks_per_ms = esp_clk_cpu_freq() / 1000;
tm_end = esp_cpu_get_cycle_count() / cpu_ticks_per_ms + CONFIG_ESP_COREDUMP_UART_DELAY;