ch32f1: Re-ordered a couple of the operation in ch32f1_probe so it plays nicer with the STM32 parts
This commit is contained in:
parent
0368b76078
commit
b5b2d4dc95
|
@ -159,8 +159,10 @@ static int ch32f1_flash_lock(target *t)
|
||||||
*/
|
*/
|
||||||
bool ch32f1_probe(target *t)
|
bool ch32f1_probe(target *t)
|
||||||
{
|
{
|
||||||
const uint32_t idcode = target_mem_read32(t, DBGMCU_IDCODE) & 0xfff;
|
if ((t->cpuid & CPUID_PARTNO_MASK) != CORTEX_M3)
|
||||||
if ((t->cpuid & CPUID_PARTNO_MASK) != CORTEX_M3 || idcode != 0x410) // only ch32f103
|
return false;
|
||||||
|
const uint32_t idcode = target_mem_read32(t, DBGMCU_IDCODE) & 0x00000fffU;
|
||||||
|
if (idcode != 0x410) // only ch32f103
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// try to flock
|
// try to flock
|
||||||
|
|
Loading…
Reference in New Issue