Skip to main content
chesneje
Associate II
August 21, 2008
Question

CAN with stm32

  • August 21, 2008
  • 2 replies
  • 685 views
Posted on August 21, 2008 at 12:17

CAN with stm32

    This topic has been closed for replies.

    2 replies

    chesneje
    chesnejeAuthor
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:42

    Sorry, the problem is hardware.

    Bye

    chesneje
    chesnejeAuthor
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:42

    Hello,

    I succeed to send a CAN message in LoopBack mode. But when I try to communicate with an other microcontroller in Normal mode, TransmitMailbox is always equal to CANTXPENDING.

    My code :

    /* CAN cell init */

    CAN_InitStructure.CAN_TTCM = DISABLE;

    CAN_InitStructure.CAN_ABOM = DISABLE;

    CAN_InitStructure.CAN_AWUM = DISABLE;

    CAN_InitStructure.CAN_NART = DISABLE;

    CAN_InitStructure.CAN_RFLM = DISABLE;

    CAN_InitStructure.CAN_TXFP = DISABLE;

    CAN_InitStructure.CAN_Mode = CAN_Mode_Normal;

    CAN_InitStructure.CAN_SJW = CAN_SJW_1tq;

    CAN_InitStructure.CAN_BS1 = CAN_BS1_8tq;

    CAN_InitStructure.CAN_BS2 = CAN_BS2_7tq;

    CAN_InitStructure.CAN_Prescaler = 1;

    CAN_Init(&CAN_InitStructure);

    /* transmit */

    TxMessage.StdId = 0x01;

    TxMessage.RTR = CAN_RTR_DATA;

    TxMessage.IDE = CAN_ID_STD;

    TxMessage.DLC = 2;

    TxMessage.Data[0] = 0x01;

    TxMessage.Data[1] = 0x00;

    TransmitMailbox = CAN_Transmit(&TxMessage);

    What are the other changes that I should do to pass in Normal mode?