https://github.com/stm32-hotspot/ckb-stm32-bxcan-loopback
This is an example tailored to different STM32 Nucleo boards demonstrating how to configure the bxCAN in loop back mode running at 500kb/s.
https://github.com/stm32-hotspot/ckb-stm32-bxcan-loopback
can controller-area-network loopback stm32 stm32-nucleo-board stm32f1 stm32f2 stm32f3 stm32f4 stm32f7
Last synced: 11 months ago
JSON representation
This is an example tailored to different STM32 Nucleo boards demonstrating how to configure the bxCAN in loop back mode running at 500kb/s.
- Host: GitHub
- URL: https://github.com/stm32-hotspot/ckb-stm32-bxcan-loopback
- Owner: stm32-hotspot
- License: other
- Created: 2025-02-12T09:44:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-19T13:59:20.000Z (about 1 year ago)
- Last Synced: 2025-03-19T14:31:25.392Z (about 1 year ago)
- Topics: can, controller-area-network, loopback, stm32, stm32-nucleo-board, stm32f1, stm32f2, stm32f3, stm32f4, stm32f7
- Language: C
- Homepage:
- Size: 1.38 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# bxCAN in Loopback mode on several STM32 platforms
## Summary
The purpose of this example is to provide the bxCAN configuration in Loop Back mode in different platforms.
## Hardware
This example is provided for the following platforms and can be tailored for any other STM32 platform, provided the MCU features an FDCAN interface:
* NUCLEO-F103RE (STM32F103RE)
* NUCLEO-F207ZG (STM32F207ZG)
* NUCLEO-F302R8 (STM32F302R8)
* NUCLEO-F439ZI (STM32F439ZI)
* NUCLEO-F767ZI (STM32F767ZI)
The example can be tailored to any MCU featuring CAN interface.
## How to use this example
1. Build the project corresponding to your STM32 board, then load the generated image into memory.
2. After compiling the project and staring the debug, you can add the TxData and RxData to the “Live Expressions” to check how they will be updated during the application running.
3. If you have a logic analyzer featuring a CAN analyzer you can probe the transmitted CAN frames on CAN_Tx pin.
## Frames captured by Saleae Logic analyzer on NUCLEO-F103RE
Zoom out of a capture on the CAN_Tx pin:

Zoom in of a capture on the CAN_Tx pin, the first frame sent by the application:

The pulses related to the zeroed data are stuffed bits that correspond to the the bit stuffing mechanism.
## Additional resources
Please refer to [this](https://community.st.com/t5/stm32-mcus/guide-to-can-bxcan-can2-0-configuration-in-loop-back-mode-on/ta-p/771119) article for the timing configuration and the hardware setup to correctly run this example on a specific platform.
## Questions & Feedback
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.