Skip to content

Commit b35db73

Browse files
committed
esp32_s2: Fixes RTCWDT protect address
1 parent d4e44e5 commit b35db73

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/target/esp32_s2.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@
5757
#define ESP32_S2_TIMG1WDT_PROTECT (ESP32_S2_TIMG1_BASE + ESP32_S2_TIMGWDT_PROTECT_OFF)
5858
#define ESP32_S2_RTCCNTL_BASE 0x3f408000
5959
#define ESP32_S2_RTCWDT_CFG_OFF 0x94
60-
#define ESP32_S2_RTCWDT_PROTECT_OFF 0xA8
60+
#define ESP32_S2_RTCWDT_PROTECT_OFF 0xAC
6161
#define ESP32_S2_RTCWDT_CFG (ESP32_S2_RTCCNTL_BASE + ESP32_S2_RTCWDT_CFG_OFF)
6262
#define ESP32_S2_RTCWDT_PROTECT (ESP32_S2_RTCCNTL_BASE + ESP32_S2_RTCWDT_PROTECT_OFF)
6363

64-
#define ESP32_S2_TRACEMEM_BLOCK_SZ 0x4000
64+
#define ESP32_S2_TRACEMEM_BLOCK_SZ 0x4000
6565

66-
#define ESP32_S2_DR_REG_UART_BASE 0x3f400000
67-
#define ESP32_S2_REG_UART_BASE( i ) (ESP32_S2_DR_REG_UART_BASE + (i) * 0x10000 )
68-
#define ESP32_S2_UART_DATE_REG(i) (ESP32_S2_REG_UART_BASE(i) + 0x74)
69-
#define ESP32_S2_CHIP_REV_REG ESP32_S2_UART_DATE_REG(0)
70-
#define ESP32_S2_CHIP_REV_VAL 0x19031400
71-
#define ESP32_S2BETA_CHIP_REV_VAL 0x18082800
66+
#define ESP32_S2_DR_REG_UART_BASE 0x3f400000
67+
#define ESP32_S2_REG_UART_BASE(i) (ESP32_S2_DR_REG_UART_BASE + (i) * 0x10000 )
68+
#define ESP32_S2_UART_DATE_REG(i) (ESP32_S2_REG_UART_BASE(i) + 0x74)
69+
#define ESP32_S2_CHIP_REV_REG ESP32_S2_UART_DATE_REG(0)
70+
#define ESP32_S2_CHIP_REV_VAL 0x19031400
71+
#define ESP32_S2BETA_CHIP_REV_VAL 0x18082800
7272

7373

7474
static const struct xtensa_config esp32_s2_xtensa_cfg = {
@@ -246,16 +246,16 @@ static int esp32_s2_soc_reset(struct target *target)
246246
*/
247247
const uint32_t esp32_reset_stub_code[] = {
248248
0x00001B06,
249-
0x00001106, 0x3F408038, 0x3F4080C0, 0x3F4080C4,
250-
0x3F408074, 0x01583218, 0x9C492000, 0x3F408000,
251-
0x50D83AA1, 0x3F4080A8, 0x3F41F064, 0x3F420064,
252-
0x3F408094, 0x3F41F048, 0x3F420048, 0x3F4C10E0,
253-
0x3F408038, 0x00003000, 0x41305550, 0x0459FFEE,
254-
0x59FFEE41, 0xFFED4104, 0xED410459, 0xFFED31FF,
255-
0xED310439, 0xFFED41FF, 0x00000439, 0x31305550,
256-
0xEC41FFEC, 0x410439FF, 0x0439FFEC, 0x39FFEC41,
257-
0xFFEB4104, 0xEB410459, 0x410459FF, 0x0459FFEB,
258-
0x59FFEB41, 0xFFEA4104, 0x39FFEB31, 0x00700004,
249+
0x00001106,0x3F408038, 0x3F4080C0,0x3F4080C4,
250+
0x3F408074,0x01583218, 0x9C492000,0x3F408000,
251+
0x50D83AA1,0x3F4080AC, 0x3F41F064,0x3F420064,
252+
0x3F408094,0x3F41F048, 0x3F420048,0x3F4C10E0,
253+
0x3F408038,0x00003000, 0x41305550,0x0459FFEE,
254+
0x59FFEE41,0xFFED4104, 0xED410459,0xFFED31FF,
255+
0xED310439,0xFFED41FF, 0x00000439,0x31305550,
256+
0xEC41FFEC,0x410439FF, 0x0439FFEC,0x39FFEC41,
257+
0xFFEB4104,0xEB410459, 0x410459FF,0x0459FFEB,
258+
0x59FFEB41,0xFFEA4104, 0x39FFEB31,0x00700004,
259259
0x00FFFE46
260260
};
261261

src/target/esp32_s2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ enum esp32_s2_rev {
4141
};
4242

4343
struct esp32_s2_common {
44-
struct esp_xtensa_common esp_xtensa;
45-
enum esp32_s2_rev chip_rev;
44+
struct esp_xtensa_common esp_xtensa;
45+
enum esp32_s2_rev chip_rev;
4646
};
4747

4848
static inline struct esp32_s2_common *target_to_esp32_s2(struct target *target)

src/target/esp32s2_cpu_reset_handler.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define TIMG1_WDTWPROTECT_REG 0x3F420064
3232
#define TIMG1_WDTCONFIG0_REG 0x3F420048
3333
#define RTC_CNTL_WDTCONFIG0_REG 0x3F408094
34-
#define RTC_CNTL_WDTWPROTECT_REG 0x3F4080a8
34+
#define RTC_CNTL_WDTWPROTECT_REG 0x3F4080ac
3535
#define RTC_CNTL_OPTIONS0_REG 0x3F408000
3636
#define RTC_CNTL_OPTIONS0_DEF 0x1C492000
3737
#define RTC_CNTL_SW_SYS_RST 0x80000000

0 commit comments

Comments
 (0)