cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411 IAP using the USART2 not working

krishna23
Associate II
Posted on May 27, 2016 at 10:14

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 #stm32
5 REPLIES 5
Posted on May 27, 2016 at 10:41

Usart2 is on apb1 make sure you enable the clock on the correct bus.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
krishna23
Associate II
Posted on May 27, 2016 at 11:00

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_IRQn

Thanks.

Best,

Krish

Walid FTITI_O
Senior II
Posted on May 27, 2016 at 11:23

Hi n.krishna,

Which hardware you have used ?

These are the only modification you have made in the code ?

-Héannibal-

Posted on May 27, 2016 at 11:29

Ok. But what bus is the EVAL_COM1_CLK being applied too? Bet it is not APB1

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
krishna23
Associate II
Posted on May 27, 2016 at 11:57

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