If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

New update:
getRXQueueCount() and getTXQueueCount() added.
As requested over at github by jeremy: https://github.com/tonton81/FlexCAN_T4/issues/9
It adds the ability to filter based on arbitrary masks, very...

no need to write it low, its low by default when set by pinmode to output, maybe try putting volatile asm "dsb" after pinmode?
EDIT, a resistor like kurt said is recommended, as the pins are in high-Z whenever teensy...

if the lockup is from callback or loop(), serial prints usually find where the last line locked up. if its from an isr then prints wont work unless you put them in library
if you are only doing 12 bytes, you can do...

its probably an overlap between nodes that would need to be fixed, on the reassembly side (receiver). if it locked up, it doesnt tell me if it was an array overlap or a memmove transfer injected to wrong array, its been...

check the constructor TX_SIZE, keep it a power of 2, it's gotta be able to be big enough to support your array size in 8 bit chunks. 8x16 = 128bytes max, have you tried normal one dimensional arrays rather than structs?

yes, correct, for bus self recovery to work it must see valid frame bits on the bus, which will drop the TX overflow errors and the controller would go back online. There is no command for forced bus recover, but it...

thats normal because with 2 nodes on the bus the nodes couldn't self-recover if both went into passive error state, with no other traffic to acknowledge. ideally the bus is not supposed to be shorted especially for long...

not sure how to approach that, still confused on your explanation. ohhhhh i see what you are saying, well FIFO for RX receives in order as long as you dont have any RX mbs taking frames from it, then seq them to the...

I'm glad the transmit from ISR is working for you, that shows progress. I am not too technical on the 1 bit term, or why you need 2 mailboxes for sequential, or which of the 2 would release first, but in the isr (per...

Serial was implemented, there was more to be implemented, like remote I2C, SPI, analog, digital pin access. what i liked about the global method is for synchronizing multiple MCU gpio pins over a single message. Node...

it will automatically adjust to the size on the network.
lowest DLC to support global nodes, DLC of other node if capable of sending to it's size, otherwise it will use lower size automatically. CANFD is "up to" 64...

Here is a new test of transmit interrupts! redesigned starting from the github copy. Transmit interrupts are enforced now, there is no way to disable them without breaking isr & loop handling of TX queues. Test ran...

check the constructor for node100, that points to the node you want. on the other nodes, you add the nodes you want to control as well. this is a 2way library where they are all multi-master.
the nodes are...

basically, Node sends to all nodes, its global, whereas your specific node100, only receives the data.
if you do Node.Serial.println("hello world");, all nodes will print that to Serial port.
if you do that to...

no dont do that, that puts the controller in HALT mode, the imask bits need to stop the controller to change them, and you also disabled any mailbox interrupts as well
events() wasnt used during my tests, so it can...

you need to use FlexCAN_T4 constructor, not FlexCAN_T4FD, and use CAN1 instead of CAN3
Also, it's good to run one of the FlexCAN_T4 demos to confirm your connections are good before working on TeensyCAN as it relies...

I reverted the interrupt transmits as it wasn't stable compared to the loop, and made all transmits not able to occupy a mailbox into the TX queue, not just sequential ones. Loopback mode and wake up mode have been kept...

only reason i moved it was because something was throwing off between sequential or remote frames, but that may have been fixed somewhere else or that line was necessary, Im testing 3 types to make sure itll work. so...

EDIT, update, can you try this? Seems to work now for sequential and non sequential with no events() in loop(). As for remote frames they seem to be causing their own problem in sequential, so those ones i force to any...

lack of traffic you must use events(), it'll receive one and dequeue one or more transmits. without events() the transmits only happen whenever the ISR is firing, like from receptions. otherwise you need to include...

The interrupt needs to be enforced to be on even if the user hasn't implemented it, otherwise the transmits won't fire from the ISR, and it would break remote frame capability in the ISR since flexcan switches the MB to...

