Skip to content

araobp/stm32-mcu

Repository files navigation

Application components for STMicro STM32 MCUs

Toolchain: Migrating from TrueSTUDIO+CubeMX to STM32CubeIDE

Common libraries

Application components

Dynamic NFC tags

printf issue

I managed to support printf on USART2.

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