Skip to main content
Visitor II
October 21, 2024
Solved

No activity observed in Tx pin of FDCAN in STM32G491KCU6

  • October 21, 2024
  • 7 replies
  • 5897 views

Hi STM Expert,

We are currently working on STM32G491KCU6 MCU FDCAN side. Our requirement is to validate the activity on Tx and Rx pins.

We started off the testing with the LoopBack mechanism but unfortunately we were not able to see any data received in the Rx buffer. We referred sample FDCAN programs for this and tested the same in STM IDE Debugger mode.

We then moved to test the normal mode as well. For this we used a sample code and probed the Tx pin of FDCAN using an oscilloscope. During the transmission, no activity is seen on the oscilloscope.

We confirmed the pins are not damaged by setting FDCAN_Tx and FDCAN_Rx pins to GPIO and toggled it.

 

Please let us know what we have missed and guide us.

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    I tested your project and I probed CAN frames on Tx without any issue and the Rx callback is also triggering.

    This is a screenshot of CAN frame on PB6:

    SofLit_0-1729615700345.png

    Attached the project that I tested on NUCLEO-G491RE board.

    So I suspect something wrong on PB6 on you board: either something forcing the pin level voltage or you are not probing the right pin!

    Hope it helps.

    7 replies

    Technical Moderator
    October 21, 2024

    Hello @ssuresh ,

    For Loopback mode, please share your code. You can probe only on Tx  pin in External Loppback mode.

    For Normal mode you need to establish a CAN node, on which at least, another node is connected with the same baudrate.

    ssureshAuthor
    Visitor II
    October 21, 2024

    Yes we tried the external loopback mode and probed Tx pin.

    Please see the link we used as the reference.

    https://controllerstech.com/stm32-fdcan-in-loopback-mode/

    Technical Moderator
    October 21, 2024

    Hello,

    Please share your code and your ioc file instead of sharing a link to "Controllerstech" youtube channel/links!

    ssureshAuthor
    Visitor II
    October 21, 2024

    Hi STM Expert,

    Sorry for the inconvenience caused.

    Sharing you the main.c file having the code we tested.

    Technical Moderator
    October 21, 2024

    Could you please also share your ioc file?

    ssureshAuthor
    Visitor II
    October 21, 2024

    Sharing you the file

     

    Technical Moderator
    October 21, 2024

    Ok thank you. For the moment I don't see and issue in your config.

    If you can replace:

    hfdcan2.Init.FrameFormat = FDCAN_FRAME_FD_NO_BRS;

    by 

    hfdcan2.Init.FrameFormat = FDCAN_FRAME_CLASSIC;

    What happens?

    Also, please set PB6 IO to High instead of Low.

    Another question: are you sure there is nothing connected to PB6 apart of the CAN transceiver?

    ssureshAuthor
    Visitor II
    October 21, 2024

    Replacing the frame format did not help. Still no activity on the Tx pin.

    please set PB6 IO to High instead of Low -> Done, Please check the attachment.

    are you sure there is nothing connected to PB6 apart of the CAN transceiver? -> right now CAN transceiver is isolated from MCU and we are just checking the MCU side alone.

     

     

    Technical Moderator
    October 21, 2024

    Ok. I will try to run a test on a NUCLEO-G491RE board by tomorrow and will let you know.

    ssureshAuthor
    Visitor II
    October 22, 2024

    Sure, awaiting your response.

    ssureshAuthor
    Visitor II
    October 22, 2024

    Hi Expert,

    please set PB6 IO to High instead of Low ---> By this, did you mean to PULL UP the pin from hardware?

    mƎALLEmAnswer
    Technical Moderator
    October 22, 2024

    Hello,

    I tested your project and I probed CAN frames on Tx without any issue and the Rx callback is also triggering.

    This is a screenshot of CAN frame on PB6:

    SofLit_0-1729615700345.png

    Attached the project that I tested on NUCLEO-G491RE board.

    So I suspect something wrong on PB6 on you board: either something forcing the pin level voltage or you are not probing the right pin!

    Hope it helps.

    ssureshAuthor
    Visitor II
    October 23, 2024

    Hi STM Expert,

    Thanks for the update.

    Can you please let me know the hardware setup used while testing?

    Also, let me know the response on below queries:

    1. whether PB6 pin was PULLED UP from hardware or software?

    2. whether CAN transceiver was connected while testing? 

    ssureshAuthor
    Visitor II
    October 23, 2024

    We face issues while opening the project.

    Meanwhile can you let us know if you have modified anything on the code or ioc file shared to you by us?

    Also, PB6 IO is made HIGH?

    Technical Moderator
    October 23, 2024

    Hello,

    I didn't remember that I modified something on the configuration. The are some screenshots of CubeMx:

    SofLit_0-1729689117377.pngSofLit_1-1729689148420.png

    SofLit_2-1729689191419.png

    SofLit_3-1729689231590.png

    At this stage I prefer that you share your schematics mainly the CAN part.

     

     

    ssureshAuthor
    Visitor II
    October 24, 2024

    Hi Expert,

    Please find the screenshots of CAN part schematics.