AnsweredAssumed Answered

USART1 work fine not any other on STM32F429 Disco

Question asked by singhi.kapil on Aug 14, 2014
Latest reply on Aug 14, 2014 by Clive One
Hello All

I am working on STM32F429 with TFT and using DISCOVERY DISCO board

Trying to use 2 UARTS ->>>> UART1 and UART 4 or 6

UART4 with PA0 and PA1 pins PA0 is tied to switch but it should show some activity.
No Tx or Rx is working whereas same thing work fine on USART 1  

Able to run UART1 and is working fine but nor any other! 

I am using real-term console for this experiment and have leds on my USB to serial for displaying any activity.

its really frustrating..... 

Following is my code May be i am doing some thing wrong

1.//***************************** USART_SETUP *******************************<br>void USART_SETUP(void)<br>{<br>    GPIO_InitTypeDef GPIO_InitStructure;<br>    USART_InitTypeDef USART_InitStruct;<br>    <br>    RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);<br>    RCC_APB2PeriphClockCmd(RCC_APB1Periph_UART4, ENABLE);<br>//    RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART6, ENABLE);<br>    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);<br>    /*<br><br><br>    -------------------------- USART1 ---------------------------<br>            PA9  is USART1_TX<br>            PA10 is USART1_RX<br><br><br>xxxxxxxxxxx PB6  is USART1_TX<br>            PB7  is USART1_RX<br><br><br>    -------------------------- USART2 ---------------------------<br>            PA2  is USART1_TX<br>xxxxxxxxxxx PA3  is USART1_RX<br>            <br>            PD5  is USART1_TX<br>xxxxxxxxxxx PD6  is USART1_RX<br>            <br>    -------------------------- USART3 ---------------------------<br>xxxxxxxxxxx PB10 is USART1_TX<br>xxxxxxxxxxx PB11 is USART1_RX<br>            <br>xxxxxxxxxxx PC10 is USART1_TX<br>            PC11 is USART1_RX<br>            <br>xxxxxxxxxxx PD8  is USART1_TX<br>xxxxxxxxxxx PD9  is USART1_RX<br><br><br>    -------------------------- USART4 ---------------------------<br>            PA0  is USART1_TX<br>            PA1  is USART1_RX<br>            <br>xxxxxxxxxxx PC10 is USART1_TX<br>            PC11 is USART1_RX<br>            <br>    -------------------------- USART5 ---------------------------<br>            PC12 is USART1_TX<br>            PC2  is USART1_RX<br>            <br>    -------------------------- USART6 ---------------------------<br>xxxxxxxxxxx PC6  is USART1_TX<br>xxxxxxxxxxx PC7  is USART1_RX<br>            <br>            PG14 is USART1_TX<br>            PG9  is USART1_RX<br>            <br>    -------------------------- USART7 ---------------------------<br>xxxxxxxxxxx PE8  is USART1_TX<br>xxxxxxxxxxx PE7  is USART1_RX<br>            <br>            PF7  is USART1_TX<br>            PF6  is USART1_RX<br>            <br>    -------------------------- USART8 ---------------------------<br>xxxxxxxxxxx PE1  is USART1_TX<br>xxxxxxxxxxx PE0  is USART1_RX<br>    */                                       <br><br><br>/////// Configure USART1 Rx (PA10) as input<br>    GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_10;   <br>    GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF;<br>    GPIO_Init(GPIOA, &GPIO_InitStructure);<br>  <br>/////// Configure USART1 Tx (PA9) as alternate function<br>    GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_9;<br>    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;<br>    GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF;<br>    GPIO_Init(GPIOA, &GPIO_InitStructure);    <br>    <br>    GPIO_PinAFConfig(GPIOA,GPIO_PinSource9,GPIO_AF_USART1);<br>    GPIO_PinAFConfig(GPIOA,GPIO_PinSource10,GPIO_AF_USART1);<br><br><br><br><br>    <br>   // Configure UART4 Rx (PA1) as input<br>    GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_1;   <br>    GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF;<br>    GPIO_Init(GPIOA, &GPIO_InitStructure);<br>  <br>    // Configure UART4 Tx (PA0) as alternate function<br>    GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_0;<br>    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;<br>    GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF;<br>    GPIO_Init(GPIOA, &GPIO_InitStructure);    <br>    <br>    GPIO_PinAFConfig(GPIOA,GPIO_PinSource0 ,GPIO_AF_UART4);<br>    GPIO_PinAFConfig(GPIOA,GPIO_PinSource1 ,GPIO_AF_UART4);<br>    <br>    <br>    <br>    <br>    <br>   // Configure USART6 Rx (PG9) as input<br>    GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_9;   <br>    GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF;<br>    GPIO_Init(GPIOG, &GPIO_InitStructure);<br>  <br>    // Configure USART6 Tx (PG14) as alternate function<br>    GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_14;<br>    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;<br>    GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF;<br>    GPIO_Init(GPIOG, &GPIO_InitStructure);    <br>    <br>    GPIO_PinAFConfig(GPIOG,GPIO_PinSource9 ,GPIO_AF_USART6);<br>    GPIO_PinAFConfig(GPIOG,GPIO_PinSource14,GPIO_AF_USART6);<br>    <br>    /* USARTx configured as follow:<br>        - BaudRate = 9600 baud  <br>        - Word Length = 8 Bits<br>        - One Stop Bit<br>        - No parity<br>        - Hardware flow control disabled (RTS and CTS signals)<br>        - Receive and transmit enabled<br>  */<br>  USART_InitStruct.USART_BaudRate = 57600;<br>  USART_InitStruct.USART_WordLength = USART_WordLength_8b;<br>  USART_InitStruct.USART_StopBits = USART_StopBits_1;<br>  USART_InitStruct.USART_Parity = USART_Parity_No;<br>  USART_InitStruct.USART_HardwareFlowControl = USART_HardwareFlowControl_None;<br>  USART_InitStruct.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;<br>  USART_Init(USART1, &USART_InitStruct);<br><br><br>  USART_InitStruct.USART_BaudRate = 9600;<br>  USART_InitStruct.USART_WordLength = USART_WordLength_8b;<br>  USART_InitStruct.USART_StopBits = USART_StopBits_1;<br>  USART_InitStruct.USART_Parity = USART_Parity_No;<br>  USART_InitStruct.USART_HardwareFlowControl = USART_HardwareFlowControl_None;<br>  USART_InitStruct.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;<br>  USART_Init(UART4, &USART_InitStruct);<br><br><br>  USART_Cmd(USART1, ENABLE);<br>  USART_Cmd(UART4, ENABLE);<br>}<br><div></div>



 

Outcomes