Teensy 4.0 First Beta Test

Status
Not open for further replies.
@defragster
Ok - after you hit "a" and send you should see something even if its only one message. If not then the odds are the pins are aligned right - I hope. As a check after you send "a" or "A" you can try resetting Node B but check the pins. Only other thing I can think of.

Used KurtE's pintest and I get blinks to LED13 on 30 and 31 both boards with a clip on POGO shaft and other end to Pin 13.

Swapped wires to shorter breadboard wires - still nothing beyond the open text. Wondering if my 110 Ohms isn't a good replacement for the expected 120 Ohm?

Edit: I ordered 120 Ohm resistors I'll have Tuesday afternoon.

Also - should I remove those two unused 10K Ohm SMD resistors from the PJRC breakout - though if working for Tony&Mike that would not explain it.

Also - Power on the T4B2m works manually shorted - but the POGO'd switch is not - and I put a touch of solder on the T4 PCB, not as much as the first that is working.

And … I did not CLEAN my DIY breakout of solder core flux - … Did that no diff
 
Last edited:
Edit: I ordered 120 Ohm resistors I'll have Tuesday afternoon.

Also - should I remove those two unused 10K Ohm SMD resistors from the PJRC breakout - though if working for Tony&Mike that would not explain it.
I never touched the resistors on the underside of the breakout board. Let them the way the are on both. I added the 120ohm resistor to the top side of the board near the CAN connector. Didn't clean the board either :)

As for the way its suppose to work. This screen shot shows on startup the initial info which you see:
Capture1.JPG

When I send the "a" or "A" on NODE A, I will typically see this occur:
Capture2.JPG

I get a single message from Node B to A then it stops. So when that happens just reset node b and then the data stars flowing:
Capture3.JPG

