Author Topic: Now there are also fake STM32F030 microcontrollers?  (Read 3171 times)

0 Members and 1 Guest are viewing this topic.

Offline insanoffTopic starter

  • Contributor
  • Posts: 22
  • Country: az
Now there are also fake STM32F030 microcontrollers?
« on: April 17, 2022, 07:33:36 am »
Hello everyone!
I purchased an STM32F030F4P6 development board on Aliexpress for a project (I'm an STM32 newbie). I tried to flash the blink program using CubeIDE and ST-Link and got the following error message:
Error in initializing ST-LINK device.
Reason: ST-LINK: Could not verify ST device! Abort connection.


I would like to know if there are also fake F030 microcontrollers. Googling does not give any relevant results.

Thanks
Adam

 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4301
  • Country: nl
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #1 on: April 17, 2022, 08:30:40 am »
Google for using openocd with this controller and ST-link. It will tell you what the retrieved device ID is.

I had this once with a F103 device. It did not have the ST logo on the chip but was sold as one. The device ID was different but by modifying the openocd script with the newly found ID I was able to program the device.

Offline tepalia02

  • Regular Contributor
  • *
  • !
  • Posts: 100
  • Country: bd
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #2 on: April 17, 2022, 08:47:43 am »
Follow the advice given by pcprogrammer. If it does not work, I think you should immediately contact your supplier. 
 

Offline thinkfat

  • Supporter
  • ****
  • Posts: 2155
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #3 on: April 17, 2022, 08:48:53 am »
First things first: Have you checked the physical connection?
Everybody likes gadgets. Until they try to make them.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3831
  • Country: nl
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #4 on: April 17, 2022, 03:40:06 pm »
Indeed,
I would not draw any conclusions from a single sample.
There could be a bad solder joint, a wronly placed or missing SMT part, bad crysal, ESD damage, a broken PCB track or whatever.

For the average "direct from china" prices you can't be too critical.
Even If 10% would not be working, I'd just consider it acceptable.
You either calculate in some waste, or you pay extra up front for higher quality control on their side.

If however, they advertise as an ST part, and openocd gives you wrong ID's (for multiple PCB's, one can be a fluke), then first complain for a refund, and then still give them full negative feedback for trying to cheat you.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8758
  • Country: fi
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #5 on: April 17, 2022, 04:41:09 pm »
You need to somehow find out what this error 18 "Could not verify ST device" actually means. It could be anything, I hate such unhelpful error messages yet they are very popular.

Look for documentation, google for it, and if all else fails, read the source code, if that part which generates the error code is open source; hopefully it is.
 
The following users thanked this post: splin

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6225
  • Country: es
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #6 on: April 17, 2022, 08:43:43 pm »
I only got that error with clones...
Ensure your IDE/Programmer is updated, might be a newer silicon revision.

Switch to OpenOCD under debug/run profile and try again.
« Last Edit: April 17, 2022, 08:45:37 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline insanoffTopic starter

  • Contributor
  • Posts: 22
  • Country: az
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #7 on: April 18, 2022, 07:44:37 am »
Thanks everyone for your comments!

The idea of checking the device ID with OpenOCD is great. For some reason I am not able to get OpenOCD to work with CubeIDE 1.9. I installed CubeIDE 1.3.1 on my old Windows 7 laptop, it worked. I can flash and debug. I assume the device ID seems to be ok: 0x10006444.

But strangely, I can't use the GDB server, including on my old Windows 7 laptop. It just doesn't work.

I have a F401RE Nucleo and F411CE "Black Pill" development boards, all working fine.
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 7107
  • Country: ca
  • Non-expert
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #8 on: April 18, 2022, 09:03:37 pm »
If you can flash and debug it should be the real deal. I have received fake F030's but they were just the wrong silicon entirely, blatant fakes, not clones with the same device ID.

Check the things Doctorandus_P mentioned, if the SWD pin is loose it could intermittently be able to debug. Could also try dropping the debug clock frequency if it lets you. Look for shorted outputs.
Is there any cap on NRST?
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline insanoffTopic starter

  • Contributor
  • Posts: 22
  • Country: az
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #9 on: April 20, 2022, 06:07:16 pm »
I can flash and debug, but only with OpenOCD. Surely something is wrong. It is well said that we should expect poor quality from electronics ordered off cheap Chinese sources.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3871
  • Country: de
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #10 on: April 20, 2022, 07:16:45 pm »
I can flash and debug, but only with OpenOCD. Surely something is wrong. It is well said that we should expect poor quality from electronics ordered off cheap Chinese sources.

Yes, something with your setup. If OpenOCD can flash and debug the chip, the hw is almost certainly OK. OpenOCD certainly doesn't have any special secret sauce to make the chips work that the vendor software doesn't have.

That doesn't mean the chip can't be a clone but as long as it reports the correct ID there is no reason ST Link would reject it.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6225
  • Country: es
Re: Now there are also fake STM32F030 microcontrollers?
« Reply #11 on: April 21, 2022, 05:12:41 am »
OpenOCD doesn't care about the clones, but ST-LINK GDB server does.
If the setup was wrong, you would get any other error!

Already fought that a year ago, losing debugging was a problem!
OpenOCD might still fail to debug it , but can be fixed, copied from here,
Try it, but for stm32f0x.cfg.
Quote
Find and edit the file: STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.debug.openocd_****\resources\openocd\st_scripts\target\stm32f1x.cfg
Find the command line starting with : swj_newdap
At the end of this command line you will see : -expected-id $_CPUTAPID
Simply change it to: -expected-id 0
The zero tells OpenOCD to ignore id numbers, which means all clones or genuine MCUs will work.
Save the changes. Now your flash and debug should work.
« Last Edit: April 21, 2022, 05:16:17 am by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf