I am trying to get CAN working with STM32F103 (Maple Mini clone). I verified with logic analyzer that physical data is correct after tranceiver.
My question is how to properly setup F103 pins for CAN. I am more familiar with F4 series where there is nice function for that: palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(9)) etc.
However it is done differently with F1 series and I am not completely sure how.
Currently I did this:
Code: Select all
// setup CAN pins
palSetPadMode(GPIOA, 11, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); // RX
palSetPadMode(GPIOA, 12, PAL_MODE_STM32_ALTERNATE_PUSHPULL); // TX
But I guess there is something needed to actually define those pins as CAN pins. NB I desoldered all USB related components from this board because originally those pins were shared with USB.
NB: for CAN driver I am using example from testhal/STM32/STMF1xx/CAN.