Skip to main content
Rob Ashworth_2
Associate II
January 3, 2017
Question

STM32F746 CAN Transmit Code hangs

  • January 3, 2017
  • 8 replies
  • 1919 views
Posted on January 03, 2017 at 14:56

I am having some trouble with CAN on the STM32F746 DISCO board.

I have a can transceiver connected to PB8/9, but eveytime I try an put a message on the bus, the code just freezes.

I have hade this once before the the SPI bus and it was caused by not enabling the clock on the peripheral bus, but I can't see a similar issue this time.  Anyone know what could cause the code to hang? 

Code snipped here where it freezes:

if

(

HAL_CAN_Init

(

&

CanHandle

)

==

HAL_OK

)

{

   

//Everythying OK, so send the message

   

HAL_CAN_Transmit

(

&

CanHandle

,

10

)

;

}

    This topic has been closed for replies.

    8 replies

    Khouloud GARSI
    ST Employee
    January 6, 2017
    Posted on January 06, 2017 at 17:51

    Hi

    unclefungus

    ,

    I recommend you to refer to the CAN examples under the

    http://www.st.com/content/st_com/en/extended-query.html?querycriteria=productId=SC2004$$associatedTo=SS1858

    package(1.5.0)

    You can find those examplesunder the path below:

    STM32Cube_FW_F7_V1.5.0\Projects\STM32756G_EVAL\Examples\CAN

    May this be helpful.

    Khouloud.

    Rob Ashworth_2
    Associate II
    January 9, 2017
    Posted on January 09, 2017 at 18:24

    I re-worked an example for the STM32F756 - after considerable work!  as there is no CAN example for the DISCO F746 board.  Still no joy though.  I'm sure it can be done though! The HAL libraries are giving me a headache compared to the 'Standard Peripherals'.....

    Khouloud GARSI
    ST Employee
    January 10, 2017
    Posted on January 10, 2017 at 10:57

    Hi Rob,

    I highlighted internally the need to have a CAN example for STM32F746 on our STM32F7 cube package.

    We are trying our best to satisfy all of our customers. So, If you have any wishes, other enhancement proposal on our STM32 products, ecosystem and community, please suggest them here:

    https://community.st.com/community/stm32-community/stm32-forum/blog/2016/12/30/2017-stm32-wish-list

    .

    Khouloud.

    Khouloud GARSI
    ST Employee
    January 23, 2017
    Posted on January 23, 2017 at 14:30

    Hi Rob,

    It is not planned to provide a CAN example for the TM32F746G-Discovery boards because of the hardware; No transceiver is embedded on the board.

    Best regards,

    Khouloud.

    Rob Ashworth_2
    Associate II
    January 23, 2017
    Posted on January 23, 2017 at 14:40

    I have fixed the issue.

    CANTx/Rx wrong way around!

    Thanks,

    Rob

    Robert Ashworth

    Electronics Engineer

    Sahara Force India Formula One Team

    Dadford Road, Silverstone

    Northamptonshire, NN12 8TJ

    United Kingdom

    Email: robert.ashworth@forceindiaf1.com

    Tel: +44 (0) 1327850761

    ________________

    Attachments :

    image05d3fc.JPG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyVy&d=%2Fa%2F0X0000000bEn%2FZbHL4DpjODOSN3gPxdtSAkXuj3a4JG0nIOIT1aSvxbk&asPdf=false

    image2a5d3e.JPG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyxj&d=%2Fa%2F0X0000000bEm%2Fnn.sYAu2aDgDRUDyJ.NXcj.ZchJbzXr1ikSKlfYWkwM&asPdf=false
    world04
    Visitor II
    February 17, 2017
    Posted on February 17, 2017 at 00:16

    I am interessting in your solution. how did you solved it? A transceiver is a cheap chip and good availabe - not an issue.

    Would you explain me your solution?