/STM32L4-HAL

HAL for STM32 B-L475E-IOT01A

Primary LanguageC

Blink LED:

void Blink(uint32_t delay);

Blink with a 500ms delay

Blink(500);

Transmit Data

void UART_Transmit(UART_HandleTypeDef *huart, uint8_t *data, uint16_t size);

Set USART1 to Asynchronous mode with:

  • Baud Rate: 115200
  • Data Bits: 8 (including parity)

Connect to the serial port with the set baud rate.

screen /dev/tty.usbmodem114203 115200

Now send data and the text should appear on the terminal.

uint8_t data[] = "Ping!\r\n";
UART_Transmit(&huart1, data, sizeof(data));

Note:

  • Add the -u _printf_float flag to the GCC linker.