As a test you can put this sketch on both boards (tony's library test) but you will need his FlexCAN_t4 library, https://github.com/tonton81/FlexCAN_T4. If will test CAN3 in legacy mode:

View attachment sketch_may15a.zip
 
Last edited:
Downloaded two zips try try after zzzz's. I didn't see any output like that showing a transfer with the CANFD code. I suppose your second B2 breakout was also a DIY kit - didn't have those two 10K's like the original PJRC is what I was wondering. I wasn't otherwise worried about those. Since 120 ohm wasn't part of either of my collection kits for the top side - I could most easily get 110 from two 220's - which is where I'm at until Tuesday.

Data recovery worked … so I'll have my machine back shortly.
 
Just tested with the 120 resistor removed from the DIY kit and it still worked. But still had it on the other T4, can remove that one. If you want to try something else real quick with the FD sketches, in the Node B sketch, move this section of code to the beginning of the loop:
Code:
            /* Start receive data through Rx Message Buffer. */
            FLEXCAN_TransferFDReceiveBlocking(EXAMPLE_CAN, RX_MESSAGE_BUFFER_NUM, &rxFrame);
      
            PRINTF("Rx MB ID: 0x%3x, Rx MB data: 0x%x, Time stamp: %d\r\n", rxFrame.id >> CAN_ID_STD_SHIFT,
                   rxFrame.dataByte0, rxFrame.timestamp);
            PRINTF("Rx MB ID: 0x%3x, Rx MB data: 0x%x\r\n", rxFrame.id >> CAN_ID_STD_SHIFT, rxFrame.dataByte0);
            PRINTF("Rx MB data: 0x%x  %x  %x  %x  %x  %x  %x  %x\r\n",rxFrame.dataByte0,rxFrame.dataByte1,rxFrame.dataByte2,
                rxFrame.dataByte3,rxFrame.dataByte4,rxFrame.dataByte4,rxFrame.dataByte6,rxFrame.dataByte7);
you should then see something on both when you hit send the "a" from node A

Good luck with your getting you machine back. Been there.
 
Hopefully quick random question: Any suggestions like part numbers on digikey or ... on what USB Host adapter to use on our own breakout boards?
Horizontal, or vertical...
 
I've added brendanmatkin, crees, ETMoody3, rcarr, wwatson, and XFer to the list of approved beta testers. :)

As always, to get hardware sooner, email Robin directly with the magic words "I have time to test stuff". If you're busy, that's fine too. After release, we will send production boards to everyone on the list who didn't get beta hardware.

We're also going to send 1062 boards (either final production or betas) to everyone who got only very early 1052 board, or the very first 1062 boards with the brown-out restart problem.
 
Re: SD lib

Sanity check. In browsing Paul's SD github repo, I notice defined(__IMXRT1052__) here and there for SDHC access, but nothing for IMXRT1062 ???

EDIT. never mind, i was looking at old history logs
 
Just tested with the 120 resistor removed from the DIY kit and it still worked. But still had it on the other T4, can remove that one. If you want to try something else real quick with the FD sketches, in the Node B sketch, move this section of code to the beginning of the loop:

Good luck with your getting you machine back. Been there.

Clipped off the resistor on the DIY breakout - no change.

Luckily the bad drive isn't mine - owner delivered new computer to get his data back - so I have to worry over it - and not put it off … gotta go make that right ...

Using zip in 2902 of Tony sketch - it is dying in setup() - with mods below it last prints 'Hello World 3'
and :: Using library FlexCAN_T4 in folder: T:\tCode\libraries\FlexCAN_T4 (legacy)

Same from T4B2 and T4B2m - each running the same sketch:
Code:
void setup(void) {
  //tony->begin();
//  Serial2.begin(115200);
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT); 
  digitalWrite(LED_BUILTIN, HIGH);
  delay(2000);
  digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
  delay(2000);
  Serial.println( " Hello World" );
  
  pinMode(6, OUTPUT); 
  digitalWrite(6, LOW);
  
  Can1.begin();
  Can1.setBaudRate(1000000);
  Can1.setMaxMB(64);
  Can1.enableFIFO(1); Can1.enableFIFOInterrupt();
  Can1.setFIFOFilterTable(A);
  Serial.println( " Hello World 1" );

  Can1.onReceive(MB0, canSniff);
  Can1.onReceive(MB1, canSniff);
  Can1.enableMBInterrupt(MB0, 1);
  Serial.println( " Hello World 2" );

  Can1.setRFFN(13);
  Can1.setFIFOFilter(REJECT_ALL);
  for ( uint8_t i = 34; i < 64; i++ ) {
    Can1.setMB((FLEXCAN_MAILBOX)i, RX, INACTIVE);
  }
[COLOR="#FF0000"]  Serial.println( " Hello World 3" );[/COLOR]

[B]  Can1.setMB(MB38, TX, STD);
  Can1.setMB(MB60, RX, STD);
  Can1.setMBFilter(MB60, 0x05);
  Can1.enableMBInterrupt(MB60, 1);
  Can1.onReceive(MB60, canSniff);
  Can1.mailboxStatus();[/B]
  Serial.println( " Hello World 4" );

   Can1.setFIFOFilter(3, 8, STD);
  Can1.setFIFOFilter(7, 290000, EXT);
  Can1.setFIFOFilter(22, 13, STD);
  Can1.setFIFOFilter(27, 5, STD);
  Can1.setClock(CLK_60MHz);
  Serial.println( " Hello World 5" );
}
 
is the controller selected in the constructor? only frames 5, 8, 13, and 290000 are accepted because REJECT_ALL is blocking the rest, try removing the setfifofilter lines amd setMB for loop and individual calls, then you should be able to see any CAN2.0 frames. CAN2 is on pins 0 & 1, to use CAN3 in 2.0 mode you need to use CAN3 in constructor
 
@tonton81 - it is a sample from post #2902 above that @mjs513 said was your Can2 on CAN3 - it has Can1 as :: FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_16> Can1;

Trying to use the CANFD 30/31 pins on two T4B2's on breakouts. If you have a current/better sample I'll try that.

Removing all .setFIFOFilter() didn't change anything.

