stm32f4: Attach logic cleanup by making sure we only set the extra bits needed when writing DBGMCU_CR

This commit is contained in:
dragonmux 2022-03-31 13:46:29 -04:00
parent eed1cc81ff
commit 804a1a4f43
No known key found for this signature in database
GPG Key ID: 9DA7A6AD14274BA4
1 changed files with 2 additions and 2 deletions

View File

@ -313,8 +313,8 @@ static bool stm32f4_attach(target *t)
priv_storage->dbgmcu_cr = target_mem_read32(t, DBGMCU_CR);
t->target_storage = (void*)priv_storage;
/* Enable debugging during all low power modes*/
target_mem_write32(t, DBGMCU_CR, DBGMCU_CR_DBG_SLEEP |
DBGMCU_CR_DBG_STANDBY | DBGMCU_CR_DBG_STOP);
target_mem_write32(t, DBGMCU_CR, priv_storage->dbgmcu_cr |
DBGMCU_CR_DBG_SLEEP | DBGMCU_CR_DBG_STANDBY | DBGMCU_CR_DBG_STOP);
/* Free previously loaded memory map */
target_mem_map_free(t);