AnsweredAssumed Answered

HAL UART issue

Question asked by NStuff on Oct 21, 2015
Latest reply on Oct 23, 2015 by NStuff
I tested the HAL function inside of main using something like this:

  uint8_t Heading[]="\n\r Send some text\n\r";
  if(HAL_UART_Transmit(&UartHandle, (uint8_t *)Heading, sizeof Heading -1, 0xFFFF) != HAL_OK)

This implementation worked great.
However, I wanted to use the function call within a secondary function so I didn't have to write out the whole thing over and over throughout the code. So I created this:
void Usart_Send_String (uint8_t *str)
     if(HAL_UART_Transmit(&UartHandle, str, sizeof str -1, 0xFFFF) != HAL_OK)
} /* end of function Usart_Send_String */

When I use the following, it stops working:
  uint8_t Heading[]="\n\r Send some text\n\r";

I've tried changing the pointers and such but not much luck. Am I missing something? There isn't much documentation to the use of the HAL.

I'm used to the old STDFWLIB and USART_SendData used to work on prior systems.