Seems to be stopping on this line :: Can1.mailboxStatus();
 
Something strange is going on - right now I have a 120ohm terminating resistor on the top sides of both breakouts. CANH-CANH, CANL-CANL like @defragster mentioned. With the sketch in post 2902 on both T4s on their respective breakout boards this is what I am seeing on both T4s in TyCommander:
Capture4.JPG

Nothing special should have to be done - don't even have the grounds tied together.
 
@defragster

Seems to be stopping on this line :: Can1.mailboxStatus();
Just saw this in your post. Does it print the MBstatus? If it does then the odds are some connection is not right going between boards? Cause it should work.
 
Until 'Hello World #" was added I saw nothing printed as it isn't leaving setup().

Mike are you using the sketch as zip posted above and current 8 day old github?
 
I've added brendanmatkin, crees, ETMoody3, rcarr, wwatson, and XFer to the list of approved beta testers. :)

As always, to get hardware sooner, email Robin directly with the magic words "I have time to test stuff". If you're busy, that's fine too. After release, we will send production boards to everyone on the list who didn't get beta hardware.

We're also going to send 1062 boards (either final production or betas) to everyone who got only very early 1052 board, or the very first 1062 boards with the brown-out restart problem.

*Squeak*

I have been reading all of this, and do have time. I'm sure I can break *something*.
 
I can't really tell but it should be - looks like the files on my computer were created on 5/15 so should match. But just in case here is the zip of the lib I am using:

View attachment FLEXCAN_T4.zip

EDIT:
MBStatus is called from Setup if you don't even see that printed something really strange going on. Try running the sketch without it attached to the other T4 just to see if it gets through setup.
 
The library outputs to Serial4, forgot to mention, i’m using a T3.5 to read from t4 serial4
the library on github is CAN1,2,3 supported, im still working on FD registers

mailboxStatus prints to Serial4, you can mass rename it in library from “Serial4.” to “Serial.” if needed
 
It is never getting past .mailboxStatus here in earlier sketch - LED stays on and no #4 print:
Code:
  digitalWriteFast(LED_BUILTIN, HIGH );
  Can1.mailboxStatus();
  delay(100);
  digitalWriteFast(LED_BUILTIN, LOW );
  Serial.println( " Hello World 4" );

I pulled the wires from T4B2m on PJRC breakout and ran that again and it still fails to get there - LED stays on and no print

OTHER BOARD:: Using CAN3_legacy I changed to this:
Code:
FlexCAN_T4<[B]CAN1[/B], RX_SIZE_256, TX_SIZE_16> Can0;
FlexCAN_T4<[B]CAN3[/B], RX_SIZE_256, TX_SIZE_16> Can1;

On the T4B4 on DIY breakout I put a waveshare on Pin 0 and 1 for CAN1 and ran { wired cross labelled CAN H<>L } to 30/31 CAN3

For WaveShare does Rx board go to Pin0 - or do they cross?
I have no jumper on the waveshare pins - does that terminate with the 120 Ohm?

Not seeing anything from that effort either - it was easy to wire to pins 0/1.

Should that be the needed change? If so I'll move it to the PJRC breakout and try the same configuration.
 
Okay - I had Debug Teensy's off making sure it could work on either board, in FlexCAN_T4 did : #define Serial4 Serial

