STM32F767ZI CAN communication - not able to receive messages on CAN bus

12 views (last 30 days)
I've been trying to read CAN messages with a STM32F767ZI but could not get the CAN Receive block to work.
With an Osciloscope I can see CAN messages being sent by the sensor and the Rx activity on the tranceiver side. I've also run a "Digital Read" block to read the activity on PIN PB_8 which shows Rx signal in the Data Inspector (I commented the CAN Receive block while doing this so as not to have pin conflict). I can also blink LED while running the model.
Setup:
  • I have a CAN Aero pressure sensor connected to a CAN transceiver (TJA1050) terminated with 120ohms on both sides
  • Baudrate set to 500000bit/s
  • CAN Rx on PB_08; CAN Tx on PB_09
  • CAN transceiver is powered 5V from the board
  • CAN sensor is powered by external power supply 12V
CAN Rx signal on the transceiver side:
I've tried several things and searched all around foruns. A CAN example using STM32 would be really useful, meanwhile can Mathworks support help me to solve this?
  2 Comments
nguyen nhan tinh
nguyen nhan tinh on 14 Nov 2022
In folder: C:\ProgramData\MATLAB\SupportPackages\Rxxxx\toolbox\target\supportpackages\stmmbed\src
File: mwCanHalF7.c
Function: MW_configureCANFilter
Change:
nFilterConfig.SlaveStartFilterBank = 14;
to:
nFilterConfig.SlaveStartFilterBank = 0;
I-Tsun Wang
I-Tsun Wang on 20 Mar 2023
Hi @nguyen nhan tinh. I try to send (transmit) message from STM32F767ZI, but it keep sending errorframe to my canbus. I have check all the setting, have you done any successful transmitting test with STM32F767ZI and CAN shield (https://thepihut.com/products/rs485-can-shield?variant=37758354653379&currency=GBP&utm_medium=product_sync&utm_source=google&utm_content=sag_organic&utm_campaign=sag_organic&gclid=CjwKCAjwiOCgBhAgEiwAjv5whFhzH7XFRQcU_XhxXbcXkGuLshRtYqA15c43HfjLhW3g6VRbusaxyxoCi50QAvD_BwE)
Thank you.

Sign in to comment.

Answers (0)

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!