Skip to main content
gregory
Associate II
April 26, 2008
Question

CAN

  • April 26, 2008
  • 3 replies
  • 790 views
Posted on April 26, 2008 at 07:17

CAN

    This topic has been closed for replies.

    3 replies

    lanchon
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:31

    have you enabled clocks for CAN, AFIO and GPIOD? have you read the STM32 family errata document?

    gregory
    gregoryAuthor
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:31

    hi all,

    I'm trying to test the CAN bus on my hardware.

    I use the CAN example program available in the FWLIb.

    My hardware is based on the STM32F103VBT6 and the CAN is mapped on PD0 and PD1.

    Here is the GPIO initialization

    /* Remap the CAN pins on PD0 & PD1 */

    GPIO_PinRemapConfig(GPIO_Remap2_CAN,ENABLE);

    /* Configure CAN pin: RX */

    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;

    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;

    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

    GPIO_Init(GPIOD, &GPIO_InitStructure);

    /* Configure CAN pin: TX */

    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;

    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

    GPIO_Init(GPIOD, &GPIO_InitStructure);

    When i put a probe on the CANTX I/O, there's no activity !!!!!

    Any idea ?

    greg

    gregory
    gregoryAuthor
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:31

    hello,

    Indeed the AFIO clock in the ST CAN example was not enabled.

    thanks

    greg