I'm trying to get one of these to work, but I'm still struggling with the H7 itself. Waveshare CAN Board
I also found this FULL pinout, which is hiding on the site. Portenta FULL pinout But I'm a bit confused by it too. It lists FD_CAN1_TX etc under different ports, but only shows 1 set of CAN_RX and TX on the J1 connector. But my breakout board has 2 sets of CAN hookups. I'm starting to think the documentation is wrong and/or just doesn't match my hardware. I saw somewhere else it pointed out that there is 4 versions, V1, V2, V3, and V4 boards, but no indication anywhere what is different. Mine is a V2 according to the box it came in.
So I'm currently staring at this and it's just not working
#include <Arduino.h>
#include <mbed.h>
mbed::CAN can1(PB_8, PH_13, 500 * 1000);
void process() {
Serial.println("process called");
}
void setup() {
Serial.begin(115200);
can1.attach(process);
}
void loop() {
mbed::CANMessage msg;
msg.id = 2048;
msg.len = 1;
msg.data[0] = 25;
int r = can1.write(msg);
Serial.print("write success ?");
Serial.println(r == 1 ? "Yup" : "Nope");
if (can1.tderror() >= 248) {
Serial.println("resetting can1");
can1.reset();
}
if (can1.read(msg)) {
printf("Message received: %d\n", msg.data[0]);
}
delay(1000);
Serial.print(millis());
Serial.print(" still going... ");
Serial.println(can1.tderror());
Serial.println("");
}