1
\$\begingroup\$

I have an STM32 board (blue pill) that I am programming with the Arduino IDE.

I couldn't program it using an FTDI adapter because I couldn't make the Arduino IDE communicate trough the USART for uploading codes, so I am using a ST LINK V2 to program the STM32.

On the other hand, once the program is on the STM32 I can use the FTDI to communicate to the STM32 via the USART using the COM ports.

So, I am planning to use the FTDI when running and the ST LINK adapter when uploading codes.

My question (before I short circuit something doing it):

Can I connect the two devices to the STM32 and leave them connected to the host PC with power ON? That way the only thing I have to do is selecting one for programming and the other one when running. The STM32 is never connected directly to the PC. See picture.

enter image description here

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Having multiple interfaces connected to a development target is fairly common. When they all go back to the same PC, it's also fairly simple.

You should really make sure that only one source is providing power (ie the positive power supply line) to the target, for example, the USB connector on the board.

Normally each interface should have a ground connection, eg a "common ground" with the target, and by extension every other system the target is connected to. When everything goes back to your laptop over short USB-derived interfaces, you can sometimes get away with being sloppy, but still it's better that each cable assembly have a ground.

Note that an SWD connection typically does not provide power, rather a supply line present on one is formally supposed to be used as an input to a better tier of SWD adapter which will adapt its signaling to the voltage at which the target is operating. You don't show any connection there, which is probably appropriate; your clone adapter doesn't adjust its voltage anyway, it could (in deviation from tradition) supply a small amount of current to a target that doesn't need much power, but in your setup you seem to have other means of powering the board.

Your drawing is too pixelated to be certain, but it appears that you may be powering the board through the FTDI adapter. While this may work, it is probably unwise; the internal regulator in an FTDI chip is really only meant to power the chip itself, and extremely low power auxiliary loads. Depending on what you are doing, you might get away with that, but really it is not the best idea. Your target board has its own regulator, which you should probably utilize either by feeding power through the USB connector or via some other 5v input line on the board.

\$\endgroup\$
2
  • \$\begingroup\$ Ok, sorry for the bad picture. Yes, the FTDI board is powering the STM32, and I am using the 3.3 V output from the FTDI. I will change it to the 5V output of the FTDI which I think comes directly from the PC and doesn’t go trough the regulator. \$\endgroup\$
    – Luis
    Commented Aug 10, 2020 at 15:26
  • \$\begingroup\$ Just make sure you connect that to the target's 5v regulator input :-) \$\endgroup\$ Commented Aug 10, 2020 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.