I get this:
Code:
T:\tCode\CAN\CAN3_Legacy\CAN3_Legacy.ino May 20 2019 20:48:54
FIFO Enabled --> Interrupt Enabled
	FIFO Filters in use: 112
	Remaining Mailboxes: 30
		MB34 code: RX_INACTIVE
		MB35 code: RX_INACTIVE
		MB36 code: RX_INACTIVE
		MB37 code: RX_INACTIVE
		MB38 code: TX_INACTIVE
		MB39 code: RX_INACTIVE
		MB40 code: RX_INACTIVE
		MB41 code: RX_INACTIVE
		MB42 code: RX_INACTIVE
		MB43 code: RX_INACTIVE
		MB44 code: RX_INACTIVE
		MB45 code: RX_INACTIVE
		MB46 code: RX_INACTIVE
		MB47 code: RX_INACTIVE
		MB48 code: RX_INACTIVE
		MB49 code: RX_INACTIVE
		MB50 code: RX_INACTIVE
		MB51 code: RX_INACTIVE
		MB52 code: RX_INACTIVE
		MB53 code: RX_INACTIVE
		MB54 code: RX_INACTIVE
		MB55 code: RX_INACTIVE
		MB56 code: RX_INACTIVE
		MB57 code: RX_INACTIVE
		MB58 code: RX_INACTIVE
		MB59 code: RX_INACTIVE
		MB60 code: RX_EMPTY	(Standard Frame)
		MB61 code: RX_INACTIVE
		MB62 code: RX_INACTIVE
		MB63 code: RX_INACTIVE
FIFO Enabled --> Interrupt Enabled
	FIFO Filters in use: 112
	Remaining Mailboxes: 30
		MB34 code: RX_INACTIVE
		MB35 code: RX_INACTIVE
		MB36 code: RX_INACTIVE
		MB37 code: RX_INACTIVE
		MB38 code: TX_INACTIVE
		MB39 code: RX_INACTIVE
		MB40 code: RX_INACTIVE
		MB41 code: RX_INACTIVE
		MB42 code: RX_INACTIVE
		MB43 code: RX_INACTIVE
		MB44 code: RX_INACTIVE
		MB45 code: RX_INACTIVE
		MB46 code: RX_INACTIVE
		MB47 code: RX_INACTIVE
		MB48 code: RX_INACTIVE
		MB49 code: RX_INACTIVE
		MB50 code: RX_INACTIVE
		MB51 code: RX_INACTIVE
		MB52 code: RX_INACTIVE
		MB53 code: RX_INACTIVE
		MB54 code: RX_INACTIVE
		MB55 code: RX_INACTIVE
		MB56 code: RX_INACTIVE
		MB57 code: RX_INACTIVE
		MB58 code: RX_INACTIVE
		MB59 code: RX_INACTIVE
		MB60 code: RX_EMPTY	(Standard Frame)
		MB61 code: RX_INACTIVE
		MB62 code: RX_INACTIVE
		MB63 code: RX_INACTIVE

And this - NOTE with DEBUG on I now get 'Hello World 4' past .mailboxStatus().

Moving the wires back for CAN3 to CAN3 already showing change
Code:
T:\tCode\CAN\Tony_sketch_may15a\Tony_sketch_may15a.ino May 20 2019 20:49:56
 Hello World 1
 Hello World 2
 Hello World 3
 Hello World 3a
 Hello World 3b
 Hello World 3c
 Hello World 3d
 Hello World 3e
FIFO Enabled --> Interrupt Enabled
	FIFO Filters in use: 112
	Remaining Mailboxes: 30
		MB34 code: RX_INACTIVE
		MB35 code: RX_INACTIVE
		MB36 code: RX_INACTIVE
		MB37 code: RX_INACTIVE
		MB38 code: TX_INACTIVE
		MB39 code: RX_INACTIVE
		MB40 code: RX_INACTIVE
		MB41 code: RX_INACTIVE
		MB42 code: RX_INACTIVE
		MB43 code: RX_INACTIVE
		MB44 code: RX_INACTIVE
		MB45 code: RX_INACTIVE
		MB46 code: RX_INACTIVE
		MB47 code: RX_INACTIVE
		MB48 code: RX_INACTIVE
		MB49 code: RX_INACTIVE
		MB50 code: RX_INACTIVE
		MB51 code: RX_INACTIVE
		MB52 code: RX_INACTIVE
		MB53 code: RX_INACTIVE
		MB54 code: RX_INACTIVE
		MB55 code: RX_INACTIVE
		MB56 code: RX_INACTIVE
		MB57 code: RX_INACTIVE
		MB58 code: RX_INACTIVE
		MB59 code: RX_INACTIVE
		MB60 code: RX_EMPTY	(Standard Frame)
		MB61 code: RX_INACTIVE
		MB62 code: RX_INACTIVE
		MB63 code: RX_INACTIVE
 Hello World 4
 Hello World 5
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 33407 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 12494 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 17288 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 6253 ID: 5 Buffer: 4 5 6 7 8 9 A B 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 52156 ID: 5 Buffer: 4 5 6 7 8 9 A B 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 36741 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 54604 ID: 5 Buffer: 4 5 6 7 8 9 A B 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 36041 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 25000 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 42941 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 60899 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 13322 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
// ...
 
