Skip to main content
john239955_st
Associate III
Apr 26, 2016 6:03 PM UTC
Question

STM32F427 CAN2

Posted on April 26, 2016 at 20:03

Hi,

I have configured CAN1 and CAN2 with CubeMX.

The CAN1 Transmit and Receive in Polling works fine, but CAN2 appears not to work in Transmit, I have changed the handle in the working code from hcan1 to hcan2, the HAL_CANx_Init structure is the same, i.e Prescaler, SJW, BS1, BS2, etc.

When configuring CubeMX it askes if CAN1 is master and CAN2 slave, does this mean that CAN2 can only receive or is different to CAN1.

I am driving CAN into a PEAK unit for debug purposes.

Help would be appreciated.  KR John W

    This topic has been closed for replies.

    2 replies

    Mark Edwards
    Associate III
    Apr 26, 2016 10:27 PM UTC
    Posted on April 27, 2016 at 00:27

    On a F429 I use CAN2 for TX and CAN1 for RX and have never noticed any difference in capabilities between the two.

    I don't use Cube though and my init code is basically the Keil demo.

    john239955_st
    Associate III
    Apr 27, 2016 8:19 AM UTC
    Posted on April 27, 2016 at 10:19

    Thanks Tede,

    I use Keil uVision, maybe crib the Keil code, think I will check my CAN2 driver, strange thing is I do not see any Data on the Tx pin.

    Thanks for your time KR John W