Skip to content

Commit 309a17c

Browse files
committed
at32f43x: Correct typos in WFI/WDT handling
1 parent 7d533b3 commit 309a17c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/target/at32f43x.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ static bool at32f43_mass_erase(target_s *target);
9696
*/
9797
#define AT32F43x_DBGMCU_BASE 0xe0042000U
9898
#define AT32F43x_DBGMCU_IDCODE (AT32F43x_DBGMCU_BASE + 0x00U)
99-
#define AT32F43x_DBGMCU_CTRL (AT32F43x_DBGMCU_BASE + 0x40U)
100-
#define AT32F43x_DBGMCU_APB1_PAUSE (AT32F43x_DBGMCU_BASE + 0x80U)
99+
#define AT32F43x_DBGMCU_CTRL (AT32F43x_DBGMCU_BASE + 0x04U)
100+
#define AT32F43x_DBGMCU_APB1_PAUSE (AT32F43x_DBGMCU_BASE + 0x08U)
101101
#define AT32F43x_DBGMCU_APB2_PAUSE (AT32F43x_DBGMCU_BASE + 0x0cU)
102102
#define AT32F43x_DBGMCU_SER_ID (AT32F43x_DBGMCU_BASE + 0x20U)
103103

@@ -164,7 +164,7 @@ static void at32f43_configure_dbgmcu(target_s *target)
164164
const uint32_t dbgmcu_apb1_pause_mask = AT32F43x_DBGMCU_APB1_PAUSE_WWDT | AT32F43x_DBGMCU_APB1_PAUSE_WDT;
165165
const uint32_t dbgmcu_apb1_pause = target_mem32_read32(target, AT32F43x_DBGMCU_APB1_PAUSE);
166166
if ((dbgmcu_apb1_pause & dbgmcu_apb1_pause_mask) != dbgmcu_apb1_pause_mask)
167-
target_mem32_write32(target, AT32F43x_DBGMCU_APB1_PAUSE, dbgmcu_apb1_pause & dbgmcu_apb1_pause_mask);
167+
target_mem32_write32(target, AT32F43x_DBGMCU_APB1_PAUSE, dbgmcu_apb1_pause | dbgmcu_apb1_pause_mask);
168168
}
169169

170170
static bool at32f43_attach(target_s *target)

0 commit comments

Comments
 (0)