Okay - it seems that DEBUG output had to come out? Moving to Serial I see CANFD working Below is output and as edited from p#2902 code for review:

COM29 is T4B2m:
Code:
 Hello World

T:\tCode\CAN\Tony_sketch_may15a\Tony_sketch_may15a.ino May 20 2019 20:49:56
 Hello World 1
 Hello World 2
 Hello World 3
 Hello World 3a
 Hello World 3b
 Hello World 3c
 Hello World 3d
 Hello World 3e
FIFO Enabled --> Interrupt Enabled
	FIFO Filters in use: 112
	Remaining Mailboxes: 30
		MB34 code: RX_INACTIVE
		MB35 code: RX_INACTIVE
		MB36 code: RX_INACTIVE
		MB37 code: RX_INACTIVE
		MB38 code: TX_INACTIVE
		MB39 code: RX_INACTIVE
		MB40 code: RX_INACTIVE
		MB41 code: RX_INACTIVE
		MB42 code: RX_INACTIVE
		MB43 code: RX_INACTIVE
		MB44 code: RX_INACTIVE
		MB45 code: RX_INACTIVE
		MB46 code: RX_INACTIVE
		MB47 code: RX_INACTIVE
		MB48 code: RX_INACTIVE
		MB49 code: RX_INACTIVE
		MB50 code: RX_INACTIVE
		MB51 code: RX_INACTIVE
		MB52 code: RX_INACTIVE
		MB53 code: RX_INACTIVE
		MB54 code: RX_INACTIVE
		MB55 code: RX_INACTIVE
		MB56 code: RX_INACTIVE
		MB57 code: RX_INACTIVE
		MB58 code: RX_INACTIVE
		MB59 code: RX_INACTIVE
		MB60 code: RX_EMPTY	(Standard Frame)
		MB61 code: RX_INACTIVE
		MB62 code: RX_INACTIVE
		MB63 code: RX_INACTIVE
 Hello World 4
 Hello World 5
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 1756 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 1877 ID: 5 Buffer: C D E F 10 11 12 13 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 20908 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 21026 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 38868 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 38987 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 56826 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 56944 ID: 5 Buffer: 11 12 13 14 15 16 17 18 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 9250 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 9369 ID: 5 Buffer: 9 A B C D E F 10 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 27207 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 27328 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 45166 ID: 5 Buffer: 6 7 8 9 A B C D 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 45285 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 63124 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 63245 ID: 5 Buffer: F 10 11 12 13 14 15 16 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 15546 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 15667 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 33503 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 33623 ID: 5 Buffer: 13 14 15 16 17 18 19 1A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 51462 ID: 5 Buffer: 4 5 6 7 8 9 A B 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 51581 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 3885 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 4006 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 21843 ID: 5 Buffer: 4 5 6 7 8 9 A B 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 21962 ID: 5 Buffer: C D E F 10 11 12 13 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 39802 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 39920 ID: 5 Buffer: 14 15 16 17 18 19 1A 1B 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 57761 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 57879 ID: 5 Buffer: 13 14 15 16 17 18 19 1A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 10183 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 10301 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 28142 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 28262 ID: 5 Buffer: 11 12 13 14 15 16 17 18 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 46101 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 46219 ID: 5 Buffer: 13 14 15 16 17 18 19 1A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 64059 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 64178 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 16483 ID: 5 Buffer: 6 7 8 9 A B C D 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 16602 ID: 5 Buffer: E F 10 11 12 13 14 15 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 34441 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 34562 ID: 5 Buffer: B C D E F 10 11 12 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 52399 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 52519 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 4822 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 4940 ID: 5 Buffer: F 10 11 12 13 14 15 16 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 22779 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 22898 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 40739 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 40857 ID: 5 Buffer: 11 12 13 14 15 16 17 18 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 58697 ID: 5 Buffer: 6 7 8 9 A B C D 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 58816 ID: 5 Buffer: B C D E F 10 11 12 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 11119 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 11239 ID: 5 Buffer: 12 13 14 15 16 17 18 19 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 29077 ID: 5 Buffer: 6 7 8 9 A B C D 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 29196 ID: 5 Buffer: 11 12 13 14 15 16 17 18 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 47035 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 47153 ID: 5 Buffer: F 10 11 12 13 14 15 16 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 64995 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 65115 ID: 5 Buffer: 10 11 12 13 14 15 16 17 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 17417 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 17535 ID: 5 Buffer: D E F 10 11 12 13 14

