CAN Communication Issue on M4 & Linux on portenta x8

Problem :

-> The CAN1 of any board won’t work as expected. Unable to transmit or receive any frames using the CAN terminals provided on board.
-> On trying to access the CAN communication using the arduino IDE, I am unable to even compile the code due to some issues with the library provided in the tutorial.

Hardware Setup:
-> Portenta X8 , Mid Carrier, Hat Carrier, Korlan DB9 Usb to CAN, 120ohm termination, PC

Steps Taken:

-> Used the pika-spark container that was provided on the arduino website to setup canbus communication on linux environment.
-> Changed the docker-run.sh script to change the CAN1 port number on the Linux side, which was 164 on the HAT carrier.

-> Tried to receive/send an extended/normal can frame using can-utils on another device connected to the same CanBus interface , but unable to receive or send anything.


Fig: Unable to receive any frames on portenta

-> Tried connecting the CANH and CANL lines directly to the canTx and canRx and was able to receive non-extended id frames.
-> Tested the CAN lines by communicating the battery bms using the same can interface and was successfully able to do so.

-> Tried CANbus communication on m4 but the tutorial did not work.


Fig: Unable to access CAN via m4, code not compiling

Expected Outcome:
-> Expected normal transmission of data using cansend and candump commands provided in the can-utils.
->CAN tutorial on m4 should work.

Actual Outcome:
-> Any type of CAN communication is not functioning in any of the carrier boards, tested with MID carrier and HAT carrier boards.
-> Unable to receive any data in extended id or non-extended id.
->CAN library on m4 not working.

Sorry I amnot familiar with your pats and the links provided do not help. I use the mcp library by Gary Fowler and assemble two UNO's and two MC2515 devices and get them working. At that point I have a known good buss and then connect to that.

I'm trying to do the exact same thing. No luck so far.