2017-09-03 11:51 PM
2017-09-06 12:48 PM
Hi Chirag,
I had faced this problem with L031 board. Have a look at the schematics --
http://www.st.com/en/microcontrollers/stm32l476rg.html
and check if the UART pins i.e STLK_TX and STLK_RX are the same as configured using the STMCube. You can check the UART pins in a file that reads something like stm32l4xx_hal_msp.c, and search for void HAL_UART_MspInit(UART_HandleTypeDef* huart). To receive from hyperterminal these pins should match the UART pins mentioned in schematic.Hope this helps.
Regards,
Harsha
2017-09-06 01:53 PM
So what pins does this supposedly use? Save me having to dig through the docs for things you should already be aware of.
Does HAL_UART_Receive() return an error? When you uses a debugger what do you see in the buffer?
Note that an array with 10 elements has them numbered 0 thru 9
data1[10] = data[10]; // this is out side the bounds of the array, not clear on the purpose of this code
Try echoing back one character at a time.
2017-09-06 02:37 PM
Hi Chirag,
Can you confirm you are using USART2 with PD5 (USART_TX) and PD6 (USART_RX)? Is USART2 connected to PC through the ST-Link Virtual Com Port (VCP)? In such case, there is no modification needed on the board, and you should be able to send/receive through the VCP thanks to the ST-Link USB cable. See
User manual Discovery kit with STM32L476VG MCU § 7.9 USART configuration.I would not recommend to use PA2 and PA3 as I would conflict with JOY_RIGHT and JOY_UP (or you'll have to remove R52 & R56 resistors).
Regards
Bruno