cancel
Showing results for 
Search instead for 
Did you mean: 

Interface CAN with STM32f4 and STM32f091

PJose.1
Associate II

HI

I am trying to interface Stm32f407board with cjmcu2551 transceiver with tcan1051V module and stm32f091cct6.the clock rate for both controllers(APB1 for CAN=25Mhz) with prescalar=5, time segment1=8 and time segment 2=1 with baud rate 500kbps. i am not able to get CAN communcaition between two. but when 2 stm32f407and mcp2551 transceiver with the same configuration is workling fine. I am using 2 functions HAL_CAN_RxFifo0MsgPendingCallback and HAL_CAN_TxMailbox0CompleteCallback for transmission and reception. i feel that nothing happening on stm32f091 can side. please suggest solutions. thanks

3 REPLIES 3
Ozone
Lead

Some formatting would make the post more readable.

Having a proper termination resistor added ?

Are there signals visible on the bus ?

Are the connections (CanH,CanL) correct ? Have you tried to swap ?

Does the error counter on the sending node go up ?

Sorry for the formatting

Yes there are 120ohm termination on both ends

No signals are visible on the bus

Yes CANH and CANL are connected with 2 modules(not interchanged)

how can I check the error counter ?

CAN peripherals require a transmit and a receive error counter, according to the standard.

They are usually available in the CAN peripheral status registers.

I didn't work with STM32 CAN lately, only MCUs from other vendors.

After a certain amount of successive fails, a node goes from error_active into error_passive mode, or bus_off mode.

Are the static levels correct if both boards are connected ?

Have you tried to connect them directly, i.e. bypassing the transceivers ?

Only watch out for proper power supply, best option is to supply both boards from the same supply in this case.