Author Topic: SWD woes using STM32C011 cant connect using swd  (Read 531 times)

0 Members and 5 Guests are viewing this topic.

Offline sahko123Topic starter

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: ie
SWD woes using STM32C011 cant connect using swd
« on: August 22, 2024, 07:00:43 pm »
Ive been working on a test dev board for the stm32c011 with plans to use the wlcsp-12 package for the final product and have it be user programmable over USB/UART. I bought the following official ST micro dev board for it to be able to test the various connections like UART and SWD.

https://www.st.com/en/evaluation-tools/stm32c0116-dk.html
With the following schematics,
https://www.st.com/resource/en/schematic_pack/mb1684-c011f6-b01-schematic.pdf

Using the board as normal with the microcontroller daughterboard in the st-link board i can get it to connect perfectly fine with STM32CubeProgrammer, after changing one option bit to enable the boot0 pin i can still easily get it to connect to the ST-Link and now also over UART using a cp2102 with the daughter board in a breadboard and otherwise not connected to the st-link carrier

But my issue is im not sure what the st-link carrier is actually using as its protocol to connect, because to replicate i have to connect 5 pins T_JTMS, T_JTCK, T_NRST, T_VCP_TX and T_VCP_RX and then the daughter board connects to the st-link outside of the default socket. What i dont understand is that i have no idea what this protocol even really is, cause in the programmer software it selected to use SWD, but this is like JTAG, when selecting JTAG no connection is made. There are SWD pins SWDIO and SWCLK on the carrier board but connecting them to the daughter board externally yields no connection whatsoever.

What i want to be able to do on my dev board is to just connect SWDIO, SWCLK and use that for debug then be able to switch traces with jumpers and use UART instead for programming but i cant get the st-link carrier to connect over just SWD, is this is because of the st-link being built in? or should i expect the dev board st-link to act the same as any normal v2 st-link
Asking for a friend
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11598
  • Country: us
    • Personal site
Re: SWD woes using STM32C011 cant connect using swd
« Reply #1 on: August 22, 2024, 08:17:20 pm »
Cortex-M0+ devices don't have JTAG, only SWD. SWD used the same pins as JTAG when both are supported The actual names of the pins are SWDIO (T_JTMS) and SWCLK (T_JTCK).

So, you need to trace where those PA13 and PA14 pins end up where you can connect to them. They are the only debugging interface on that device.

T_NRST is optional, but useful for recovery from firmware that puts the device into some inaccessible state (like lowest power sleep modes).

Ok, I see how this kit is designed. The plugin module already connects everything, so it should program the target.

So, it is not clear what is the issue here. Do you want to use external ST-Link? Or do you want to use that on-board ST-Link for your own boards?
« Last Edit: August 22, 2024, 08:25:28 pm by ataradov »
Alex
 

Offline sahko123Topic starter

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: ie
Re: SWD woes using STM32C011 cant connect using swd
« Reply #2 on: August 22, 2024, 09:46:16 pm »
I want to use the st-link section of this dev kit to connect to the stm32 daughter board, while this daughter board is in a breadboard, to confirm that i can indeed make the connection over SWD but for whatever reason I'm not able to connect it. I'm sure there is something wrong with my implementation. What is the minimum circuitry i should have for this stm32 to communicate over SWD and only two wire SWD. From what I can tell all i needed to have was power SWDIO and SWCLK, but that has had no luck connecting, even adding NRST does nothing
Asking for a friend
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11598
  • Country: us
    • Personal site
Re: SWD woes using STM32C011 cant connect using swd
« Reply #3 on: August 22, 2024, 09:58:33 pm »
The minimal configuration you need SWDIO/SWCLK and the power/ground, of course. If this does not work, then what specific error messages you are getting?
Alex
 

Offline sahko123Topic starter

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: ie
Re: SWD woes using STM32C011 cant connect using swd
« Reply #4 on: August 22, 2024, 11:09:29 pm »
I was mostly getting,
Error: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication
and sometimes,
Error: ST-LINK error (DEV_TARGET_CMD_ERR)
Asking for a friend
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11598
  • Country: us
    • Personal site
Re: SWD woes using STM32C011 cant connect using swd
« Reply #5 on: August 22, 2024, 11:34:44 pm »
No idea about that.

What I would do is take that module out and use a bunch of wires to connect the module pins to the carrier. Then disconnect them one by one to see what matters.

But there really should not be a need for anything other than ground and SWD pins.
Alex
 

Offline Pseudobyte

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: us
  • Embedded Systems Engineer / PCB Designer
Re: SWD woes using STM32C011 cant connect using swd
« Reply #6 on: August 23, 2024, 12:43:37 pm »
Seems like a grounding/power issue. Could you share a photo of your breadboard setup?
“They Don’t Think It Be Like It Is, But It Do”
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11598
  • Country: us
    • Personal site
Re: SWD woes using STM32C011 cant connect using swd
« Reply #7 on: August 23, 2024, 10:05:43 pm »
Ok, I was just doing some work with ST-Link and ran into the same error. In addition to connecting the reset pin, you also need to select "Under Reset" in the "Mode" setting. It does not use reset pin by default.
Alex
 
The following users thanked this post: voltsandjolts

Offline sahko123Topic starter

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: ie
Re: SWD woes using STM32C011 cant connect using swd
« Reply #8 on: Yesterday at 03:42:28 pm »
Yeah unfortunately that doesn't seem to help, grounding and power seem to be all good since i can work with UART but otherwise just SWD is the issue, adding a reset doesnt change anything, ill try probing around to see wtf is going on
Asking for a friend
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11598
  • Country: us
    • Personal site
Re: SWD woes using STM32C011 cant connect using swd
« Reply #9 on: Yesterday at 04:04:23 pm »
If it works while the module is plugged in, then your easiest way to find out what is not working is to plug it in though a bunch of extension wires and then remove them one by one until it breaks.
Alex
 
The following users thanked this post: sahko123

Offline sahko123Topic starter

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: ie
Re: SWD woes using STM32C011 cant connect using swd
« Reply #10 on: Yesterday at 08:56:49 pm »
well i feel like a moron now  |O, but not only was the contact in the socket only stable with the larger pins of the daughter board, which is why connections worked, but when i tested my point to point connections me pressing on the pins caused there to be a continuity, remove the probes it doesnt work anymore,

but even when there are soldered connections it sometimes works sometimes doesnt, so god knows
Asking for a friend
 

Offline sahko123Topic starter

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: ie
Re: SWD woes using STM32C011 cant connect using swd
« Reply #11 on: Yesterday at 09:18:44 pm »
well i feel like a moron now  |O, but not only was the contact in the socket only stable with the larger pins of the daughter board, which is why connections worked, but when i tested my point to point connections me pressing on the pins caused there to be a continuity, remove the probes it doesnt work anymore,

but even when there are soldered connections it sometimes works sometimes doesnt, so god knows

Ok it seems that the board to board wires i was using were just ass replaced them and now i dont even need the reset pin
Asking for a friend
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6149
  • Country: es
Re: SWD woes using STM32C011 cant connect using swd
« Reply #12 on: Yesterday at 09:36:13 pm »
Ahh yes, the usual failing contact that works exactly when touching with the probes, making your life miserable!
About 25% of world baldness is due failures like this!  :-DD
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