Calling multiple time __HAL_UART_GET_FLAG in UART
When I try to print on the serial interface with SerialPrint function.
void SerialPrint(const char *serial_data, ...)
{
char uartbuffer[1024];
va_list arg;
va_start(arg, serial_data);
uint16_t len = vsnprintf(uartbuffer, 1024, serial_data, arg);
va_end(arg);
HAL_UART_Transmit(&huart2, (uint8_t *)uartbuffer, strlen(uartbuffer), 100);
}I am using this function end of the CAN1_Init function like this:
SerialPrint("CAN1 Initilizing successfull !!")
When I use like that, some reason that is I dont know I get flash registers initilize value not equals "0":
__HAL_FLASH_GET_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);
When I try to analyse this problem I debug in the HAL_UART_Transmit function and I found something. In the HAL_UART_Transmit If the print character size more than 10 In the UART_WaitOnFlagUntilTimeout A mean after coming to this line at least 10 times.
while((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status)
I saw the Flash flag set. I am trying to understand why this happening? as if repeatedly calling this __HAL_UART_GET_FLAG function gives flash bits error.