And from Com25 T4B2 with DIY breakout:
Code:
 Hello World

T:\tCode\CAN\Tony_sketch_may15a\Tony_sketch_may15a.ino May 20 2019 20:49:56
 Hello World 1
 Hello World 2
 Hello World 3
 Hello World 3a
 Hello World 3b
 Hello World 3c
 Hello World 3d
 Hello World 3e
FIFO Enabled --> Interrupt Enabled
	FIFO Filters in use: 112
	Remaining Mailboxes: 30
		MB34 code: RX_INACTIVE
		MB35 code: RX_INACTIVE
		MB36 code: RX_INACTIVE
		MB37 code: RX_INACTIVE
		MB38 code: TX_INACTIVE
		MB39 code: RX_INACTIVE
		MB40 code: RX_INACTIVE
		MB41 code: RX_INACTIVE
		MB42 code: RX_INACTIVE
		MB43 code: RX_INACTIVE
		MB44 code: RX_INACTIVE
		MB45 code: RX_INACTIVE
		MB46 code: RX_INACTIVE
		MB47 code: RX_INACTIVE
		MB48 code: RX_INACTIVE
		MB49 code: RX_INACTIVE
		MB50 code: RX_INACTIVE
		MB51 code: RX_INACTIVE
		MB52 code: RX_INACTIVE
		MB53 code: RX_INACTIVE
		MB54 code: RX_INACTIVE
		MB55 code: RX_INACTIVE
		MB56 code: RX_INACTIVE
		MB57 code: RX_INACTIVE
		MB58 code: RX_INACTIVE
		MB59 code: RX_INACTIVE
		MB60 code: RX_EMPTY	(Standard Frame)
		MB61 code: RX_INACTIVE
		MB62 code: RX_INACTIVE
		MB63 code: RX_INACTIVE
 Hello World 4
 Hello World 5
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 13333 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 13454 ID: 5 Buffer: C D E F 10 11 12 13 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 31292 ID: 5 Buffer: 6 7 8 9 A B C D 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 31411 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 49251 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 49371 ID: 5 Buffer: 12 13 14 15 16 17 18 19 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 1674 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 1792 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 19632 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 19751 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 37590 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 37708 ID: 5 Buffer: 11 12 13 14 15 16 17 18 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 55549 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 55668 ID: 5 Buffer: 9 A B C D E F 10 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 7971 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 8092 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 25929 ID: 5 Buffer: 6 7 8 9 A B C D 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 26048 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 43888 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 44009 ID: 5 Buffer: F 10 11 12 13 14 15 16 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 61847 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 61968 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 14270 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 14390 ID: 5 Buffer: 13 14 15 16 17 18 19 1A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 32229 ID: 5 Buffer: 4 5 6 7 8 9 A B 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 32348 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 50188 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 50309 ID: 5 Buffer: A B C D E F 10 11 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 2609 ID: 5 Buffer: 4 5 6 7 8 9 A B 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 2728 ID: 5 Buffer: C D E F 10 11 12 13 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 20568 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 20686 ID: 5 Buffer: 14 15 16 17 18 19 1A 1B 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 38528 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 38646 ID: 5 Buffer: 13 14 15 16 17 18 19 1A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 56487 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 56605 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 8910 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 9030 ID: 5 Buffer: 11 12 13 14 15 16 17 18 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 26869 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 26987 ID: 5 Buffer: 13 14 15 16 17 18 19 1A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 44826 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 44945 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 62785 ID: 5 Buffer: 6 7 8 9 A B C D 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 62904 ID: 5 Buffer: E F 10 11 12 13 14 15 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 15208 ID: 5 Buffer: 1 2 3 4 5 6 7 8 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 15329 ID: 5 Buffer: B C D E F 10 11 12 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 33167 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 33287 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 51124 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 51242 ID: 5 Buffer: F 10 11 12 13 14 15 16 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 3547 ID: 5 Buffer: 3 4 5 6 7 8 9 A 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 3666 ID: 5 Buffer: D E F 10 11 12 13 14 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 21505 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 21623 ID: 5 Buffer: 11 12 13 14 15 16 17 18 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 39465 ID: 5 Buffer: 6 7 8 9 A B C D 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 39584 ID: 5 Buffer: B C D E F 10 11 12 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 57424 ID: 5 Buffer: 2 3 4 5 6 7 8 9 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 57544 ID: 5 Buffer: 12 13 14 15 16 17 18 19 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 9846 ID: 5 Buffer: 6 7 8 9 A B C D 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 9965 ID: 5 Buffer: 11 12 13 14 15 16 17 18 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 27806 ID: 5 Buffer: 5 6 7 8 9 A B C 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 27924 ID: 5 Buffer: F 10 11 12 13 14 15 16 
MB 60 BUS 3 LEN: 8 EXT: 0 REMOTE: 0 TS: 45763 ID: 5 Buffer: 2 3 4 5 6 7 8 9

