Skip to main content
jeffl.kelley9
Associate III
July 16, 2020
Question

STM32L496VGT6 - Does anyone know for a fact that receive works on USART3? Please no "assumptions" -- I already did that.

  • July 16, 2020
  • 3 replies
  • 880 views

Transmit works to PC via FTDI cable.

Receive works from PC to PC (TXRX looped) So FTDI transmit working.

Receive generates no interrupt.

Receive sets no status.

Receive data register remains zero.

As GPIO, receive pin sees signal.

It is as if the alternate function value was programmed wrong -- but it is not.

Using PD9. However, a reconfigure to PC11 also fails.

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
July 16, 2020

Not a chip/board I have, constituency here likely to be relatively low.

Got a NUCLEO-L4A6ZG, close enough?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
jeffl.kelley9
Associate III
July 16, 2020

Probably not. The same software works on USART1 or 2, so if it is a programming problem it relates to some special feature of USART3 or some bug that effects only that peripheral.

waclawek.jan
Super User
July 16, 2020

Isn't L4A6 the same chip (crypto enabled version)?

> It is as if the alternate function value was

> programmed wrong -- but it is not.

How do you know? Did you read out the GPIO registers? Post them, together with the UART registers.

JW

Tesla DeLorean
Guru
July 17, 2020

>>Isn't L4A6 the same chip (crypto enabled version)?

Yes, exact same die

Ok, NUCLEO-L4A6ZG, LPUART1 PG7/PG8 VCP, ARDUINO D0 (PD9 USART3-RX), here connected to a GNSS receiver shield at 38400 baud forwarding the VCP

Core=80000000, 80.00 MHz

CPUID 410FC241 DEVID 461 REVID 2000

Cortex M4 r0p1

C0000018 20000EC0 00000000

10110021 11000011 00000000

FPU-S Single-precision only

STM32L496xx or L4A6xx

HCLK=80000000

APB1=80000000

APB2=80000000

Infinite Loop...

$GNRMC,,V,,,,,,,,,,N,V*37

$GNVTG,,,,,,,,,N*2E

$GNGGA,,,,,,0,00,99.99,,,,,,*56

$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99,1*33

$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99,2*30

$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99,3*31

$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99,4*36

$GPGSV,1,1,00,*55

$GPGSV,1,1,00,*55

$GLGSV,1,1,00,*49

$GLGSV,1,1,00,*49

$GAGSV,1,1,00,*44

$GAGSV,1,1,00,*44

$GBGSV,1,1,00,*47

$GBGSV,1,1,00,*47

$GNGLL,,,,,,V,N*7A

$GNRMC,,V,,,,,,,,,,N,V*37

$GNVTG,,,,,,,,,N*2E

Conclusion USART3 works just fine

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
July 17, 2020
void USART3_Init(void) // USART3 PD8/PD9
 {
 UART_HandleTypeDef UartHandle = {0};
 GPIO_InitTypeDef GPIO_InitStruct = {0};
 
 /*##-1- Enable peripherals and GPIO Clocks #################################*/
 /* Enable GPIO TX/RX clock */
 __HAL_RCC_GPIOD_CLK_ENABLE();
 
 /* Enable USARTx clock */
 __HAL_RCC_USART3_CLK_ENABLE();
 
 /*##-2- Configure peripheral GPIO ##########################################*/
 /* UART TX/RX GPIO pin configuration */
 GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_9;
 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 GPIO_InitStruct.Pull = GPIO_PULLUP;
 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
 GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
 
 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
 
/*##-1- Configure the UART peripheral ######################################*/
 /* Put the USART peripheral in the Asynchronous mode (UART Mode) */
 UartHandle.Instance = USART3;
 
 UartHandle.Init.BaudRate = 38400;
 UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
 UartHandle.Init.StopBits = UART_STOPBITS_1;
 UartHandle.Init.Parity = UART_PARITY_NONE;
 UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
 UartHandle.Init.Mode = UART_MODE_TX_RX;
 UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
 
 if (HAL_UART_Init(&UartHandle) != HAL_OK)
 {
 /* Initialization Error */
 Error_Handler();
 }
} // sourcer32@gmail.com

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..