Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • tonton81's Avatar
    06-01-2020, 01:01 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-28-2020, 02:18 PM
    RX and TX? RXQSize() TXQSize() ? still unconventional naming in the arduino field, still deciding :P
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-28-2020, 12:50 PM
    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...
    5 replies | 118 view(s)
  • tonton81's Avatar
    05-27-2020, 10:47 PM
    sure, we just need a name for the function to return size for rx and tx
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-27-2020, 08:35 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    for now, until i figure it out
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-27-2020, 08:28 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    yup, queue management issue (with or without interrupt probability)
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-27-2020, 07:51 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-27-2020, 07:30 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-27-2020, 06:32 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    yeah once they drop off the active list, transfers to them are blocked, the timeouts made me work on that to prevent delays caused by missing nodes by making sure theyre on the list before sending
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-27-2020, 06:23 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    maybe theres an issue with the displacement of 2 transfers, can you try with only one node to see if it still crashes master?
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-27-2020, 06:06 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    what happens if you use broadcast (Node), does the other slave freeze?
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-27-2020, 06:03 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    not sure, skpang used it to transfer images (pictures) over CAN to display on a remote LCD, so that being a higher size of bytes I am thinking its a code issue as well :P
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-27-2020, 05:53 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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?
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-26-2020, 10:37 PM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-26-2020, 12:41 PM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-26-2020, 04:38 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-25-2020, 10:47 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-25-2020, 10:38 PM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-25-2020, 06:50 PM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    yes thats why Node.sendMsg is there, all nodes will get it :)
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-25-2020, 06:01 PM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-25-2020, 05:09 PM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    it's a singleton, either can be used to set the ID of local node
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-25-2020, 12:47 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-25-2020, 10:09 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    TeensyCAN node36 = TeensyCAN(36); if you have nodes 2 3 8, on node 2, put: TeensyCAN node3 = TeensyCAN(3); TeensyCAN node8 = TeensyCAN(8); on node 3, put: TeensyCAN node2= TeensyCAN(2); TeensyCAN node8 =...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-25-2020, 09:59 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-25-2020, 09:55 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-25-2020, 09:46 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-25-2020, 03:49 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    yes' correct. well they receive, you need to put something to transmit so the other teensy can see it. CAN_message_t msg; msg.id = 0x123; Can0.write(msg);
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-25-2020, 02:46 AM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-25-2020, 02:36 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-20-2020, 04:56 AM
    yes this is why these are tests for new update later on, thats why I didn't want to touch the repo, I'm a bit busy this week but I'll try to work on it more
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-19-2020, 04:19 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-19-2020, 03:32 AM
    thats weird, I just left the house and it was working using the 2 sketches posted, ill check it again when i get home from work
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-19-2020, 02:55 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-19-2020, 01:28 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-18-2020, 02:19 AM
    RFP30N06 Logic level mosfets
    3 replies | 120 view(s)
  • tonton81's Avatar
    05-17-2020, 09:18 PM
    Added your code correction, except rather than adding a line I moved: txBuffer.pop_front(); /* clear on write */ code = 0; /* MSADIE - clear code before configuring for new tx frame */ // deleted ...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-17-2020, 06:44 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-17-2020, 04:52 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-17-2020, 03:58 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-17-2020, 03:27 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-08-2020, 10:46 PM
    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
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-07-2020, 05:29 PM
    tonton81 replied to a thread TeensyCAN in Project Guidance
    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...
    51 replies | 1428 view(s)
  • tonton81's Avatar
    05-06-2020, 11:26 PM
    I managed to work on a 4D library that is able to also retrieve live values from LCD's objects, without needing to code in callback. It also doesn't go out of sync either.
    26 replies | 5022 view(s)
  • tonton81's Avatar
    05-06-2020, 10:46 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-06-2020, 05:34 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-06-2020, 03:52 PM
    More info:
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-06-2020, 03:48 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    05-06-2020, 01:49 PM
    Are you using pins 6 & 14 of the OBD port with proper bitrate selected? What library are you running? What transceiver are you using? How is your wiring setup diagram?
    1 replies | 88 view(s)
  • tonton81's Avatar
    04-29-2020, 01:47 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-29-2020, 04:36 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-28-2020, 03:07 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-26-2020, 08:28 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-26-2020, 06:01 PM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-26-2020, 11:27 AM
    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
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-26-2020, 10:35 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-24-2020, 06:01 AM
    Thats because pinMode reconfigures the pin to gpio (not serial). You can modify the pin register for pullup by enabling the bit but leaving other ones intact, then it will work :)
    5 replies | 128 view(s)
  • tonton81's Avatar
    04-16-2020, 05:45 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-16-2020, 05:01 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-16-2020, 04:00 AM
    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...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-14-2020, 04:04 AM
    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?...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-13-2020, 11:05 PM
    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)...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-08-2020, 06:41 AM
    This may be better to check ID and datafields: #include <FlexCAN_T4.h> FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_16> Can0; void setup(void) { Serial.begin(115200); delay(400); pinMode(6, OUTPUT);...
    268 replies | 18615 view(s)
  • tonton81's Avatar
    04-08-2020, 06:30 AM
    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...
    268 replies | 18615 view(s)
No More Results
About tonton81

Basic Information

About tonton81
Biography:
Seriously? ;)
Location:
Montreal, Canada
Interests:
computers, micros, telecoms, gate systems, access systems, security systems, cars
Occupation:
sorter/driver/shipping

Statistics


Total Posts
Total Posts
3,337
Posts Per Day
2.63
Last Post
FlexCAN_T4 - FlexCAN for Teensy 4 06-01-2020 01:01 PM
General Information
Last Activity
Today 01:43 AM
Join Date
12-18-2016