Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDCODE confusing #20

Open
schneidersoft opened this issue Mar 4, 2022 · 2 comments
Open

IDCODE confusing #20

schneidersoft opened this issue Mar 4, 2022 · 2 comments

Comments

@schneidersoft
Copy link
Contributor

schneidersoft commented Mar 4, 2022

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)

@makkarpov
Copy link

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).

image

@schneidersoft
Copy link
Contributor Author

Thanks! That clears it up! I was scratching my head for ages on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants