Electrical – Flashing program into microcontroller, usb-ttl, idea behind

ftdimicrocontrollerserialttluart

I have limited knowledge on this topic(MCUs, communication protocols, etc.). I back then worked with an STM32 MCU and did some UART(or USART, can't remember) communication between a PC and the MCU. While I was doing that, I was using on-board ST-LINK programmer/debugger to load my programs into the MCU(F4 Discovery board, to be specific).

Now, while I was doing U(S)ART, I had to configure corresponding pins as U(S)ART alternate function along with configuring U(S)ART peripheral registers.

I recently, looking for programming so called Blue Pill board based on STM32F103Cxx MCU. The point I did not understand is, they(the tutorial owners) don't do a configuration for U(S)ART or so. Generally, they just replace a jumper from one location to another and be able to load programs via USB to TTL converters.

So, what is the exact working behind this, why don't they need to set some pins as U(S)ART Rx or Tx for example?

Another little question, I see some products sold as "FTDI programmer". Now, I do have a Prolific USB to TTL/Serial converter. Will there be a difference in functionality, can I use any USB to TTL converter for programming the MCU? I mean, does that "programmer" have a meaning, or just a naming?

Thanks.

Best Answer

It's hard to know exactly what you are describing, but there's a likely case which would fit your description.

Now, while I was doing U(S)ART, I had to configure corresponding pins as U(S)ART alternate function along with configuring U(S)ART peripheral registers.

This would be the case when the program you are writing yourself wants to do serial communication.

I recently, looking for programming so called Blue Pill board based on STM32F103Cxx MCU. The point I did not understand is, they(the tutorial owners) don't do a configuration for U(S)ART or so. Generally, they just replace a jumper from one location to another and be able to load programs via USB to TTL converters.

This sounds like uploading new code to be received by the chip's factory ROM bootloader. In that case, your custom code is not yet what is running on the chip, rather the factory ROM program that functions as a bootloader is. And since that program is trying to do serial communication, ST's engineers wrote it to appropriately configure the various peripherals it is trying to use.

Another little question, I see some products sold as "FTDI programmer". Now, I do have a Prolific USB to TTL/Serial converter. Will there be a difference in functionality, can I use any USB to TTL converter for programming the MCU? I mean, does that "programmer" have a meaning, or just a naming?

This could mean many different things, particularly with hobby/gray-market online sellers.

FTDI (as well as prolific) are IC makers, not particular ICs. Often references to an FTDI converter would mean a part such as the FT232RL or similar, which is mostly a USB to asynchronous serial bridge with a few added capabilities. That, or the competing chip from Prolific (or the counterfeit fake of it that you likely actually have) would be generally suitable for asynchronous serial communication with a bootloader.

But some of FTDI's other parts like the FT2232 series can also do a fairly good job of arbitrary synchronous serial communication, which lets them do things like implement JTAG or SWD protocols (or ATmega ISP) for more directly communicating with the chip, programming it without going through the bootloader, doing breakpoint debugging, etc. These capabilities are necessarily chip- and brand- unique in how they function and are used by whatever PC software is operating them. Though that PC software itself may abstract that out to a fairly similar set of user commands/operations.