Skip to main content
Hugo Lin
Associate II
May 3, 2017 2:59 AM UTC
Question

STM32F072 CAN bus issue

Posted on May 03, 2017 at 04:59

Dear all,

I using CubeMx(F0_V1.7.0) to generate code for STM32F072.  My pin definition are PB8(CAN_Rx) / PB9(CAN_Tx) when i use loopback mode that CAN Tx has signal out,  but i use normal mode that CAN Tx has no signal out. 

BTW, when normal mode that CAN transmit has not success, code will be hang-up here:

if (HAL_CAN_Transmit(&hcan, 10) != HAL_OK)

{

/* Transmition Error */

Error_Handler();

}

Thanks a lot.

    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    May 3, 2017 3:19 AM UTC
    Posted on May 03, 2017 at 05:19

    You will need a bus transceiver, and it will need a responding device on the bus to acknowledge the message being sent

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Hugo Lin
    Hugo LinAuthor
    Associate II
    May 3, 2017 5:27 AM UTC
    Posted on May 03, 2017 at 05:27

    May i short CAN Tx & Rx for self test?

    Hugo Lin
    Hugo LinAuthor
    Associate II
    May 3, 2017 12:31 PM UTC
    Posted on May 03, 2017 at 12:31

    Hi Clive,  

    You are right, the CAN bus is work when i connected transceiver & responding device.

    Thanks a lot!