2024-12-13 03:09 AM - last edited on 2024-12-13 03:29 AM by Andrew Neil
Moved from the Feedback Forum
Hi,
1. Referring to below link, can we use this for STM32L562ZET6Q part without any change.
2. What changes are to be done to make use of USART3 (PC10,PC11) rather USART1 (PA9,PA10).
How to use the ST Open Bootloader for STM32 Microc... - STMicroelectronics Community
2024-12-13 06:39 AM
Hello @priyanka.yadav
To be able to use the UART3 instead of UART1 you should update the lines below in the file interfaces_conf.h.
#define USARTx USART1
#define USARTx_TX_PIN GPIO_PIN_9
#define USARTx_TX_GPIO_PORT GPIOA
#define USARTx_RX_PIN GPIO_PIN_10
#define USARTx_RX_GPIO_PORT GPIOA
#define USARTx_ALTERNATE GPIO_AF1_USART1
s
2024-12-16 01:05 AM
2024-12-16 01:22 AM
Hello @priyanka.yadav
Could you provide more details about your setup please?
2024-12-16 02:49 AM
Hello @Saket_Om ,
I'm running this code on STM32L562ZET6Q (our customized board using STM32L562ZET6Q). Running this "OpenBootloader" project to enable remote programming via UART communication interface.
On our board, we have already tested UART3 interface for remote programing, but the hurdle was that this required us to set the nBOOT0=0 (i.e keep this unchecked) using STLINK Debugger, to enable system bootloader instead of flash. So, I searched for OpenBootloader project which enable IAP using UART without need of debugger.
Thanks!
2024-12-16 05:26 AM
Did you activate the clock for GPIOC please?
2024-12-16 08:20 PM - edited 2024-12-17 01:19 AM
Hello @Saket_Om ,
Please let us know from where to enable clock for GPIOC group.
Do we also need to do BOOT0 pin PH3 as HIGH?
Also, does the OpenBootloader project contains .ioc file also?
Thanks.
2024-12-18 01:15 AM
Hello @priyanka.yadav
1) Please let us know from where to enable clock for GPIOC group.
The GPIOC clock can be enabled in the function OPENBL_USART_Configuration() in the file usart_interface.c.
void OPENBL_USART_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
/* Enable all resources clocks --------------------------------------------*/
/* Enable used GPIOx clocks */
__HAL_RCC_GPIOC_CLK_ENABLE();
/* Enable USART clock */
__HAL_RCC_USART3_CLK_ENABLE();
/* USARTx pins configuration -----------------------------------------------*/
GPIO_InitStruct.Pin = USARTx_TX_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
GPIO_InitStruct.Alternate = USARTx_ALTERNATE;
HAL_GPIO_Init(USARTx_TX_GPIO_PORT, &GPIO_InitStruct);
GPIO_InitStruct.Pin = USARTx_RX_PIN;
HAL_GPIO_Init(USARTx_RX_GPIO_PORT, &GPIO_InitStruct);
OPENBL_USART_Init();
}
2) Do we also need to do BOOT0 pin PH3 as HIGH?
Yes, the BOOT0 pin PH3 should be HIGH to boot on system bootloader. Please refer to the section "3.6 Boot modes" in the reference manual for more details.
2024-12-18 08:25 PM
Hello @Saket_Om ,
As per the highlighed text, I think Boot0 pin setting to 1 is not required at least for the OpenBootloader code presently I'm trying to use.
2024-12-22 10:17 PM
Hello @Saket_Om ,
Even after clock changes it's not recognizing UART3 interface.
When I try to debug the code, it stucks at "SystemClock_Config()".