cancel
Showing results for 
Search instead for 
Did you mean: 

UART Communication for STM32L4 in KEIL

K_P_D
Associate II
Posted on March 28, 2018 at 14:14

Hi,

I am newbie to this STM32L4 Controller. I am working on GPS device to get the location of the location and i am using the CubeMax and Keil software for programming. As i have mention that i am newbie, I dont know how do I move forward.

I want to Learn the programming in Keil and with their HAL Drive and all. I am using the UART-2 in STM32L4 controller to communicate between the GPS and controller. Here I have used the UART HAL Driver for communication, but i properly dont know that how i should pass argument i that HAL driver function for communication. 

So please share and guide for this UART Communication using HAL Driver in keil. And also share if their is any study material available for this.

I my code HALL function defined like this:

'HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout);'

And i have pass the argument like this:

'HAL_UART_Transmit(&huart2 ,(uint8_t*)&buffer,20,1000); '

In buffer i have assigned the AT+QGPSCFG to send the AT command to communicate between the GPS and the Controller.  If their is any problem in code please let me know.

Please share me the proper details for this.

Thanks 

Sachin

13 REPLIES 13
Posted on March 29, 2018 at 10:47

okay

Andrew

, I got your point that HAL is an ST thing . 

And I have referred your suggested cross point.

Posted on March 29, 2018 at 12:04

sachin singh wrote:

I am experienced with the micro-controller as well as with C language.

So where's the problem?

You should be familiar with how to approach a project like this.

  1. Start with something simple - sending 'Hello, World' out of the UART;
  2. Try receiving text - maybe just echo it straight back;
  3. etc, ...
Posted on March 29, 2018 at 12:15

and yet the OP says,

I am experienced with the micro-controller as well as with C language

Something doesn't stack up!

EDIT

See: 

https://www.avrfreaks.net/comment/2312886&sharpcomment-2312886

 
Posted on March 29, 2018 at 12:26

I suppose the auto-generated Cube framework code poses a problems here for the OP.

As it does for me, especially regarding the motivation behind it's structure and ressource usage.

That's why I don't use or support it.