6 years, 2 months ago.

ST Nucleo STM32F446RE CAN2 bus not working

I am using online compiler and STM32F446RE board that have two CAN bus. My problem is that CAN1 works well but when I try to load binary to board that uses CAN2 bus, board that does not even start run code.

CAN can(PA_11, PA_12); code works fine, CAN1 bus

but when I try this CAN can(PB_12, PB_13); CAN2, board not start running code at all

I checked that PB_12, PB_13 are right pins for CAN2 bus. I am using newest mbed library.

UPDATE I updated to mbed-os-5.7.6 when it released and now CAN 2 works as it should. So there was bug in mbed-os previous release.

2 Answers

6 years, 2 months ago.

I have personally not used CAN2 but have a dual-CAN board based on this exact processor. What I have found in the past is that I need to have a 9600 baud terminal connected to look for initialization errors. They will print to the terminal immediately after reset and then the application will hang. Any chance that you have done that? Other than this suggestion I would have to try this on my board to see if I run into a similar issue.

Sorry I don't have terminal.

I did some test If I give frequency same time as pins, code run..

CAN can2(PB_12, PB_13, 500000);

But Can2 gives messages whole time even if there is no CAN tranceiver connected at all. I did same to CAN 1 and it works right, no messages if not messages sent to it. I am thinking is my brand new board broken?

posted by Ismo Paavola 13 Feb 2018

I also tested that CAN2 is not sending any message.

posted by Ismo Paavola 13 Feb 2018
6 years, 2 months ago.

Hi,

I checked the CAN2 (on PB12/PB13 pins) on the NUCLEO_F446RE and it is OK for me.

Code start run if CAN2 frequency is not defined. But when I give frequency to CAN2, code is not start running at all. CAN1 works fine.

I tryed

can2.frequency(500000);

But not working with any frequency.

I have used MBED LPC 1768 board with two can bus and it have worked well.

posted by Ismo Paavola 12 Feb 2018