cancel
Showing results for 
Search instead for 
Did you mean: 

Confusion in selecting boot mode.

DivergentV
Visitor

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
STTwo-32
ST Employee

Hello @DivergentV and welcome to the ST Community 😊.

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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?

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.

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

DivergentV
Visitor

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.

Yes

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Little missunderstand, you cant run your code with power on, but yes program it work allways.