2024-02-13 10:55 AM - edited 2024-02-13 10:56 AM
Hello,
I am using stm32F407VGT board and I am trying to receive data from a can analyzer with stm32 board. I transmit a data to stm32 boards but ı cant receive the messages. I can work on normal mode with two stm32 boards succesfully. The messages are received and transmitted. At the same time, I want to transmit data to can analyzer and I want to observe communication. I attached my main and interrupt source files and I am using USB-CAN analyzerV8 device. The can bps values are the same 500kbps. The modes are same as Normal Mode and I dont define a filter so ı can read every data that ı sent from can analyzer in live expression on debug screen.
Summarize,
All my purpose, I want to see data that ı sent from can analyzer in my live expression part. I am sending one message fisrtly so there is a one Id.
2024-02-16 02:57 AM
2024-02-16 07:53 AM
Have you checked with an oscilloscope to be sure there is some data activity on the CAN wires?
2024-02-16 08:04 AM - edited 2024-02-16 08:05 AM
Your diagram is OK.
But now regarding your code:
2024-02-16 11:08 AM
I already used callbacks in my code that I atteched and It doesnt work either. I will use an oscilloscope and check the canbus line signals. In addition, There is no sFilterConfig.FilterMaskIdLow=0x000 yes I forgot it but does ıt really affect my project ?
And If I write the code in Can registers and use ınstances , does the possibility of working project increase ? I mean, I can start the CAN with register instead of using HAL lib.
2024-02-20 06:56 AM
I transmit a data to stm32 boards but ı cant receive the messages. I can work on normal mode with two stm32 boards succesfully. The messages are received and transmitted.
In your first post you said that the transmission/reception is working fine with two STM32. So I suspect something wrong on CAN Analyzer either with software configuration or HW.
Do you see any activity on CAN_Rx pin on STM32 side when you send data from the CAN analyzer?
2024-02-21 06:13 AM
Hello,
Here is my schematic
I observed the can Rx pin with a multimeter. The can Rx pin voltage is 4.88V when no receiving. When I send a message with other stm32 , can rx voltage increase 4.970V and the voltage stay in that value despite I send a data again. Then, I sent a data with analyzer to stm32 , the can rx voltage decreased 2,7V. that is so weird. In addition, when I connect the analyzer in Can Bus line, the stm32 boards doesnt communicate. It breaks the communication.
My analyzer software settings is right I guess because the can bus kbps is same 500kbps.
2024-02-21 06:21 AM
We cannot rely on a multimeter for this kind of debug. You need an oscilloscope for this.
Meanwhile you need to remove one 120ohm on the CAN but.
You need only two 120 ohm termination resistors at the extremity of the bus. So remove the one of the CAN analyzer.
2024-02-21 06:46 AM
I removed the 120ohm on analyzer but it still doesnt work. By the way, when I observe the can bus line with oscilloscope , what should I observe exactly ? How should signals flow on can bus line or Can rx pin ?
2024-02-21 06:49 AM - edited 2024-02-21 06:51 AM
When you send data, you have to see the frame on the sender Tx pin and on the receiver Rx pin.
When the receiver acknowledges the frame, ACK is seen on the receiver Tx pin and also on the sender Rx pin.
PS: I'm not talking about CAN_H and CAN_L lines.
2024-02-24 10:30 AM
Hello,
Lets say I observed the signals with oscilloscope, the ACK's second bit is not 0 dominant so the receiving is failed what will I do ?
By the way, according to this schematic before I connect analyzer to stm32 board, the stm32 program works well but when I connect the analyzer to stm32 , an unrelated program is broke like button ınterrupt. I guess, there is a problem on my hardware. You can check out my schema that ı am using and my codes.