7 years, 1 month ago.

NUCLEO F302R8 CAN problem

Hi, I tried to use USART3(PC10,PC11) and CAN(PB8,PB9) in my program. After I checked USART3 transmission is fine. I declared CAN port from API like this

/media/uploads/lwtroach/can_problem.jpg

than test the program on the NUCLEO board, but USART3 have no output from its RX. It seems the problem is this declaration of CAN, so I comment out CAN port declaration and tried again, USART3 can work normally. I wonder how to use this two function together?

1 Answer

7 years, 1 month ago.

I just looked in mbed-dev and it has the following comments (which don't make sense to me)

const PinMap PinMap_CAN_RD[] = {
//  {PB_8 , CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)}, // Not available in 32 pins package
    {PA_11, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)},
    {NC,    NC,    0}
};

const PinMap PinMap_CAN_TD[] = {
//  {PB_9 ,  CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)}, // Not available in 32 pins package
    {PA_12,  CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)},
    {NC,    NC,    0}

Accepted Answer

Thanks for help. Program is running normally now, even though I still don't know why.

posted by Wen-ting Lo 14 Mar 2017