STM32F767ZI CAN communication - not able to receive messages on CAN bus
7 次查看(过去 30 天)
显示 更早的评论
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 个评论
nguyen nhan tinh
2022-11-14
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
2023-3-20
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¤cy=GBP&utm_medium=product_sync&utm_source=google&utm_content=sag_organic&utm_campaign=sag_organic&gclid=CjwKCAjwiOCgBhAgEiwAjv5whFhzH7XFRQcU_XhxXbcXkGuLshRtYqA15c43HfjLhW3g6VRbusaxyxoCi50QAvD_BwE)
Thank you.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Embedded Coder Support Package for STMicroelectronics STM32 Processors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!