File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -148,13 +148,13 @@ class HardReset(ResetStrategy):
148
148
Can be used to reset out of the bootloader or to restart a running app.
149
149
"""
150
150
151
- def __init__ (self , port , uses_usb_otg = False ):
151
+ def __init__ (self , port , uses_usb = False ):
152
152
super ().__init__ (port )
153
- self .uses_usb_otg = uses_usb_otg
153
+ self .uses_usb = uses_usb
154
154
155
155
def reset (self ):
156
156
self ._setRTS (True ) # EN->LOW
157
- if self .uses_usb_otg :
157
+ if self .uses_usb :
158
158
# Give the chip some time to come out of reset,
159
159
# to be able to handle further DTR/RTS transitions
160
160
time .sleep (0.2 )
Original file line number Diff line number Diff line change 7
7
8
8
from .esp32c6 import ESP32C6ROM
9
9
from ..loader import ESPLoader
10
+ from ..reset import HardReset
10
11
11
12
12
13
class ESP32C5ROM (ESP32C6ROM ):
@@ -24,6 +25,8 @@ class ESP32C5ROM(ESP32C6ROM):
24
25
PCR_SYSCLK_XTAL_FREQ_V = 0x7F << 24
25
26
PCR_SYSCLK_XTAL_FREQ_S = 24
26
27
28
+ UARTDEV_BUF_NO = 0x4085F51C # Variable in ROM .bss which indicates the port in use
29
+
27
30
# Magic value for ESP32C5
28
31
CHIP_DETECT_MAGIC_VALUE = [0x8082C5DC ]
29
32
@@ -67,6 +70,10 @@ def get_crystal_freq_rom_expect(self):
67
70
self .read_reg (self .PCR_SYSCLK_CONF_REG ) & self .PCR_SYSCLK_XTAL_FREQ_V
68
71
) >> self .PCR_SYSCLK_XTAL_FREQ_S
69
72
73
+ def hard_reset (self ):
74
+ print ("Hard resetting via RTS pin..." )
75
+ HardReset (self ._port , self .uses_usb_jtag_serial ())()
76
+
70
77
def change_baud (self , baud ):
71
78
if not self .IS_STUB :
72
79
crystal_freq_rom_expect = self .get_crystal_freq_rom_expect ()
You can’t perform that action at this time.
0 commit comments