Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

STM32H7 FDCAN Normal Mode

Overview

This code demonstrates Classical CAN communication using the FDCAN peripheral on an STM32H7 microcontroller with STM32 HAL drivers. It includes CAN message transmission, interrupt-driven message reception, standard ID filtering, and GPIO-based reception indication.

The system periodically transmits CAN frames and listens for incoming messages using RX FIFO0 callbacks. When a new CAN frame is received, a GPIO pin is toggled to provide a simple hardware-level indication of successful reception.


Hardware Used

  • STM32H723ZGT Development Board
  • CAN Transceiver : TJA1057 and MCP2551

Software Used

  • STM32CubeIDE

CAN Configuration

Pin Configuration

image

Transmission

  • Standard Identifier: 0x11
  • Data Length: 8 bytes
  • Frame Type: Data Frame
  • Format: Classical CAN
  • Bit Rate Switch: Disabled
  • Nominal Baud Rate: 500 Kbps

Reception

  • RX FIFO0 interrupt enabled
  • Standard ID range filter configured from 0x00 to 0xFF
  • Callback function: HAL_FDCAN_RxFifo0Callback()

Example Transmitted Data

1, 2, 3, 4, 5, 6, 7, 8

Project Structure

STM32H7_NormalMode/
├── Core/
│   ├── Inc/
│   └── Src/
├── Drivers/
├── Debug/
├── .project
├── .cproject
└── README.md

Applications

  • Communication between BMS Master and Rear VCU

Future Improvements

  • CAN message formatting for motor controllers
  • Implementing FDCAN and Bitrate switching

Author

Krish Gupta


About

STM32 FDCAN communication using HAL drivers for CAN message transmission, reception, filtering, and interrupt-based FIFO handling on STM32H7

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages