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

STM32G070KBT6 / G071KBT6: False chipid reading #1017

Closed
gustavolaureano opened this issue Aug 21, 2020 · 10 comments · Fixed by #1126
Closed

STM32G070KBT6 / G071KBT6: False chipid reading #1017

gustavolaureano opened this issue Aug 21, 2020 · 10 comments · Fixed by #1126

Comments

@gustavolaureano
Copy link
Contributor

gustavolaureano commented Aug 21, 2020

  • Programmer/board type: [Stlink V2]
  • Operating system and version: [Windows 10]
  • Stlink tools version and/or git commit hash: [v1.6.1-88-g6f36574]
  • Stlink commandline tool name: [st-util / st-info]
  • Target chip (and board if applicable): [STM32G070KBT6 / STM32G071KBT6]

Commandline-Output:

st-util
2020-08-21T10:51:22 WARN common.c: unknown chip id! 0x5fa0004

st-info --chipid
0x0004

ST-Link Utility correctly identify the chipid for both (STM32G070KBT6 / STM32G071KBT6) micro-controllers:
Device ID:0x460

But st-util / st-info reports the wrong chipid:
st-info --chipid
0x0004

This problem is happening only with my LQFP32 (STM32G07xKB) chips, both Revision B

I tested with 3 different st-link fw versions: V2J32S7 / V2J36S7 / V2J37S7 (latest)
and all of then presented this same behavior.

I also run the st-info on a Nucleo64 board (G071RB), with the latest ST-Link firmware (V2J37M26)
and a STM32G071RB (rev 2C) target, in this case the chipid was correct:
st-info --chipid
0x0460

COMPLEMENTING:
I also ran the "st-info --chipid" using the same ST-Link v2 (V2J37S7) connected to an STM32L432, and it reported the correct chipid (0x0435)

Is there anything else that I can do to help solving this issue?

Thank you for your support.

The stlink project maintainers

@Nightwalker-87 Nightwalker-87 added this to the v1.6.2 milestone Aug 21, 2020
@Nightwalker-87 Nightwalker-87 changed the title [STM32G070KBT6 / STM32G071KBT6]: [False chipid reading] [STM32G070KBT6 / G071KBT6]: False chipid reading Aug 21, 2020
@Nightwalker-87 Nightwalker-87 changed the title [STM32G070KBT6 / G071KBT6]: False chipid reading STM32G070KBT6 / G071KBT6: False chipid reading Aug 21, 2020
@gustavolaureano
Copy link
Contributor Author

I conducted more tests here and found the issue, the problem was the HW connection in between my ST-Link and my custom board with the G070, the default SWD frequency was too high for it and all read data was corrupted (although it was always reading 0x0004 as chipid).

I recompiled the st-info to open the ST-Link with a lower SWD freq (100KHz) and it read the correct chipid (0x0460)

Maybe it could be a feature request? ability to set the SWD frequency in every cmd tool? (st-info, st-util)
I could implement it later today

@gustavolaureano
Copy link
Contributor Author

Ok, now I am reopening this issue because I just confirmed that my HW connection is not the culprit, I connected a J-Link to my custom board using the same adapter and cable that I use with the ST-Link, and it connected to the target (SWD clock @4Mhz , checked with an oscilloscope) and acquired RTT messages for more than a hour without a single problem, so it seems that the problem is somewhere in between the ST-Link V2 (V2J37S7) and the libstlink (v1.6.1-88-g6f36574) when the SWD clock is set above 480KHz, as it still works with 480KHz.

@Ant-ON
Copy link
Collaborator

Ant-ON commented Nov 6, 2020

@gustavolaureano This is very similar to reset problems... Could you try the develop branch ?

@Nightwalker-87
Copy link
Member

Ping @gustavolaureano.

@gustavolaureano
Copy link
Contributor Author

Hi,
ATM I do not have access to the hw with the LQFP32, I should have it in hand again by the middle of next week, as soon as I test it I report here

@gustavolaureano
Copy link
Contributor Author

@gustavolaureano This is very similar to reset problems... Could you try the develop branch ?

Ok! will try the dev branch

@gustavolaureano
Copy link
Contributor Author

Just built the develop branch on a Windows machine and tested with an STM32G070KB (LQFP32), and the st-info --probe reported the ID correctly, seems to be solved (y)

2021-05-19 16_45_08-C__Windows_System32_cmd exe

@Nightwalker-87
Copy link
Member

Nightwalker-87 commented May 19, 2021

@gustavolaureano Does it already work with Release v1.7.0 (Commit: 179650d) ?
@Ant-ON I assume #1126 is the actual fix for this issue. The previous commit ee491d9 may fail. Can you verify this with your hardware @gustavolaureano? This would allow to link this issue to the actual fix for documentation purposes.

@gustavolaureano
Copy link
Contributor Author

@gustavolaureano Does it already work with Release v1.7.0 (Commit: 179650d) ?
@Ant-ON I assume #1126 is the actual fix for this issue. The previous commit ee491d9 may fail. Can you verify this with your hardware @gustavolaureano? This would allow to link this issue to the actual fix for documentation purposes.

Hi @Nightwalker-87
Just tested it, you are right, v1.7.0 works and commit ee491d9 not:

v1.7.0-dirty:

Found 1 stlink programmers
version: V2J36S7
flash: 131072 (pagesize: 2048)
sram: 36864
chipid: 0x0460
descr: G070/G071/G081

v1.6.1-296-gee491d9-dirty:

Found 1 stlink programmers
version: V2J36S7
flash: 0 (pagesize: 0)
sram: 0
chipid: 0x0000
descr: unknown device

@Nightwalker-87
Copy link
Member

Fixed by #1126.

@stlink-org stlink-org locked as resolved and limited conversation to collaborators May 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants