Merge pull request #373 from UweBonnes/fixes

Fixes for detach and stm32mem
This commit is contained in:
Gareth McMullin 2018-07-20 08:36:12 +12:00 committed by GitHub
commit 0551809475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -89,7 +89,10 @@ def stm32_scan(args, test):
exit(-1)
for dev in devs:
dfudev = dfu.dfu_device(*dev)
try:
dfudev = dfu.dfu_device(*dev)
except:
return 0
man = dfudev.handle.getString(dfudev.dev.iManufacturer, 30)
if man == "Black Sphere Technologies": bmp = bmp + 1
if bmp == 0 :

View File

@ -413,6 +413,8 @@ void cortexm_detach(target *t)
/* Disable debug */
target_mem_write32(t, CORTEXM_DHCSR, CORTEXM_DHCSR_DBGKEY);
/* Add some clock cycles to get the CPU running again.*/
target_mem_read32(t, 0);
}
enum { DB_DHCSR, DB_DCRSR, DB_DCRDR, DB_DEMCR };