2008-04-25 10:17 PM
CAN
2011-05-17 03:31 AM
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 ? greg2011-05-17 03:31 AM
have you enabled clocks for CAN, AFIO and GPIOD? have you read the STM32 family errata document?
2011-05-17 03:31 AM
hello,
Indeed the AFIO clock in the ST CAN example was not enabled. thanks greg