STM32Cube  Version 2.1
Create Projects for STM32F3 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 36 MHz)
  • Configuration of CAN

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

Peripheral Resource STM32303C-EVAL STM32303E-EVAL STM32373C-EVAL STM32F3348-DISCO STM32F3DISCOVERY
CAN Peripheral CAN CAN CAN n/a n/a
CAN Mode Master Mode Master Mode Master Mode n/a n/a
CAN_RX pin PD0 PD0 PD0 n/a n/a
CAN_TX pin PD1 PD1 PD1 n/a n/a

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

The STM32CubeMX configuration for STMicroelectronics STM32373C-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 36 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 Sub Priority
      CAN TX interrupts OFF 0 0
      CAN RX0 interrupts OFF 0 0
      CAN RX1 interrupts OFF 0 0
      CAN SCE interrupts OFF 0 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