Open schneidersoft opened 2 years ago
These are two different IDCODEs, both are from target.
get_idcode
returns debug port IDCODE, which is not present anywhere in the memory. On STM32F103 the value is 0x1BA01477
, with most significant nibble being the revision (so you have 2
there).
Thanks! That clears it up! I was scratching my head for ages on this one.
CortexM(sdw.Swd()).get_idcode()
gets the Stlinks IDCODE(or some other value from it) rather than the target IDCODE. To get the target IDCODE you must use:sdw.Swd().get_mem32(0xE0042000)
Consider changing the function name?
example get_idcode() = 2BA01477 (corresponding to Cortex ®-M4 with FPU r0p1) STM32F446xx example swd.get_mem32(0xE0042000) = 10006430 (F103 XL REV.A)