you need 2 or more nodes on the bus to ACK the message, a scope won't do this. The software sends a one shot frame, then when it reaches hardware the mailbox tries to send out until an ACK is received. If no ACK is received it will attempt to retry until it does.
If you do have another node on the bus, verify your tranceiver connections and terminations of the bus
oh ok I see, you are sending and the TX is just filling, and you only see the first frame being constantly sent. This is because there is no node ACKing on the network. This is a hardware thing not software. Make sure 2 or more nodes are on the network for transmissions to work, at least 1 node needs to ACK for the transmits to send and remove themselves from the mailbox, hardware removes them not you
yes listen-only mode is working on both, use LISTEN-ONLY overload on setBaudRate
CAN_FD.begin();
[...]
config.baudrate = 500000;
config.baudrateFD = CAN_FD.setBaudRate(config, LISTEN_ONLY);
Serial.println(config.baudrateFD);
But how can I detect, that the interrupt is firing?
Is there a flag, something like a bool, which is true when recognized CAN data with a correct baud rate?
typedef*enum*FLEXCAN_FDRATES*{
**CAN_1M_2M,
**CAN_1M_4M,
**CAN_1M_6M,
**CAN_1M_8M
}*FLEXCAN_FDRATES;
void loop() {
CAN_FD.events();
for (int i = 0; i < 4; i++){
if(millis() >= time_now + period){
time_now += period;
CAN_FD.setBaudRate(FLEXCAN_FDRATES(i), LISTEN_ONLY);
CAN_FD.onReceive(canfdSniff);
Serial.println(FLEXCAN_FDRATES(i));
}
}
}
int std_datarates[6] = {500000, 1000000, 2000000, 4000000, 6000000, 8000000};
void setup(void) {
CAN_FD.begin();
CANFD_timings_t config;
[...] //standard config settings with the wrong init baudrate on purpose
for(int i = 1; i < 7; i++){config.baudrateFD = std_datarates[i];}
CAN_FD.onReceive(canfdSniff);
}
CANFD_timings_t config;
config.clock = CLK_60MHz;
config.baudrate = 500000;
config.baudrateFD = 2000000;
config.propdelay = 190;
config.bus_length = 1;
config.sample = 70;
FD.setBaudRate(config);