cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8T6 Program not working and USB not recognized

JTAPIE
Associate II

Hello,

I found this schematic and layout with a stm32f103c8t6. I ordered it and wanted to programm it.

With stm32cubeprogrammer I detect the stm32 no problem via ST-LINK.

Same with stm32cubeide I can download successfully the code.

But now the problem is that eventhough the code is downloaded successfully the simple program to blink a pin to which I attach a diode is not working and I don’t see why.

I also want to be able to send data from my computer to the STM32 with USB but after downloading the code with "usb_device.h" and MX_USB_DEVICE_Init();, deconnecting ST-LINK and connecting with USB the STM32 is not recognized by the computer.

Any idea of what I could look for or ressources ?

If you see any problem in the design please tell me.

Regards,

Jean

Basic_STM32_Bluepill.png

pcb.PNG

  

stm32cubeprog.PNG

code.PNG

download.PNG

  

17 REPLIES 17

So have you used the debugger?

Unfortunately, our logo on an MCU does not prove at all that it is an original. STM32F103C8T6 in particular have been counterfeited on a large scale for several years, including the logo.

In cases where you cannot be completely sure that the seller is selling original goods (Aliexress, Ebay, etc.), it is advisable to check this with a test programme. You can also find tips on this here in the community, e.g. here or there.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

The MCU that the manufacturer used looks like this one from the link you send, is this the one you said is counterfeit?

JTAPIE_0-1738080082112.png

 

No that's why I tried to do this new PCB.

Yes

 

 

 

Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.15.0                  
      -------------------------------------------------------------------



Log output file:   C:\Users\JEAN~1.TAP\AppData\Local\Temp\STM32CubeProgrammer_a43840.log
ST-LINK SN  : E1007200D0D2139393740544
ST-LINK FW  : V2J43S7
Board       : --
Voltage     : 3.25V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x410
Revision ID : Rev X
Device name : STM32F101/F102/F103 Medium-density
Flash size  : 64 KBytes
Device type : MCU
Device CPU  : Cortex-M3
BL Version  : --



Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a43840.srec
  File          : ST-LINK_GDB_server_a43840.srec
  Size          : 29.80 KB 
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 29]
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:01.890



Verifying ...




Download verified successfully 


Shutting down...
Exit.

 

That just shows the programmer connecting to the chip, and programming it.

Have you used the CubeIDE debugger to see what your code is actually doing?

As I already mentioned: as long as you can't trace the supply chain in detail, nobody can say for sure, only one of the tests mentioned can clarify this.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.