cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 is not receiving the CAN Message

ghasem_karbasi2000
Associate
Posted on November 03, 2016 at 19:17

The original post was too long to process during our migration. Please click on the attachment to read the original post.
3 REPLIES 3
ST Renegade
Senior
Posted on November 03, 2016 at 22:06

Hello karbasi.ghasem,

After reading your request the second time, I realized I've given you an improper answer!

The CAN interface is a bit tougher to get running! Steps I follow while debugging CAN:

Make sure your timing configuration is the same for all devices on the bus!

It's highly recommended to use an external crystal in case of CAN (timing precision is important)

You are not checking the results of your functions. Filter init, CAN init etc. How can you be sure the outcome is ok?

After CAN is initialized, make sure you are in Normal mode (nor sleep, nor init)

You are in Silent mode, transmission is not working/allowed, you are able only to receive.

I see you are calling the HAL_CAN_Receive() function, but before you are checking whether there are some pending messages. This check is in my opinion in the HAL_CAN_Receive() function... don't have the library downloaded, you need to check it.

Are you sure you are calling the HAL_CAN_Receive() function or you always return because pending bit is false? You don't check the outcome, set some return values to be able to debug it...

The CAN has some error registers, try to check these to make sure the bus is not in some error state (there is an error counter inside indicating the state).

I hope my answer helps you to move forward.

Have a nice day,

Renegade

ghasem_karbasi2000
Associate
Posted on November 04, 2016 at 07:56

hello ,

thank you for answering,

1- i am use 16MHZ external clock

2-i am CAR ECU always Online Mode and send Repeated frame so not need check with debugger  and 500kbps fix baud rate

3-i am check init function and all register such as SLAK INAK ,MCR TSR MSR is OK and SET correctly and HAL_OK Result.

4-check frame signal with oscilloscope and not frame signal on can tx pin

5-test loopback mode and normal mode and in loopback mode received frame with have a PENDING function but in normal mode nothing intended purpose no recieve,no send
ST Renegade
Senior
Posted on November 08, 2016 at 03:08

Hey there,

the point 5 is insteresting. How is it possible that you receive message in loopback mode, but not in normal mode?

Have you measured the data on RX pin (on MCU) in normal/silent mode?

Have you measured the data on TX/RX while in loopback mode?

If you receive back data in loopback mode, it proves the MCU transmits data over the bus and receives them back. So I would double check the HW.

Renegade