cancel
Showing results for 
Search instead for 
Did you mean: 

CAN transceiver on stm32f407 discovery

Hello dear friends,

It's been a week since I worked on the CAN transceiver and couldn't make it work. I have set up the chip rcc, bit rate, and receive interrupt of CAN, set the receive filter, and the receiver id in transmission, with no success. I have used only a single board and connected Tx to Rx (PB8 PB9) through a jumper. I have checked that there is some signal on the Tx line with a voltmeter(Sadly I have no oscilloscope now to check the absolute signals.)

What I am looking for is that I can get the receive interrupt.

I am not going to use the software loop-back mood since I'm not going to use simulation.

The code is attached. Help me what had make it not

1 ACCEPTED SOLUTION

Accepted Solutions

Please don't PM me related to forum postings.

You can't connect the pins in that fashion, the bus needs to see its own signal, and to do that you need a transceiver or diode arrangement. You need a second device on the bus to respond to the first. It needs to acknowledge.

https://www.keil.com/appnotes/files/apnt_236.pdf

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

4 REPLIES 4
FBL
ST Employee

Hello @Vahid Ajallooeian​ 

Could you provide more details about the issue? Hardware Setup would be useful to investigate further! Since, you couldn't generate the receive interrupt, you can take a look at the example provided for CAN networking. STM32CubeF4/Projects/STM324xG_EVAL/Examples/CAN/CAN_Networking at master · STMicroelectronics/STM32CubeF4 (github.com)

If the loopback is working fine, you should suspect the transceiver for not receiving the message.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Dear @F.Belaid​ 

I have not used any transceiver, but I have directly connected the PB8 of the F407 discovery board to the same board PB9. I expected to get the interrupt signal when the transmission is completed. yet no interrupt signal thrown occurred. sad. Moreover the example code you are referring to is not compatible with My board.

Please don't PM me related to forum postings.

You can't connect the pins in that fashion, the bus needs to see its own signal, and to do that you need a transceiver or diode arrangement. You need a second device on the bus to respond to the first. It needs to acknowledge.

https://www.keil.com/appnotes/files/apnt_236.pdf

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

@Community member​  Sorry for the inconvenience happened.

@F.Belaid I have two other custom boards, one of them features a STM32F429BIT6 and the other one features a STM32f429IGT6. Both of them have sn65hvd230 transceivers. In the debug mode, I see that the RXM bit of MSR is low. Which sequence or conditions should happen so that this bit becomes high? it seems another one three years ago has encountered this problem.

https://community.st.com/s/question/0D50X0000BueQGrSQM/can-receiver-node-not-working-with-stm32cubeide-and-registers-are-not-getting-updated?t=1680199140630