AnsweredAssumed Answered

STM32f405RGT6 UART4 and USART3 TX problems

Question asked by ebisuzaki.tyler on Oct 31, 2014
Latest reply on Oct 31, 2014 by Clive One
I'm at wits end trying to figure out why exactly I can't transmit on UART4 or USART3.

The RX works, and i can receive data, however the TX pin is not working at all. Below is my configure code for UART4.

void init_usart4(uint32_t baudrate) {


  GPIO_InitTypeDef GPIO_InitStructure;
  USART_InitTypeDef USART_InitStructure;
  NVIC_InitTypeDef NVIC_InitStructure;


  RCC_APB1PeriphClockCmd(RCC_APB1Periph_UART4, ENABLE);


  /* GPIOA clock enable */
  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);


  /* GPIOA Configuration:  USART2 */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_11;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  GPIO_Init(GPIOC, &GPIO_InitStructure);


  /* Connect USART1 pins*/
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource10, GPIO_AF_UART4);
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource11, GPIO_AF_UART4);


  USART_InitStructure.USART_BaudRate = baudrate;
  USART_InitStructure.USART_WordLength = USART_WordLength_8b;
  USART_InitStructure.USART_StopBits = USART_StopBits_1;
  USART_InitStructure.USART_Parity = USART_Parity_No;
  USART_InitStructure.USART_HardwareFlowControl =
  USART_HardwareFlowControl_None;
  USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
  USART_Init(UART4, &USART_InitStructure);

  USART_Cmd(UART4, ENABLE);  // enable USART2
}

and in main i just loop and use "USART_SendData(UART4, 'h');" with a delay

I've scoped the pin and nothing is coming out of it either I've changed out MCU's completely thinking I might've got a bad one but that hasn't fixed it either

Outcomes