0
\$\begingroup\$

I create applications for STM32 F303RE for communication with the instrument panel. I managed to connect everything but I have some problems. I'm not sure if it's due to bad code or good performance. I've plugged a cheap logic analyzer into CAN_H, CAN_L, CAN_TX, CAN_RX.

I am able to observe the frames sent by the Instrument panel cluster (removed from the car, connected to the power supply at home) as shown below on the screen (e.g. ID: 0x0C194003). Unfortunately none of these frames appear on CAN_RX line in STM32. When I try to send some own frame (ID: 0x07000000) I see that it appears both on CAN_TX line (which is normal for me) but also on CAN_RX line. The device works in Normal mode, not Loopback. As I understand it STM collects this frame from the bus immediately after sending. But I don't understand why it reacts and accepts this frame and doesn't get those sent by IPC.

At the end of each frame sent by IPC I get NAK. I guess that if the frame did not appear on the RX line and did not get to the device there is no possibility that it will be issued ACK by qC. The frames sent by me (as above, the frame with ID: 0x700...) receive an ACK confirmation. But I don't know if ACK is received from IPC (as it seems to me) or because on CAN_RX line this message appeared and STM issued ACK bit itself...? Filter bank is setted to pass all frames.

Problem is related to previously asked: NAK in CAN bus for STM32F3 uC

\$\endgroup\$
5
  • \$\begingroup\$ Welcome to StackOverflow! Could you please add some on how your CAN bus is wired? Do you have termination resistor(s), and is there a common ground? \$\endgroup\$ Commented Mar 23, 2020 at 6:22
  • \$\begingroup\$ How did you connect the Logic Analyzer. The CAN Logic Levels are not that easy to track using a cheap analyzer. Oscilloscope with differential probe would be the right choice here. Take care not to destroy your device \$\endgroup\$
    – A.R.C.
    Commented Mar 23, 2020 at 8:33
  • \$\begingroup\$ @BobJacobsen Hi, yes there is a common ground between all devices. Without it communication dont even start. Here's scheme (sorry for paint): crcit.net/c/a201c57246e44b00961a2811caeb846a. CAN transciver have built-in 120R \$\endgroup\$
    – Daniel
    Commented Mar 23, 2020 at 19:29
  • \$\begingroup\$ @A.R.C. Unfortunately I don't have access now to oscilloscope (COVID-19). Logic analyzer was connected directly all wirings and grounded to common ground. \$\endgroup\$
    – Daniel
    Commented Mar 23, 2020 at 19:43
  • \$\begingroup\$ The terminator should be 60 ohms (Two 120) but I don’t think that will make the difference. \$\endgroup\$ Commented Mar 24, 2020 at 2:23

1 Answer 1

1
\$\begingroup\$

@BobJacobsen Hey, I found a solution some time ago, I forgot to describe it. The problem was really on the hardware side but it's quite unusual. The instrument panel cluster from the car I'm connecting to has already 2 resistors built in and is like a separate CAN network. After removing ALL terminations (I soldered out a 120 ohm resistor from the transciver) everything suddenly started to work. To sum up: check the transciver / STM / Arduino documentation to see if you have a 120 ohm resistor and remove it if necessary. The same may apply to other elements taken out of the car :)

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.