stm32-mcu icon indicating copy to clipboard operation
stm32-mcu copied to clipboard

Application components for STMicro STM32 MCUs

Application components for STMicro STM32 MCUs

Toolchain: Migrating from TrueSTUDIO+CubeMX to STM32CubeIDE

Common libraries

NUCLEO-F401RE board

  • DCT Type-II implementation on CMSIS-DSP (also works on L4) including a zigzag scan utility function.

Application components

NUCLEO-F401RE board

  • Thermography (infrared array sensor) and rock-paper-scissors recogniton with Keras/TensorFlow
  • X-CUBE-AI (ML inference on MCU with 2D images from an infrared array sensor)
  • X-CUBE-BLE1 (BLE)

NUCLEO-L476RG board

  • HelloWorld
  • GPIO_Interrupt
  • Clock
  • CAN
  • MEMSMIC(MEMS mic expansion board)
  • ADC with DMA
  • DAC with triangular wave and sine wave
  • Mic->ADC->DAC pipeline
  • Sound Effector
  • Chirp compression

NUCLEO-F401RE and NUCLEO-L476RG boards

Dynamic NFC tags

  • ST25DV04K (NFC) on F401RE
  • ST25DV04K (NFC) on L476RG

STM32F4 Discovery board

  • Camera (CMOS image sensor OV7670)
  • BlueSwitch
  • HelloWorld
  • LED_blinking
  • PWM-output
  • AudioWeaver

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

  • CMSIS DSP RFFT pitfalls
  • Enabling DSP on STM32
  • PCM data resolution on STM32L4 DFSDM
  • Enabling printf on STM32

References

STM32L476 Nucleo-64

STM32F4 Discovery board