And the code behind CAN\Tony_sketch_may15a\Tony_sketch_may15a.ino::
Code:
#include <FlexCAN_T4.h>

FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_16> Can1;

//  FCTP_OPT::*ptr->begin();
//FlexCAN_T4Base* tonton = Can0;

void setup(void) {
  //tony->begin();
//  Serial2.begin(115200);
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT); 
  digitalWrite(LED_BUILTIN, HIGH);
  delay(2000);
  digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
  delay(2000);
  Serial.println( " Hello World" );
  Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
  
  pinMode(6, OUTPUT); 
  digitalWrite(6, LOW);
  
  Can1.begin();
  Can1.setBaudRate(1000000);
  Can1.setMaxMB(64);
  Can1.enableFIFO(1); Can1.enableFIFOInterrupt();
  Can1.setFIFOFilterTable(A);
  Serial.println( " Hello World 1" );

  Can1.onReceive(MB0, canSniff);
  Can1.onReceive(MB1, canSniff);
  Can1.enableMBInterrupt(MB0, 1);
  Serial.println( " Hello World 2" );

  Can1.setRFFN(13);
  Can1.setFIFOFilter(REJECT_ALL);
  for ( uint8_t i = 34; i < 64; i++ ) {
    Can1.setMB((FLEXCAN_MAILBOX)i, RX, INACTIVE);
  }
  Serial.println( " Hello World 3" );

  Can1.setMB(MB38, TX, STD);
  Serial.println( " Hello World 3a" );
  Can1.setMB(MB60, RX, STD);
  Serial.println( " Hello World 3b" );
  Can1.setMBFilter(MB60, 0x05);
  Serial.println( " Hello World 3c" );
  Can1.enableMBInterrupt(MB60, 1);
  Serial.println( " Hello World 3d" );
  Can1.onReceive(MB60, canSniff);
  Serial.println( " Hello World 3e" );
  delay(100);
  digitalWriteFast(LED_BUILTIN, HIGH );
  Can1.mailboxStatus();
  delay(100);
  digitalWriteFast(LED_BUILTIN, LOW );
  Serial.println( " Hello World 4" );

   Can1.setFIFOFilter(3, 8, STD);
  Can1.setFIFOFilter(7, 290000, EXT);
  Can1.setFIFOFilter(22, 13, STD);
  Can1.setFIFOFilter(27, 5, STD);
  Can1.setClock(CLK_60MHz);
  Serial.println( " Hello World 5" );
}

