/stm32-mcu

Application components for STMicro STM32 MCUs

Primary LanguageC

Application components for STMicro STM32 MCUs

STMicro has given me NUCLEO-L476RG and NUCLEO-F401RE with expansion boards for free at trade shows in year 2018. Thanks a lot to STMicro!

Toolchain:

Common libraries

Application components

printf issue

I managed to support printf on USART2.

UART

Physical configuration:

STM32F407
               +------------+
            X 5V            |
GND     ----- GND  FTDI     |
PA3(RX) ----- TX  USB-UART  ===== USB ======> PC
PA2(TX) ----- RX  converter |
               +------------+

Include the following snippet in main.c to support printf:

int _write(int file, char *pbuf, int len)
{
  HAL_UART_Transmit(&huart2, (uint8_t *)pbuf, len, 1000);
  return len;
}

PWM test

PWM output (100Hz, 50% duty) to PA8:

waveform

Tips

References

STM32L476 Nucleo-64

STM32F4 Discovery board