Just added wake up on traffic support.
You can call:
asm(" wfi"); in your code to goto sleep. The loop() will stop scrolling after shorting out the CAN lines when the wfi enters sleep. Removing the short on the CAN...

thanks, I was worried about the weight at first on the glass desk, but the back and front legs line up easily on the cross bars under holding the glass, so no pressure on the glass itself, the width is just perfect for...

Well finally got my monitor today, first time I ordered one online after having a dead one for couple months!
Fits perfect on the desk lol.......
Anyways, I started working on flexcan code, I will post test...

You can't set a signed value to a array of unsigned bytes. What you want to do is cast a signed byte to an unsigned byte to the array then at other end you cast back the unsigned byte as a int8_t to get it back

The CAN data is bytes only, you will need to handle the data in the array, splitting up the floats to bytes and back at other end. You could always use the PacketID of the data to identify which frames are identified...

Supposedly it can wake itself up, I havn't played in that low power field yet, but like I said on cars pins 6 and 14 are the high speed network thats only running when ignition is on, body controller network goes to...

Can0.setRX() without value reinits the pin to default location
Theoretically the CAN supposed to self wake without user intervention
Dont rerun the constructor. These are compile time objects, it wont be dynamically...

The WAKMSK bit is already set in the MCR register. It should already work just check the reference manual. Not sure if this applies to this scenario, or if flexcan refers to ANY frame for wakeup, but when a car shuts...

That data shows that flexcan is in process of transmitting in hardware, and not receiving ACK from network, so that leaves 2 only possibilities:
Baudrate calculation (which i doubt, since you are receiving)
and...

msadie is correct, if you start seeing the transmit buffers fill but not actually transfer, yet reception works, there is an issue with the transceiver. I have yet no evidence to suspect any software in play here...

My tests are ran off the pjrc and skpang breakout boards, CAN1 is connected to BCAN of vehicle at 125kbps and CAN2 is connected to FCAN of vehicle at 500kbps. Did you check if mailboxStatus() displays TX info pending on...

I reloaded the github release onto my car's T4 to make sure it was the latest loaded, and it's still transmitting fine on the bus. I didn't like the faint chirp of the beeper in the back so when arming the car i send...

Maybe try simple transmitting code in addition from a receiving sketch to check if their are transfers, if you still cant see any transmits, try printing mailboxStatus() after awhile to see if the transmit mailboxes are...

Use a receive demo to make sure your receiving traffic, to make sure transceiver works before transmitting, I was referring to the standby pin on transceiver, if its not held low the traffic may not flow

Is your Rs pin tied low on the transceiver? When you say output, do you see any data reception on the bus to confirm your seeing the stream? What pins are you using on T4 for the transceiver?
I don't see any...

The first mailbox found, iflag or not is irrelevant, as long as it is seen as a TX mailbox. If its state is TX_INACTIVE, only then will queue populate it.
The iflag wont be set on the initial transfer, we clear the...

Events() only queues sequentials. Normal writes are sent if mailboxes are available. However, we will handle interrupted TX differently. All seq and normal writes are immediately queued. Once the ISR fires, mailboxes...

Ahh but the queue library is FIFO/LIFO, plus it also has a feature to pull in-between queues, although thats something I wouldn't touch while mixing loop() with ISR. I could however put normal writes at end of queue and...

Sounds good so if we were to be bursting frames you recommend we let the ISR handle it via an interrupt enabled TX mailbox, and have regular writes use other mailboxes? Or just have sequential transfers in ISR? or both?...

I believe you are transmitting too fast causing the transmit errors rising past 128. Check the ESR1 and ECR registers in the datasheet. To me it looks like you are receiving and sending frames, if this occurs (TXing)...

I am using this code between 2 T4's using CAN3 in legacy mode, both on PJRC boards. I output the millisec between each frame and I just change the rates of the other T4 sender
If I send frames at 200ms intervals from...