cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 CAN Loopback Mode work but Normal Mode not working

Sergen
Associate III

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 discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions

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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

11 REPLIES 11
Sergen
Associate III

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

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

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

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

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
Up vote any posts that you find helpful, it shows what's working..

I am working on the 42mhz bus and I adjusted these settings like this last time and it worked smoothly in loopback mode, but in normal mode, I tried to send data when there was no device on the other side, but I could not see the canbus frame in the logic analyzer. Unfortunately, since I am new, I do not have much knowledge about can and I do not understand some of the problems.

Today I tried to connect 2 devices and send data, but it gave a bit dominant error.

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
Up vote any posts that you find helpful, it shows what's working..

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.

Hi @Tesla DeLorean I am new to embedded development can you please me solve this issue?
I am facing an issue in CAN normal mode. I have tried loopback mode it's working fine but when I change the mode to loopback mode I get a Bit Dominant error while transmitting.
Thank you