Skip to main content
Visitor II
May 2, 2020
Solved

Programming when on external power (basic schematic ideas)

  • May 2, 2020
  • 8 replies
  • 3506 views

Hey folks

Just got on populating the passives and ICs on what would appear to be my first ever STM32 based controller (custom PCB). Quite successful and rather impressed with the end result although, perhaps, with the exception of being able to program (ST-Link) while external power is applied (learning harder than I thought lol).

Can someone please share a "basic" schematic that would allow for this be achieved. I understand that there are several Discovery board schematics however those shows rather complex circuits with jumpers all over & al. I'm just hoping to see if we have a far better, and "simple/r", approach to that.

Any brilliant ideas welcome, that would be kind and helpful. Thanks guys

    This topic has been closed for replies.
    Best answer by TDK

    The ST-Link programmer you have is not an official programmer. It's an even lower cost knock-off. But it probably works fine. I don't know if the 3V3 on your programmer is intended to power the board. I suspect it is. Whereas in the official programmers, the board needs to be self-powered. This is an important difference.

    Try to only connect GND, SWDIO, and SWCLK. Official programmers also connect NRST but it is not strictly needed.

    Here is a link with programmer schematic info:

    http://www.keil.com/support/man/docs/ulinkplus/ulinkplus_jtagswd_interface.htm

    8 replies

    Super User
    May 2, 2020

    > with the exception of being able to program (ST-Link) while external power is applied

    Post photo of your setup.

    JW

    MecanixAuthor
    Visitor II
    May 2, 2020

    Sure. Not much going on in all honesty other than;

    1) External pwr (24V to 5V) Step-down feeding a LDO (3V3)

    2) PC/Programmer connecting to 3V3, SWCLK, SWDIO, GND0693W000000WnmDQAS.jpg

    Visitor II
    May 2, 2020

    I was confused as well when designing a board for an F730, so i made connections for all 8 signals to/from an stlink2. I don't think the jtag stuff is needed, so i think you just need swd, power and ground so 5 signals/pins. The power connection to the stlink is not for powering anything but rather is used by the stlink to detect the correct voltage for interacting with the target.​

    MecanixAuthor
    Visitor II
    May 2, 2020

    Tried connecting SWCLK, SWDIO, GND and leaving 3V3 disconnected and that didn't worked out. Still getting current going to the programmer. Tried a diode on the prog GND to prevent that and that didn't do anything.

    MecanixAuthor
    Visitor II
    May 2, 2020

    If anyone have achieved programming from ST-LINK (USB/PC) and with External Power ON, it would be nice to see how you did that circuit-wise.

    Basic schematic (i.e. as basic as it can get) would certainly help visualizing this.

    Cheers guys

    Visitor II
    May 2, 2020

    Dunno. The stlink is powered thru the usb and the target board should be powered separately. The Vcc connection between the two is for sensing on the stlink. I've had no trouble using stlink with multiple boards using 8 pogo pins to connect to pads on the f730 target board.​

    MecanixAuthor
    Visitor II
    May 2, 2020

    I have a feeling what you are trying to say is that the programmer I am using might/could be the issue ;) Attached is what I was given by the IC supplier, told me this is all what I needed to get balls rolling. Do I need to get myself an official ST-LINK V3 or similar to get External Power to work with PC/USB?

    Given I might use the same SW interface on the official prog (i.e. SWCLK, SWDIO, 3V3, GND), would the end result (fault?) not be the same as this V2.1?

    0693W000000WnodQAC.jpg

    Visitor II
    May 2, 2020

    There is nothing to visualize. I'm only trying to help because I've got little to do at the moment.

    The datasheet contains everything you need to know. The stlink header pinout is readily accessible. Connect pins according to their label​s.

    *Edited by Moderation*

    MecanixAuthor
    Visitor II
    May 2, 2020

    I am not bored troll. I am a mechanical engineer who've recently taken onto EEV and trying to wrap my head around several MCU technologies/circuits, particularly STM32. I am hoping to seek "best advice" from a professional/experienced community.

    Am I on the right forum??

    TDKAnswer
    Super User
    May 2, 2020

    The ST-Link programmer you have is not an official programmer. It's an even lower cost knock-off. But it probably works fine. I don't know if the 3V3 on your programmer is intended to power the board. I suspect it is. Whereas in the official programmers, the board needs to be self-powered. This is an important difference.

    Try to only connect GND, SWDIO, and SWCLK. Official programmers also connect NRST but it is not strictly needed.

    Here is a link with programmer schematic info:

    http://www.keil.com/support/man/docs/ulinkplus/ulinkplus_jtagswd_interface.htm

    MecanixAuthor
    Visitor II
    May 2, 2020

    Cheers Tim.

    Fair enough. Should have posted that '3rd party' programmer I was using initially, my bad. I'll see if I can get my hands on a ULINKplus locally or if not I'll crack on and get that official ST-Link V3 bundle on order. ps. that little programmer's 3V3 output is indeed to power-on the board, my understanding anyway. They do emit a rather fancy strobe effect when powered + eternally! hrr:/

    Thanks for linking me up to the right stuff Tim, appreciate it.

    Super User
    May 2, 2020

    You're welcome.

    If you want to transition to a real programmer, if you're putting a programming port on the board, the ST-Link V3 Mini is nice and cheap ($10). Seems to be out of stock a lot now, but that will change. It provides a VCP interface as well as the SWD programming interface which is useful for debugging.

    https://www.st.com/en/development-tools/stlink-v3mini.html

    Good luck.

    MecanixAuthor
    Visitor II
    May 2, 2020

    Here's its other side. It is supposedly The Best In The World programmer a fully loaded $3.49 can buy today. While at the supplier's shop and when asked; "Tool Me Up for STM32", I was given this only choice, quoting "you will never need more than that, it does it all" (lol) aka the SWO option the supplier referenced, I believe.

    Lesson learnt; let me get this fixed up right away, I'll order the right kit for the job(s). Thanks for pointing me in the right direction.

    0693W000000WnqjQAC.jpg

    Graduate II
    May 2, 2020

    > that little programmer's 3V3 output is indeed to power-on the board

    I highly doubt that, as it's only voltage regulator is U2, which is not be able to provide any decent amount of spare current for an additional board.

    SEGGER J-Link EDU Mini is another great debugger. But ST's Nucleo boards also have a header for programming other boards and can be reflashed to (and back) J-Link firmware to use SEGGER's software.

    MecanixAuthor
    Visitor II
    May 2, 2020

    Ah those micro SOT-23 LDOs! Good for up to 250mA, the Chinese claims they are good for up to 5A if you buy 50,000 reels, ofc (jjk).

    Served quite well at the breadboard stage to power up that prototype MCU, a debug LED and to start-up crystals type thing. It will also power up a 240X320 with 4x 20mA backlight LED without any significant temp change or anything major. Go figure. If only it could coexist an external supply it would be great but sadly that lil F1 poly stobes pretty quick when you do :\

    Anyway, already ordered both kits; one of those V3mini and that V3Set. Thanks for the SEGGER recommendation, I'll have a look for sure :thumbs_up: