This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EPass and EWarn reset in TMS320F28377D

Other Parts Discussed in Thread: TMS320F28377D

Hi All,

I am working with CAN network on TMS320F28377D. In my network, I have considered 28377D as a CAN host (Master Control) and another two 28069 as a CAN device(Slave Control 1 and 2).

In fault case (for my inverter application), Slave control 1 and 2 both put data simultaneously on CAN bus. Master Control discard that data due to collision detected in frame. Now what happen again both Slave put data on bus due to continuous re-transmission enable then again master will discard data then again same process repeat.

After some time Epass and Ewarn set to '1' and RX Error counter is full and Master Control bus remains into off stat permanently until I remove one node(any of Slave Control) from bus after it will active again.

So what to do in this situation? How can I reset Epass, Ewarn and Error Counter? I tried to reset bus by init bit but nothing is happening.

Test Case:

  1. CAN is configured as per example in control suite by calling InitDCana(); 

  2. CAN configured at 125kHz and ABO is ON
  3. In my application fault is coming same time in both Slave node. So, Slave Control node send PDO @ same time

Regards,

Maulik

  • Maulik,

                A "collision" should never happen in a CAN bus. What could happen is "contention" which is resolved by bit-wise arbitration. Remember CAN is termed CS/MA/CA (Carrier Sense/Multiple Access/Collision Avoidance ---- not Collision Detect , like Ethernet) . Are the slaves transmitting with the same MSGID? If the slaves are transmitting with different MSGIDs, I don't see how a situation like what you have described could happen.

     

  • Dear Hareesh,

    Thanks for reply.

    I had used collision instead of contention, that was my mistake. Thanks for clarifying about bit-wise arbitration.

    Yes, Slave is transmitting with different MSGID. But i got error(Epass, EWarn and RX msg error counter full). How can i overcome with this situation? Which kind of take care should i take?

    Note:  When there is only 1 slave(one to one communication) then there is no problem everything is healthy but when 2nd slave is connected (Network) at that time problem is started.

     

    Regards,

    Maulik

  • Maulik,

     

    Contention should not cause any error. The protocol is designed to resolve contention gracefully. Are you sure the slaves are not putting out the same MSGID on the bus? While this may not cause a problem during arbitration phase, it will generate error when the bits in the data-bytes start differing. There is some other problem, I think.

     

    Have you tried a lower bit-rate? Say, 50 kbps, for example?

     

    Are you using an external clock source or the INTOSC for 28069? If you are using INTOSC, do you perform temperature compensation of INTOSC?

     

    What is the end-to-end bus length?

     

    Has the bus been terminated correctly (with 120-ohms) at either ends (only)? (The bus must be terminated only at either ends and with a 120-ohm resistor. IOW, no more than two terminator resistors may be present on the bus, unless split termination is followed, in which case there will be two resistors on either ends).

     

    Have you tried to reduce the bus length?

  • Dear Hareesh,

    Thanks for your proper guidance. I will check and let you know whatever it is.

    Thanks and regards,
    Maulik Timbadiya
  • Dear Hareesh,

    1. No, slave is not putting data with same MSGID on bus. MSGID is different.
    2. Problem exist with reduced speed.
    3. I'm using External clock source for 28069. (20Mhz and afterward it will boost through internal PLL to 90Mhz)
    4. I'm using optical fiber for communication.
    5. Is there any need for termination when i use optical instead of wired connection. what do you think?
    6. In case of optical fiber, I think bus length doesn't matter.

    Special Note: Im sending NMT command to all slave -> all slave receive it and reply PDO at a time with different MSGID.
    Is there any problem with this process? Because when i am sending NMT at that time only problem occure. And one more thing, Problem does not exist when there is single slave on network.

    Regards,
    Maulik Timbadiya

  • Maulik,

                It is important to first determine if this is a physical layer (hence H/W) issue or a software issue. I would like to eliminate CANopen from the picture and determine whether the physical layer is good. i.e. if the 3 nodes in your system (1 x 28377 & 2 x 28069) are able to communicate with each other without any problem. Try "one node to another node" and "one node to the other two nodes (broadcast)". Once we are convinced that the physical layer is perfectly fine, we can turn our focus elsewhere.

     

    Optical fiber is a somewhat unusual choice for the physical layer. Admittedly, the CAN protocol specification does not mandate a specific physical layer. That being said, I am curious how the bus has been implemented. Specifically, how the ACK signal is sent to the transmitter. Yes, termination applies only to "regular" wires.

     

    I find some contradiction in your post:

     

    You say "I am sending NMT command to all slave -> all slave receive it and reply PDO at a time with different MSGID". This seems to indicate that there is no problem in the physical layer and all 3 nodes are able to communicate with each other.

     

    But, in the next line, you say "Because when i am sending NMT at that time only problem occurs".

  • Dear Hareesh,

    No issue with physical layer. Because, Network working properly in normal condition. Problem happens only when i issue NMT command for "system ready check" and "fault reset". For example, when i issue NMT command to all node to reset fault (Not can fault, This is panel external fault not related to CAN) . both node respond at same time with different MSGID (With updated status of fault) . I can see in the waveform that network work properly as per timing set and all. But when NMT is issue at that time both slave fall down into continuous retransmission after some time Master fall down into BUS OFF state. And Due to Auto Bus On feature network working properly after sometime.

    Note: This is not happening all the time when NMT command is issue but Sometimes only. Approx. 1 out of 10 trial.

    How can i solve this issue. Any specific software care should i take? Please suggest.

    Regards,

    Maulik

  • Maulik,
    My last response was one year ago, so I am surprised this issue still remains unresolved.

    You are saying normal communication is OK and even in the case of NMT, this happens only once out of 10 tries. Have you captured the data coming out of the two slaves to ensure that they are indeed transmitting with two different MSGIDs? You may also be able to figure out at what points the error flags are transmitted. Can you add a small delay to one of the slaves, so that they both don’t transmit at the same time, when master issues the NMT command?
  • Dear Hareesh,

    Before One year: I have added small delay to the slave as per id alloted and observed it is working fine.

    (Already done the same thing as u said)

    But now a day i have a question: as per CAN specification, if data transmit at same time may not cause any problem then why this is happening?

    If both slave started to transmit at same time then the lower id always win arbitration as per protocol.

    1. I have confirmed that both slave transmitting with different MSGID.

    2. In my case when this kind problem arias, bus will go in to continuous retransmission. After random time it will be covered back. That time may be 1 to 3 min.

    Thanks and regards,

    Maulik

  • Maulik,

                You are correct that two nodes (with different MSGIDs) may start transmission at precisely the same time and that the node with the numerically lower MSGID will win arbitration. The key phrase here is " with different MSGIDs ". You have already confirmed that the two slaves have different MSGIDs. If that is indeed the case, then what you describe should not be happening.

     

    Hard to debug this further without more knowledge of the system. Could you work with your local TI FAE to share the schematics of the CAN portion of your system? I also need to look at the scope capture of the CANTX pin of both slaves.