cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Rx Interrupt not triggering in Normal mode (worked in Loopback mode)

Aswin
Associate II

Hi

I am trying to communicate CAN. I am using two boards Nucleo-G474RE and Nucleo-H755ZI-Q and two MCP2551 as transceiver.
On either side, program works for External loop back configuration. ( I did step by step debug to ensure the transmitting data is getting received or not).

But I am not getting the interrupt when in normal mode. I also tried using a single board with shorting tx and rx of the transceiver and also using two boards.
What might be the issue?

I have only attached the IOC file and main.c file for Nucleo-H755ZI-Q and it is similar for Nucleo-G474RE also.

15 REPLIES 15
Aswin
Associate II

Hi Sorry for the delayed response.

I tried with configuring two different CAN in a single board. Still there is no progress. I have attached the cube project files.
I used Nucleo-H755ZI-Q. 
I have some confusion regarding the TX,RX pins of the FDCAN in the MCU. 

Aswin_0-1736704157186.png

 

You only show TX/RX connected to the MCP2551.

Is the MCP2551 VDD connected to 5V and VSS connected to ground? Is the Rs pin connected to ground as well?

Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.
Aswin
Associate II

Aswin_0-1736708223863.png

Yes, since MCP2551 powering connections are obvious I didn't mention in the connection drawing.
VCC is connected to 5V and GND pins are shorted along with the board GND.
You did mention about Rs pin:  There is no Rs pin ; is it a typo for 'Rx' - if yes then I didnt connect it to the ground

Karl Yamashita
Lead III

The MCP2551 does indeed have an Rs pin. You didn't mention that you are using a custom PCB board with the MCP2551 on it. If you look at the schematic for that PCB board, the Rs pin is grounded. 

The next step is to get a oscilloscope to see if you are getting CAN bus messages transmitted. Then you can determine if it's an Rx or Tx issue.

Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.
Aswin
Associate II

OK. Let me try using oscilloscope.
Can you please confirm whether I am using the right pin or not?
In  the manual, I can only find 2 pins for CAN. Initially i used it for FDCAN1 and later on I was confused which pin i will be using for FDCAN2.
Then when i configured it, by default it was gave me PB12 and PB11 pins. I did try with that. Then I searched in the CUBE IDE itself for alternative pins (Ctrl + hold mouse - alternative pin configuration will blink in the pinout). It showed me PB5 and PB6. I did try with that but it didnt help.

1- In the manual gives you an example of CAN pin usage (PD0 and PPD1) and it's not a restriction:

SofLit_0-1736754994444.png

To find the CAN pin usage possibilities the datasheet is the right document to refer to:

SofLit_1-1736755290610.png

Many possibilities for FDCAN1 and FDCAN2 offer to you (make a search in the document). But you need to select a pin not used in the board i.e. it's a free pin and not connected to nothing else in the schematics.

2- And this transceiver pin needs to be pulled to the ground:

SofLit_2-1736755434170.png

I see from your screen shot you are using shields but better to double check with a multimeter (in continuity mode with transceivers are powered off).

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.