FlexCAN_T4 - Teensy 4.1 Not sending ACK bit

Sdev1

New member
Hello Everyone.

I'm currently troubleshooting an issue with my system not receiving CAN messages. I have tried to implement the FlexCAN_T4 examples, but I haven't had any success. I've checked my oscilloscope and it shows that the ACK bit is staying at (1) when it should have been changed to (0) by the library. All I need is to be able to receive messages, not need to transmit messages. Please refer to the attached pictures for more details.

In the scope image, the data was captured at PIN-30 (RX). CAN messages are been received from the transceiver, but the Arduino-IDE/Serial Monitor doesn't display anything except this,

FIFO Enabled --> Interrupt Enabled
FIFO Filters in use: 8
Remaining Mailboxes: 8
MB8 code: TX_INACTIVE
MB9 code: TX_INACTIVE
MB10 code: TX_INACTIVE
MB11 code: TX_INACTIVE
MB12 code: TX_INACTIVE
MB13 code: TX_INACTIVE
MB14 code: TX_INACTIVE
MB15 code: TX_INACTIVE
Ready...


Hardware,
1 Teensy 4.1 NE, using CAN CRX3 (pin30), CTXR3 (pin31), (tried others Pins 0/1 and Pins 22/23 with same results)
1 SN65HVD230DR Transceiver with a 3.3-V supply and each end of the bus is terminated with a 120-Ω resistor in compliance with the standard to minimize signal reflections on the bus.

Sketch,
#include <FlexCAN_T4.h>
FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_16> myCan;
CAN_message_t msg;

void setup() {
Serial.begin(9600);
delay(400);

myCan.begin();
myCan.setBaudRate(1000000);
myCan.setMaxMB(16);
myCan.enableFIFO();
myCan.enableFIFOInterrupt();
myCan.onReceive(canSniff);

myCan.mailboxStatus();

Serial.println("Ready...");
}

void loop() {
myCan.events();
}

void canSniff(const CAN_message_t &msg) {

Serial.print("BUS: CAN"); Serial.print(msg.bus);
Serial.print(" MB "); Serial.print(msg.mb);
Serial.print(" OVERRUN: "); Serial.print(msg.flags.overrun);
Serial.print(" LEN: "); Serial.print(msg.len);
Serial.print(" EXT: "); Serial.print(msg.flags.extended);
Serial.print(" ID: "); Serial.print(msg.id, HEX);
Serial.print(" Data: ");
for (uint8_t i = 0; i < msg.len; i++) {
Serial.print(msg.buf, HEX);
Serial.print(" ");
}
Serial.print(" TS: "); Serial.print(msg.timestamp);
Serial.println();
}
 

Attachments

  • sdev_project_image.jpeg
    sdev_project_image.jpeg
    314.6 KB · Views: 32
  • sdev1_scope.png
    sdev1_scope.png
    134.6 KB · Views: 30
  • SN65HVD230D.png
    SN65HVD230D.png
    15.8 KB · Views: 32
Last edited:
I'm not familiar with that scope. Is the signal really <1V. I had an early T4.1 where that particular 3.3V pin was not hooked up. Is it 3.3V?
 
As bicycleguy said, the CRX3 pin should be 3.3v the scope trace doesn't look like 3.3v

On pin 8 (Rs) of the CAN transceiver is it connected to anything ? Can't see it from the photo. Try and connect it to GND.

Also your code:
Code:
for (uint8_t i = 0; i < msg.len; i++) {
Serial.print(msg.buf, HEX);
Serial.print(" ");

Should be:
Code:
for (uint8_t i = 0; i < msg.len; i++) {
Serial.print(msg.buf[i], HEX);
Serial.print(" ");

After the change, the code works on my T4.1
You should get something like this:
Code:
Ready...
BUS: CAN3 MB 99 OVERRUN: 0 LEN: 8 EXT: 0 ID: 64 Data: 0 0 0 0 0 0 0 0  TS: 31041
BUS: CAN3 MB 99 OVERRUN: 0 LEN: 8 EXT: 0 ID: 64 Data: 0 0 0 0 0 0 0 0  TS: 43105
BUS: CAN3 MB 99 OVERRUN: 0 LEN: 8 EXT: 1 ID: 7FFF Data: 34 34 34 34 34 34 34 34  TS: 27632
BUS: CAN3 MB 99 OVERRUN: 0 LEN: 8 EXT: 0 ID: 0 Data: 0 0 0 0 0 0 0 0  TS: 7169
 
Last edited:
I'm not familiar with that scope. Is the signal really <1V. I had an early T4.1 where that particular 3.3V pin was not hooked up. Is it 3.3V?
Hi there, the V1.1 is from the scope. I have checked the pin and it's 3.3V, and the transceiver is working and getting 3.3V.
 
As bicycleguy said, the CRX3 pin should be 3.3v the scope trace doesn't look like 3.3v

On pin 8 (Rs) of the CAN transceiver is it connected to anything ? Can't see it from the photo. Try and connect it to GND.

Also your code:
Code:
for (uint8_t i = 0; i < msg.len; i++) {
Serial.print(msg.buf, HEX);
Serial.print(" ");

Should be:
Code:
for (uint8_t i = 0; i < msg.len; i++) {
Serial.print(msg.buf[i], HEX);
Serial.print(" ");

After the change, the code works on my T4.1
You should get something like this:
Code:
Ready...
BUS: CAN3 MB 99 OVERRUN: 0 LEN: 8 EXT: 0 ID: 64 Data: 0 0 0 0 0 0 0 0  TS: 31041
BUS: CAN3 MB 99 OVERRUN: 0 LEN: 8 EXT: 0 ID: 64 Data: 0 0 0 0 0 0 0 0  TS: 43105
BUS: CAN3 MB 99 OVERRUN: 0 LEN: 8 EXT: 1 ID: 7FFF Data: 34 34 34 34 34 34 34 34  TS: 27632
BUS: CAN3 MB 99 OVERRUN: 0 LEN: 8 EXT: 0 ID: 0 Data: 0 0 0 0 0 0 0 0  TS: 7169
Hi, Pin-8 of the transceiver is attached to Pin-2, I will make sure is set to GND. I'm not at the office right now, but I will run it as soon as I can. Thank you!
 
I discovered that the transceiver RX pin was bad, the Teensy board was sending the ACK. After replacing the faulty transceiver everything worked fine and could see all messages.
Thank you to bycleGuy and skpang for their help.
 
Back
Top