Skip to main content
Visitor II
March 25, 2023
Question

I am new to STMicro products. How do I connect an STM32l010F4 to an ST-link programmer? Is there a document that explicitly states which STM32l010F4 pin connects to which ST-link pin?

  • March 25, 2023
  • 6 replies
  • 3777 views

I do not have room on my board for a large connector, so I need to create a custom cable. The STM32l010F4 boots via USART, yet I cannot find anything in the ST-link docs that says "connect this pin to usart Tx, and this one to the usart rx, etc.

If someone could point me to a dcoument, I would appreciate it.

    This topic has been closed for replies.

    6 replies

    Graduate II
    March 25, 2023

    Cortex-M0(+) parts generally a header perhaps exports SWDIO, SWCLK, NRST and GND.

    The pods with buffering chips would also want to see VTarget (VCC) to match the levels used in your system.

    The 10-pin SWD connectors aren't massive, there's also Tag-Connect type foot prints, or you could put debug/tag connectors on break off stalks or edge castellations, etc.

    The ST-LINK/V2 doesn't have a USART

    The ST-LINK/V3 does, and has a diagram in the manual

    LGoye.1Author
    Visitor II
    March 25, 2023

    Hi Tesla,

    Ok, I messed up and entered this as an answer rather than hit reply. Sorry about that.

    I looked at the various st-link V3 data sheets, and I still don't see a table that explicitly states "usart Tx ties to this pin".

    It may be a terminology problem. These devices only program via the USART.

    Which manual were you referring to that has a wiring diagram?

    Thanks for your help.

    Graduate II
    March 25, 2023

    For UART programming, check App Note AN2606

    Typically want to export RX, TX, NRST, BOOT(0), GND

    LGoye.1Author
    Visitor II
    March 25, 2023

    Hi Tesla,

    I looked at the various st-link V3 data sheets, and I still don't see a table that explicitly states "usart Tx ties to this pin".

    It may be a terminology problem. These devices only program via the USART.

    Which manual were you referring to that has a wiring diagram?

    Thanks for your help.

    Visitor II
    March 25, 2023

    If the goal is to program the flash non volatile memory of the microcontroller, you can use the ARM SWD debug link which requires RESET/SWDCLK/SWDIO and optionally control manually the BOOT pin.

    The USART RS232 interface is only if you want to program the chip with the BOOT pin and the USART interface, without SWD. That is more for programming lots of boards, while SWD is for debug, program, run, breakpoint, etc...

    If you look at the STLinkV3minie the signals are well described through for example the STM32C0316-DK schematics. The main extra feature of the minie is that it adapts to different target MCU operating voltage (1.8 to 3.6V) through a level shifter chip.

    Technical Moderator
    March 27, 2023

    Hello @LGoye.1​ 

    As mentioned by Tesla, you can find in AN2606 STM32 microcontroller system memory boot mode - Application note the hardware resources used by this bootloader.

    In section, 54 STM32L01xxx/02xxx devices bootloader, you can find the USART's programming setup.

    0693W00000aJkjKQAS.pngHope this helps!

    LGoye.1Author
    Visitor II
    March 27, 2023

    Thanks your your help. I was wondering how to program the processor using the usart, i.e., how to program through the usart rather than through SWD.

    I still feel this is poorly documented.

    I found a post elsewhere that claimed the cube software will recognize a FTDI USB to serial device. I have not verified this yet, but if it works that answers my question.

    Leo

    Graduate II
    March 27, 2023

    >>I still feel this is poorly documented.

    The USART methods have been documented for the best part of 15 years, I don't think that's the problem here.

    https://www.st.com/resource/en/application_note/an3155-usart-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

    The STM32 Cube Programmer has COM/UART communication options. There are older applications, and also open-source examples, and the protocol isn't exactly hard to implement from scratch.

    Graduate
    March 27, 2023

    Putting together information in posts above:

    You could use an FTDI USB to TTL cable with STM32CubeProgrammer application to program your microcontroller.

    FTDI Tx goes to pin PA10 or PA3, FTDI Rx goes to PA9 or PA2. FTDI GND goes to a microcontroller VSS pin.

    Set BOOT0 pin / NBOOT option bits to boot from system memory (i.e., bootloader). Run STM32CubeProgrammer, select UART with Port set to COM port corresponding to FTDI USB to TTL cable. Use Even parity. Open firmware file to be programmed, press Download button.

    LGoye.1Author
    Visitor II
    March 27, 2023

    Hi Chris,

    Thank you. I had figured that out, but I appreciate you taking the time to state it so succinctly.

    Thanks to you and everyone who helped me figure this out!

    Leo