Skip to main content
Graduate
August 13, 2024
Solved

Confusion in selecting boot mode.

  • August 13, 2024
  • 2 replies
  • 1757 views

Hello guys, 

I am trying to make a development board using STM32G070KBT6 MCU, I want to add two modes to program flash memory 

1. UART

2. SWD

but the PA14-BOOT0 share a common pin, I have looked online for suggestions but am a bit confused now, can anyone give a final solution if I want to use both UART and SWD to upload code and a bit reference on how to do it 

if I have to add a circuit part or change bits, I only want these to upload code to my MCU.

    This topic has been closed for replies.
    Best answer by STTwo-32

    You can use any of the Pattern11 propositions to go to boot mode:

    STTwo32_0-1723565693043.png

    So, you can use the first one that does not need to use the boot0 pin.

    PS: STM32G070x devices do not have BOOT_LOCK (bit), consider that when using Pattern 11.

    Best Regards.

    STTwo-32

    2 replies

    Technical Moderator
    August 13, 2024

    Hello @DivergentV and welcome to the ST Community :smiling_face_with_smiling_eyes:.

    If you are talking about the common pins for USART2 and SWD, you have to use PA2 and PA3 for the USART2 and then there is no conflict.

    Best Regards.

    STTwo-32

    Graduate
    August 13, 2024

    Hi @STTwo-32 , thanks for replying, 

    BOOT0 pin has a role in selecting the boot mode if I use USART2 without changing BOOT0 bits will it be fine, will I be able to use both SWD and UART mode of programming?

    Graduate II
    August 13, 2024

    When i good rememmber this boot pin is sampled on reset rising edge, then only this state have function. After this is GPIO. Too can be masked with option bytes. All info in AN2606.

    Graduate
    August 13, 2024

    DivergentV_0-1723566614794.png

    @STTwo-32 @MM..1 

    Hey guys for the final verdict that I understood everything, I selected the nBoot0(bit)=0,nBoot1(bit)=1,nBoot0_SEL(bit)= 1 and BOOT_LOCK(bit)=0 from the cube programmer and then I can use both the programming option UART and SWD without worrying about the Boot0 pin.

    I have also attached the schematic just for these programming interfaces, also suggest if I have to add anything related to programming.

    Technical Moderator
    August 13, 2024

    Yes

    Best Regards.

    STTwo-32