-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
target/esp32c6: Add LP core debugging support
- Loading branch information
Showing
12 changed files
with
267 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# | ||
# Example OpenOCD configuration file for ESP32-C6 connected via ESP USB Bridge board | ||
# | ||
# For example, OpenOCD can be started for ESP32-C6 debugging on | ||
# | ||
# openocd -f board/esp32c6-lpcore-bridge.cfg | ||
# | ||
|
||
# Source the JTAG interface configuration file | ||
source [find interface/esp_usb_bridge.cfg] | ||
# ESP32C6 chip id defined in the idf esp_chip_model_t | ||
espusbjtag chip_id 13 | ||
# Source the ESP32-C6 configuration file | ||
source [find target/esp32c6-lpcore.cfg] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# | ||
# Example OpenOCD configuration file for ESP32-C6 + LP core connected via builtin USB-JTAG adapter. | ||
# | ||
# For example, OpenOCD can be started for ESP32-C6 + LP core debugging on | ||
# | ||
# openocd -f board/esp32c6-lpcore-builtin.cfg | ||
# | ||
|
||
# Source the JTAG interface configuration file | ||
source [find interface/esp_usb_jtag.cfg] | ||
# Source the ESP32-C6 configuration file | ||
source [find target/esp32c6-lpcore.cfg] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# | ||
# Example OpenOCD configuration file for ESP32-C6 + LP core connected via ESP-Prog. | ||
# | ||
# For example, OpenOCD can be started for ESP32-C6 + LP core debugging on | ||
# | ||
# openocd -f board/esp32c6-lpcore-ftdi.cfg | ||
# | ||
|
||
# Source the JTAG interface configuration file | ||
source [find interface/ftdi/esp32_devkitj_v1.cfg] | ||
# Source the ESP32-C6 configuration file | ||
source [find target/esp32c6-lpcore.cfg] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# | ||
|
||
# Target specific global variables | ||
# config for 2 cores (HP+LP) on 1 TAP in SMP mode | ||
set _ONLYCPU 0x11 | ||
set _ESP_SMP_TARGET 1 | ||
# allow to use SW breakpoints when flash support is disabled | ||
set _NO_FLASH_FORCES_HW_BPS 0 | ||
set ESP_RTOS "hwthread" | ||
set ESP_FLASH_SIZE 0 | ||
|
||
# Source the ESP32-C6 configuration file. | ||
source [find target/esp32c6.cfg] | ||
|
||
# Source some helpers. | ||
source [find mem_helper.tcl] | ||
|
||
set PMU_LP_CPU_PWR0_REG 0x600B017c | ||
set PMU_HP_LP_CPU_COMM_REG 0x600B0184 | ||
set PMU_LP_CPU_PWR1_REG 0x600B0180 | ||
set LPPERI_CPU_REG 0x600B280c | ||
|
||
proc reg_write { ADDR VAL } { | ||
mmw $ADDR $VAL 0 | ||
} | ||
|
||
proc lpcore_reset { } { | ||
global PMU_LP_CPU_PWR0_REG PMU_HP_LP_CPU_COMM_REG PMU_LP_CPU_PWR1_REG LPPERI_CPU_REG | ||
|
||
# PMU.lp_ext.pwr0.slp_stall_en = 1; | ||
# PMU.lp_ext.pwr0.slp_reset_en = 1; | ||
reg_write $PMU_LP_CPU_PWR0_REG 0x60000000 | ||
|
||
# PMU.lp_ext.pwr1.wakeup_en = LP_CORE_LL_WAKEUP_SOURCE_HP_CPU; | ||
# PMU.lp_ext.pwr1.sleep_req = 1; | ||
reg_write $PMU_LP_CPU_PWR1_REG 0x80000001 | ||
|
||
# set up infinite loop code 'j 0x0' at 0x50000080 | ||
mww 0x50000080 0x0000006F | ||
|
||
# PMU.hp_lp_cpu_comm.hp_trigger_lp = 1; | ||
reg_write $PMU_HP_LP_CPU_COMM_REG 0x80000000 | ||
|
||
# Wait for the reset to happen | ||
sleep 10 | ||
poll | ||
|
||
# PMU.lp_ext.pwr0.slp_stall_en = 1; | ||
# PMU.lp_ext.pwr0.slp_reset_en = 0; | ||
reg_write $PMU_LP_CPU_PWR0_REG 0x20000000 | ||
# LPPERI.cpu.lpcore_dbgm_unavaliable = 0; | ||
reg_write $LPPERI_CPU_REG 0x00000000 | ||
} | ||
|
||
$_TARGETNAME_0 configure -event reset-start { | ||
lpcore_reset | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.