STM32Cube  Version 2.0
Create Projects for STM32F0 Series with STM32Cube HAL and STM32CubeMX
 All Files Pages
CMSIS-Driver CAN Setup

The CMSIS-Driver CAN requires:

  • Setup of APB1 Clock (maximum frequency is 48 MHz)
  • Configuration of CAN

Valid settings for various evaluation boards are listed in the table below:

Peripheral Resource STM32091C-EVAL
CAN Peripheral CAN
CAN Mode Master Mode
RX Pin PD0
TX Pin PD1

For different boards, refer to the hardware schematics to reflect correct setup values.

The STM32CubeMX configuration for STMicroelectronics STM32091C-EVAL Board with steps for Pinout, Clock, and System Configuration are listed below. Enter the values that are marked bold.

Pinout tab

  1. Configure peripheral
    • Peripherals CAN: Mode=Master Mode
  2. Configure pins PD0 and PD1 as CAN peripheral alternative pins
    • Click in chip diagram on pin PD0 and select CAN_RX
    • Click in chip diagram on pin PD1 and select CAN_TX

Clock Configuration tab

  1. Configure APB1 Clock (maximum frequency is 48 MHz)
    • Setup "APB1 peripheral clocks (MHz)" to match application requirements

Configuration tab

  1. Under Connectivity open CAN Configuration:
    • Parameter Settings: not used
    • User Constants: not used
    • NVIC Settings: enable interrupts
      Interrupt Table Enabled Preemption Priority
      HDMI-CEC and CAN interrupts.. OFF 0
    • GPIO Settings: review settings, no changes required
      Pin Name Signal on Pin GPIO output..GPIO mode GPIO Pull-up/Pull..Maximum out Fast Mode User Label
      PD0 CAN_RX n/a Alternate ..No pull up and no..Low n/a .
      PD1 CAN_TX n/a Alternate ..No pull up and no..Low n/a .
      Click OK to close the CAN Configuration dialog