CAN1 having issues - SOLVED, kinda?

Noticed this on 2/3 of my M2s. CAN0 communicates fine, however CAN1 has a tendency to just not receive or send. Usually I didn’t mind as the previous projects didn’t really require both busses.

So the code for testing I used was actually pretty simple, just the usual Traffic modifier. Just so happens the job I was using it on also required bus speed modification.

CAN 0 Recieved data @ 250kBd, and CAN1 was supposed to output it at 500kBd. However nothing actually occurred. After reconfirming I am using pin 7 & 8, and correct way around, along with termination resistor (Bus at 60ohms), I swapped the busses around, and the speeds. Again, CAN1 remains unresponsive.

The literal code is below.

Now being a a careless dumbfuck, I then proceeded to set the M2 down on my desk while it was powered up, right on a strand of solder. Thus sticking 12v right up the processors ass.

Luckily as a test case I had a shit ton of Due(s?) lying around, with a copperhill can shield. I then reused the exact same code, and it worked flawlessly. That being said, not sticking a due in a commercial truck. Picture of “What the hell is this idiot doing” also attached below.

tl;dr
Am I being retarded or is there occasional issues I’ve been missing on the M2? I have briefly managed to check that the bus really is down, both with an ixxat sniffer, along with a oscilloscope. Bus stays nice and steady with no data coming through, and couldn’t check the actual rx/tx as thats when I decided to bbq the M2.

#include “variant.h”
#include <due_can.h>
#define Serial SerialUSB

void setup()
{
Serial.begin(115200);
Can0.begin(CAN_BPS_500K);
Can1.begin(CAN_BPS_250K);
int filter;
for (filter = 0; filter < 3; filter++) {
Can0.setRXFilter(filter, 0, 0, true);
Can1.setRXFilter(filter, 0, 0, true);
}
}

void printFrame(CAN_FRAME &frame) {
Serial.print(“ID: 0x”);
Serial.print(frame.id, HEX);
Serial.print(" Len: “);
Serial.print(frame.length);
Serial.print(” Data: 0x");
for (int count = 0; count < frame.length; count++) {
Serial.print(frame.data.bytes[count], HEX);
Serial.print(" “);
}
Serial.print(”\r\n");
}

void loop(){
CAN_FRAME incoming;

if (Can0.available() > 0) {
Can0.read(incoming);
Can1.sendFrame(incoming);
printFrame(incoming);
}
if (Can1.available() > 0) {
Can1.read(incoming);
Can0.sendFrame(incoming);
printFrame(incoming);
}
}

Great news, I’ve learned that everything you may expect, is mostly likely gonna fuck with you. I present to you, a god damn relay based termination resistor!

So I didn’t pay attention, and not sure how it only affects CAN1, however the module (Vehicle), when in off state somehow magically does not have a termination resistor. After trying to fight the damn thing I removed the resistor I installed, it started to work! The shit? Yeah they run a 60ohm resistor through a relay for some reason. Power module on, and disconnect the TJA ic they use, and boom, 60 ohms.

That’s all for today folks, and remember, simplest way to mess with people who mess with your stuff, is by doing unexpectedly stupid shit.