Skip to main content
Associate III
Nov 6, 2023 2:00 PM UTC
Solved

STM32F407 CAN Loopback Mode work but Normal Mode not working

Hello, I am trying to establish standard CAN communication between the sn65hvd230 IC and the stm32f4 discovery and stm32f103. While the loopback mode works fine, when it sends data to the normal mode, the output goes to 0 and then back to 1. I still haven't found a solution.

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Nov 6, 2023 5:51 PM UTC

Surely easier to cut-n-paste

Running from a 84 MHz bus, perhaps 1 Mbps? 500 kbps at 42 MHz.

Are you sure there's not a better balance of Prescaler, SJW, BS1, BS2 settings?

Perhaps SJW =1, BS1 = 4, BS2 = 2 or SJW =1, BS1 = 5, BS2 = 1

Loopback doesn't need a responding/acknowledging device on the bus, Normal mode does.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

11 replies

SergenAuthor
Associate III
Nov 6, 2023 2:47 PM UTC

I noticed that there is a Bit recessive Error in the SFR section, how can I fix this?

Tesla DeLorean
Guru
Nov 6, 2023 2:55 PM UTC

No details on your settings or what else is on bus responding or interacting. 

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SergenAuthor
Associate III
Nov 6, 2023 4:38 PM UTC

Currently, the transceiver circuit is connected to the stm32f407, but there is no device with which it interacts and the register called LEC in the SFR section gives a bit recessive error.
Here's how I get it

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Nov 6, 2023 5:51 PM UTC

Surely easier to cut-n-paste

Running from a 84 MHz bus, perhaps 1 Mbps? 500 kbps at 42 MHz.

Are you sure there's not a better balance of Prescaler, SJW, BS1, BS2 settings?

Perhaps SJW =1, BS1 = 4, BS2 = 2 or SJW =1, BS1 = 5, BS2 = 1

Loopback doesn't need a responding/acknowledging device on the bus, Normal mode does.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
Nov 7, 2023 11:18 AM UTC

Should perhaps be looking at the circuit and performance electrically. Error suggests it's not in control of the state of the bus, perhaps feedback via CAN RX is compromised. 

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SergenAuthor
Associate III
Nov 7, 2023 1:47 PM UTC

Yes, what you said may be true because when I disconnected the CANbus transceiver, an acknowledge error was seen in the LEC Register bit instead of a timing error.

Associate
Dec 27, 2023 9:32 AM UTC

Hi @Sergen 
I am also facing an issue in CAN normal mode. Can you please help me to resolve this issue.