Skip to main content
Associate III
November 6, 2023
Solved

STM32F407 CAN Loopback Mode work but Normal Mode not working

  • November 6, 2023
  • 4 replies
  • 5143 views

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.
Best answer by Tesla DeLorean

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.

4 replies

SergenAuthor
Associate III
November 6, 2023

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

Tesla DeLorean
Guru
November 6, 2023

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
November 6, 2023

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
November 6, 2023

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
November 7, 2023

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
November 7, 2023

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
December 27, 2023

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