Sonsivri

Electronics => Hardware and Tools => Topic started by: omar2009 on May 29, 2012, 09:37:21 21:37



Title: STM32F4DISCOVERY and ST-LINK/V2 (Problem and Solution)
Post by: omar2009 on May 29, 2012, 09:37:21 21:37
Hi All,

I got STM32F4DISCOVERY board

http://www.st.com/internet/evalboard/product/252419.jsp

It is based on STM32F407VG Cortex-M4 ARM MCU

I tried to connect to it using ST-Link utility

http://www.st.com/internet/evalboard/product/251168.jsp

but i got:

Connected via SWD.

Cannot connect to the MCU device!


after some invistigations I recognized that the problem is in the
MCU revision which is: 'Z' Revision
            -----------------------
           |     STM32F407     |
           |   VGT6          Z     |    <----  Here is Revision code
           |   HPAFD      VG    |
           |   KOR   HP   203  |   
           ------------------------

Later found this Errata:

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/ERRATA_SHEET/DM00037591.pdf

on page 9 we can find:

2.1.2 MCU device ID is incorrect

So:
The Device ID of the STM32F4xx Rev.Z has been changed to 0x413 (instead of 0x411 for Rev.A).
Thus, ST-LINK Utility can't recognize the device ID of STM32F4 Rev.Z (Only Rev.A is supported).


Solution:

the attached patch adds the support of STM32 F4 rev.Z in the current version(v2.2).

Have fun


Omar





Title: Re: STM32F4DISCOVERY and ST-LINK/V2 (Problem and Solution)
Post by: metal on May 30, 2012, 01:30:51 01:30
The original topic (https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Discovery%2FSTM32F4DISCOVERY%20%20%20Cannot%20connect%20to%20the%20MCU%20device&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=573)

bm.marwen says:
Quote
Hi,

The Device ID of the STM32F4xx Rev.Z has been changed to 0x413 (instead of 0x411 for Rev.A).
Thus, ST-LINK Utility can't recognize the device ID of STM32F4 Rev.Z (Only Rev.A is supported).
This issue will be fixed in the next version which will be released soon.
In the meanwhile, the attached patch adds the support of STM32 F4 rev.Z in the current version(v2.2).

Regards,
Marwen

Here is the original file attachment (https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/DispForm.aspx?ID=1944&RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Discovery%2FSTM32F4DISCOVERY%20%20%20Cannot%20connect%20to%20the%20MCU%20device)

This is a well known issue on STM32 discovery board. I looked at the both applications, the original and the one from the patch, and it seems this was a simple case statement change in C code.


Title: Re: STM32F4DISCOVERY and ST-LINK/V2 (Problem and Solution)
Post by: codekey on May 07, 2018, 10:47:19 22:47
Hi All,

I got STM32F4DISCOVERY board

http://www.st.com/internet/evalboard/product/252419.jsp

It is based on STM32F407VG Cortex-M4 ARM MCU

I tried to connect to it using ST-Link utility

http://www.st.com/internet/evalboard/product/251168.jsp

but i got:

Connected via SWD.

Cannot connect to the MCU device!


after some invistigations I recognized that the problem is in the
MCU revision which is: 'Z' Revision
            -----------------------
           |     STM32F407     |
           |   VGT6          Z     |    <----  Here is Revision code
           |   HPAFD      VG    |
           |   KOR   HP   203  |   
           ------------------------

Later found this Errata:

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/ERRATA_SHEET/DM00037591.pdf

on page 9 we can find:

2.1.2 MCU device ID is incorrect

So:
The Device ID of the STM32F4xx Rev.Z has been changed to 0x413 (instead of 0x411 for Rev.A).
Thus, ST-LINK Utility can't recognize the device ID of STM32F4 Rev.Z (Only Rev.A is supported).


Solution:

the attached patch adds the support of STM32 F4 rev.Z in the current version(v2.2).

Have fun


Omar





I have one of those Discovery boards. I accidentally damaged the STM32F407 so i ordered a replacement STM32F407.  After replacing the STM32407 the ST-Link2 didn't recognize the micro. I ended up ordering a brand new STM32F4 Discovery board.

Now that i've read this post, i looked at the Discovery board i could not get to work and the Revision after VGT6 shows "2". Could this be the problem why the ST-Link2 does not recognize this micro?


Title: Re: STM32F4DISCOVERY and ST-LINK/V2 (Problem and Solution)
Post by: h0nk on May 08, 2018, 12:27:51 00:27

Hello

> Could this be the problem why the ST-Link2 does not recognize this micro?

Have You tried the "ST-Link Utility"?
At least it should be able to read the Device ID/Revision ID.
The size of the flash is also stored in a predefined register and
should be readable.

I have two F407 Discovery Boards. One is rather old with VGT6 - A.
The Chip is recognized as: Device ID: 0x411/Revision ID B and
a newer one with a VGT6 - Z. This shows Device ID: 0x413 and
Revision ID Z.

If the Chip is unknown to the software i would assume, that the utility shows
"Unknown Device" but with correct values for Device ID, Revision ID
and Flash size.

I would suggest to write a small test for the SWD-Pins in GPIO-Mode
and test the connection. You can use the boot loader to flash this test.
Dont forget a sufficient delay loop at the begin if you want to erase and
reprogram via SWD/JTAG later.

And you should update the ST-Link on the Board to the latest available version
together with the communication libraries for Your favorite IDE/Compiler.
I remember that i had similar problems with a brand new STM32L053 some time ago.

Good luck, and

Best Regards


Title: Re: STM32F4DISCOVERY and ST-LINK/V2 (Problem and Solution)
Post by: Mr. Spock on May 08, 2018, 09:38:16 21:38
Segger has an utility that transforms an ST-link into a Jlink. This may solve your problem


Title: Re: STM32F4DISCOVERY and ST-LINK/V2 (Problem and Solution)
Post by: mEErEck on August 21, 2020, 09:56:55 09:56
Mr. Spock is right. You can follow this article: https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/
I have convertered cloned STLINKs_v2 purchased from China into the JLink. The programmer became much faster in terms of flashing and stepping through the code at breakpoints.


Title: Re: STM32F4DISCOVERY and ST-LINK/V2 (Problem and Solution)
Post by: simma on August 22, 2020, 03:11:32 15:11
Mr. Spock is right. You can follow this article: https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/
I have convertered cloned STLINKs_v2 purchased from China into the JLink. The programmer became much faster in terms of flashing and stepping through the code at breakpoints.

I agree with Mr Spock and mEErEck. You may find STLinkReflash.exe refuse to upgrade the clones. I used the info from the link in the attachment. It worked for me.