void loop() {


  Can1.events();
  static uint32_t sending = millis();
  if ( millis() - sending > 1000 ) {
  digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
    sending = millis();
    CAN_message_t msg;
    msg.id = 0x55;
    msg.len = 8;
    msg.seq = 0;
    for ( uint8_t i = 0; i < 8; i++ ) msg.buf[i] = 0xFF;
    for ( uint8_t i = 19; i < 32; i++ ) Can1.write(msg);
    msg.id = 5;
    uint8_t val = random(0, 6);
    delay(1);
    for ( uint8_t i = 0; i < 8; i++ ) msg.buf[i] = val + i + 1;
    Can1.write( msg);
    //    delay(100);
    msg.flags.remote = 0;
    msg.len = 8;
    msg.seq = 1;

    CAN_message_t msg2 = msg;
    val = random(7, 19);
    msg2.len = 8;
    for ( uint8_t i = 0; i < 8; i++ ) msg2.buf[i] = val + i + 2;
    Can1.write( msg2);

  }
}



void canSniff(const CAN_message_t &msg) { // global callback
  if ( !msg.id ) return;

  Serial.print("MB "); Serial.print(msg.mb);
  Serial.print(" BUS "); Serial.print(msg.bus);
  Serial.print(" LEN: "); Serial.print(msg.len);
  Serial.print(" EXT: "); Serial.print(msg.flags.extended);
  Serial.print(" REMOTE: "); Serial.print(msg.flags.remote);
  Serial.print(" TS: "); Serial.print(msg.timestamp);
  Serial.print(" ID: "); Serial.print(msg.id);
  Serial.print(" Buffer: ");
  for ( uint8_t i = 0; i < msg.len; i++ ) {
    Serial.print(msg.buf[i], HEX); Serial.print(" ");
  } Serial.println();
}
 
Just confirmed commenting this out in T:\tCode\libraries\FlexCAN_T4\FlexCAN_T4.tpp::
Code:
#include <FlexCAN_T4.h>
#include "imxrt_flexcan.h"
#include "Arduino.h"

[COLOR="#FF0000"]//#define Serial4 Serial[/COLOR]

Even on ONE end Causes CAN\Tony_sketch_may15a\Tony_sketch_may15a.ino to fail. and hang before Can1.mailboxStatus(); returns on that T4 and the other still runs - but no prints or activity.
 
this is CAN2.0 legacy on CAN3. FD not implemented yet, everything you see in stream is CAN2.0 only atm.
This validates the hardware is working and connected properly, Mike’s SDK does T4 to T4 in FD mode however they don’t seem to talk to the mcp2517fd, probably bad SDK timings or something and since both t4’s run the same sdk it’s a given it should work..
 
Just confirmed commenting this out in T:\tCode\libraries\FlexCAN_T4\FlexCAN_T4.tpp::
Code:
#include <FlexCAN_T4.h>
#include "imxrt_flexcan.h"
#include "Arduino.h"

[COLOR="#FF0000"]//#define Serial4 Serial[/COLOR]

Even on ONE end Causes CAN\Tony_sketch_may15a\Tony_sketch_may15a.ino to fail. and hang before Can1.mailboxStatus(); returns on that T4 and the other still runs - but no prints or activity.

maybe because serial4 is not initialized?
 
Status
Not open for further replies.
Back
Top