2016-05-27 01:14 AM
Hello ST,
I am working on Bootloader application with the driver provided by ST (http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-standard-peripheral-libraries-expansions/stsw-stm32067.html♯).I have tested the default code using USART1 and everything works fine. My application needs to use USART2 for the same and after changing the usart configurations from USART1 to USART2, the Bootloader code is not working.It gets stuck in the USART_GetFlagStatus for ever and i cant get any thing printed on the terminal.Please help me to resolve this issue.Thanks in advance.Best,Krish #iap-bootloader #bootloader #stm322016-05-27 01:41 AM
Usart2 is on apb1 make sure you enable the clock on the correct bus.
2016-05-27 02:00 AM
Hi Clive,
Thanks for the quick reply. Yeah.. I have taken care of that clock... My settings are as follows#define EVAL_COM1 USART2 //USART3#define EVAL_COM1_CLK RCC_APB1Periph_USART2 //RCC_APB1Periph_USART3#define EVAL_COM1_TX_PIN GPIO_Pin_2 //GPIO_Pin_10#define EVAL_COM1_TX_GPIO_PORT GPIOA //GPIOC#define EVAL_COM1_TX_GPIO_CLK RCC_AHB1Periph_GPIOA //RCC_AHB1Periph_GPIOC#define EVAL_COM1_TX_SOURCE GPIO_PinSource2 //GPIO_PinSource10#define EVAL_COM1_TX_AF GPIO_AF_USART2 //GPIO_AF_USART3#define EVAL_COM1_RX_PIN GPIO_Pin_3 //GPIO_Pin_11#define EVAL_COM1_RX_GPIO_PORT GPIOA //GPIOC#define EVAL_COM1_RX_GPIO_CLK RCC_AHB1Periph_GPIOA //RCC_AHB1Periph_GPIOC#define EVAL_COM1_RX_SOURCE GPIO_PinSource3 //GPIO_PinSource11#define EVAL_COM1_RX_AF GPIO_AF_USART2 //GPIO_AF_USART3#define EVAL_COM1_IRQn USART2_IRQn //USART3_IRQnThanks.Best,Krish2016-05-27 02:23 AM
Hi n.krishna,
Which hardware you have used ? These are the only modification you have made in the code ? -Héannibal-2016-05-27 02:29 AM
Ok. But what bus is the EVAL_COM1_CLK being applied too? Bet it is not APB1
2016-05-27 02:57 AM
You are right clive... it is not applied to APB1. I changed it and everything works fine now.
Thanks a lot for quick responses. Really appreciate it.Best,Krish