fix(dap): fix the debug clok of esp32/esp32c3 at low speed
This commit is contained in:
parent
ab95979ad8
commit
9d3f7efb40
|
@ -261,6 +261,8 @@ python ./idf.py -p /dev/ttyS5 flash
|
|||
The following example shows a possible way to build:
|
||||
|
||||
```bash
|
||||
# Set build target
|
||||
idf.py set-target esp32
|
||||
# Build
|
||||
idf.py build
|
||||
# Flash
|
||||
|
|
|
@ -412,10 +412,16 @@ static uint32_t DAP_SWJ_Clock(const uint8_t *request, uint8_t *response) {
|
|||
DAP_Data.fast_clock = 0U;
|
||||
SWD_TransferSpeed = kTransfer_GPIO_normal;
|
||||
|
||||
////FIXME: esp32
|
||||
#define CPU_CLOCK_FIXED 80000000
|
||||
|
||||
delay = ((CPU_CLOCK_FIXED/2U) + (clock - 1U)) / clock;
|
||||
#ifdef CONFIG_IDF_TARGET_ESP8266
|
||||
#define BUS_CLOCK_FIXED 80000000
|
||||
#elif defined CONFIG_IDF_TARGET_ESP32
|
||||
#define BUS_CLOCK_FIXED 100000000
|
||||
#elif defined CONFIG_IDF_TARGET_ESP32C3
|
||||
#define BUS_CLOCK_FIXED 80000000
|
||||
#endif
|
||||
|
||||
delay = ((BUS_CLOCK_FIXED/2U) + (clock - 1U)) / clock;
|
||||
if (delay > IO_PORT_WRITE_CYCLES) {
|
||||
delay -= IO_PORT_WRITE_CYCLES;
|
||||
delay = (delay + (DELAY_SLOW_CYCLES - 1U)) / DELAY_SLOW_CYCLES;
|
||||
|
|
Loading…
Reference in New Issue