2020-10-21 05:26 PM
I bought a few Olimex STM32-E407 boards lately. I need to use the CAN1 bus. However, the default PA11, and PA12 have not populated, and I remapped to PD0 and PD1. The code always failed immediately at CAN_init (generated by STM32CubeMX). No choice, I remapped to PB8 and 9. The code works, but at PB8 and PB9, I have got no CAN_TX signals using oscilloscope. I suspect the signals are at PA11 and PA12. Has anyone experienced this?
Appreciate your comments.
2020-10-21 07:00 PM
I've got no reason to believe that the AF pin mapping in the STM32F405 Data Sheet are wrong.
It doesn't work like a USART. Do you have it wired to a transceiver, and do you have a second CAN device to sink and acknowledge the data packets?
If you don't trust CubeMX, then just code directly in the HAL and check the register configurations
2020-10-21 07:35 PM
> I remapped to PD0 and PD1. The code always failed immediately at CAN_init
So with PD0/PD1 as the pins, the code fails at "CAN_init"? Fails in what way?
> The code works, but at PB8 and PB9, I have got no CAN_TX signals using oscilloscope. I suspect the signals are at PA11 and PA12.
Why would the signal be on PA11/PA12 if you've initialized PB8/PB9?
2020-10-21 08:06 PM
I used to test the signals before and after transceivers. During a transmission, CAN_TX will have square signals in accordance with the ID, data, etc. For my case, I did not get anything triggered despite, the code saying, completed transmission. I will do further test.
2020-10-22 12:50 AM
I've got the signals out from PB8 and 9. It was due to the bit rate setting was totally out (the default values). After setting the right values, everyone is sweet.
Thank you