2024-08-13 08:29 AM
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.
Solved! Go to Solution.
2024-08-13 09:17 AM - last edited on 2024-08-13 09:19 AM by MM..1
You can use any of the Pattern11 propositions to go to boot mode:
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.
2024-08-13 08:46 AM
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
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.
2024-08-13 08:53 AM
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?
2024-08-13 09:14 AM
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.
2024-08-13 09:17 AM - last edited on 2024-08-13 09:19 AM by MM..1
You can use any of the Pattern11 propositions to go to boot mode:
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.
2024-08-13 09:35 AM - edited 2024-08-13 09:36 AM
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.
2024-08-13 09:40 AM
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.
2024-08-13 09:44 AM
Little missunderstand, you cant run your code with power on, but yes program it work allways.