Forums

Timestamp of periodic frames on CANalyzer.

Started by Achilles April 23, 2007
Hi All,

I have written a CAN driver for star12 controller. And I do have some
periodic frames for transmission. I am using not any commercial RTOS
but I do have created my own scheduler for the scheduling different
tasks. I am using a debugger for software download & debugging and I
am also using vector CANalyzer for monitoring the CAN frames on the
bus. Now the problem which I am facing is as below.

Scenario 1: I run my CANalyser, and I power on my ECU, I am observing
the periodic frames appearing on the CAN bus (CANalyzer trace window)
with correct periodicty and everything works fine.

Scenario 2: I Power on my ECU and then I run my CANalyzer. Now for
initial few periodic frames, I am not receiving them at correct
periodicity but after sometime the periodicity becomes correct and the
communication is proper. I dont get any error frame too.

Can anyone explain me the IInd scenario, why I am seeing this kind of
behavior on CANalyzer trace window?

My initial guess was that there may be message buffer on the CANalyzer
which stores few messages and then suddenly when I start the
CANalyser, it throws out all the message and display the timestamp of
priniting the messages, not the timestamp of message reception.

Please help me in this regard.

Thanks in advance

Regards
AKhilesh

Achilles <akhil.misra@gmail.com> wrote:
> Hi All, > > I have written a CAN driver for star12 controller. And I do have some > periodic frames for transmission. I am using not any commercial RTOS > but I do have created my own scheduler for the scheduling different > tasks. I am using a debugger for software download & debugging and I > am also using vector CANalyzer for monitoring the CAN frames on the > bus. Now the problem which I am facing is as below. > > Scenario 1: I run my CANalyser, and I power on my ECU, I am observing > the periodic frames appearing on the CAN bus (CANalyzer trace window) > with correct periodicty and everything works fine. > > Scenario 2: I Power on my ECU and then I run my CANalyzer. Now for > initial few periodic frames, I am not receiving them at correct > periodicity but after sometime the periodicity becomes correct and the > communication is proper. I dont get any error frame too. > > Can anyone explain me the IInd scenario, why I am seeing this kind of > behavior on CANalyzer trace window? > > My initial guess was that there may be message buffer on the CANalyzer > which stores few messages and then suddenly when I start the > CANalyser, it throws out all the message and display the timestamp of > priniting the messages, not the timestamp of message reception.
Canalyizer is a mature and widely deployed system, and is not very likely to behave like you describe. It's much more likely that the bug is in your own code instead. If you want to be sure, connect a oscilloscope to your can bus and take a close look at the exact timing of the packets on the bus. If you have some spare gpio lines, connect those to the scope as well and trigger the IO's on important events in your code - interrupt handlers, schedulers, etc. This might quickly lead you to the source of the problem. -- :wq ^X^Cy^K^X^C^C^C^C

Achilles schrieb:
> > I have written a CAN driver for star12 controller. And I do have some > periodic frames for transmission. I am using not any commercial RTOS > but I do have created my own scheduler for the scheduling different > tasks. I am using a debugger for software download & debugging and I > am also using vector CANalyzer for monitoring the CAN frames on the > bus. Now the problem which I am facing is as below. > > Scenario 1: I run my CANalyser, and I power on my ECU, I am observing > the periodic frames appearing on the CAN bus (CANalyzer trace window) > with correct periodicty and everything works fine. > > Scenario 2: I Power on my ECU and then I run my CANalyzer. Now for > initial few periodic frames, I am not receiving them at correct > periodicity but after sometime the periodicity becomes correct and the > communication is proper. I dont get any error frame too. > > Can anyone explain me the IInd scenario, why I am seeing this kind of > behavior on CANalyzer trace window? >
If there is no other controller on the CAN bus the first message of your ECU will stick in your controller and will be retransmitted until it gets an Ack finally from CANanalyser. Your controller and error handling may vary, but you should check how you handle this situation. That is: a message which can not be transmitted for a long time because of missing Ack.
"Achilles" <akhil.misra@gmail.com> wrote in message 
news:1177331069.062303.51190@y80g2000hsf.googlegroups.com...
> Hi All, > > I have written a CAN driver for star12 controller. And I do have some > periodic frames for transmission. I am using not any commercial RTOS > but I do have created my own scheduler for the scheduling different > tasks. I am using a debugger for software download & debugging and I > am also using vector CANalyzer for monitoring the CAN frames on the > bus. Now the problem which I am facing is as below. > > Scenario 1: I run my CANalyser, and I power on my ECU, I am observing > the periodic frames appearing on the CAN bus (CANalyzer trace window) > with correct periodicty and everything works fine. > > Scenario 2: I Power on my ECU and then I run my CANalyzer. Now for > initial few periodic frames, I am not receiving them at correct > periodicity but after sometime the periodicity becomes correct and the > communication is proper. I dont get any error frame too. > > Can anyone explain me the IInd scenario, why I am seeing this kind of > behavior on CANalyzer trace window? > > My initial guess was that there may be message buffer on the CANalyzer > which stores few messages and then suddenly when I start the > CANalyser, it throws out all the message and display the timestamp of > priniting the messages, not the timestamp of message reception. > > Please help me in this regard. > > Thanks in advance > > Regards > AKhilesh
Have you properly terminated the bus ? Is your ecu set as a master or a slave ? Does canalyser act as a master or a slave ? Is your canalyser set in the correct mode ? Alex
thanks to all you guys.

I could resolve the issue.  Actually there was a circular buffer in my
software, where I first copy the message for transmission and in every
task I copy the message from there to harware buffer. So when the
canalyzer was off, and ECU powered on, the number of messages stored
in the circular buffer were growing because the old frames were
pending in the hardware buffer because they dint get the
acknowledgement from the other node which was CANalyzer.
Once the CANalyzer was on, all the messages were transmitted and the
periodicity was wrong.
the same behavior was not observed when the CANalyzer was swithced on
before the ECU power on.

Alex: CAN is a multimaster protocol. So there is no concept of master
and slave.Can you please tell me what did you mean by Slave and master
configuration in CAN ? May be I dint get what exactly information you
wanted to ask.


Thanks again to all of you.

On Apr 25, 10:43 am, "Alex Gibson" <n...@alxx.org> wrote:
> "Achilles" <akhil.mi...@gmail.com> wrote in message > > news:1177331069.062303.51190@y80g2000hsf.googlegroups.com... > > > > > > > Hi All, > > > I have written a CAN driver for star12 controller. And I do have some > > periodic frames for transmission. I am using not any commercial RTOS > > but I do have created my own scheduler for the scheduling different > > tasks. I am using a debugger for software download & debugging and I > > am also using vector CANalyzer for monitoring the CAN frames on the > > bus. Now the problem which I am facing is as below. > > > Scenario 1: I run my CANalyser, and I power on my ECU, I am observing > > the periodic frames appearing on the CAN bus (CANalyzer trace window) > > with correct periodicty and everything works fine. > > > Scenario 2: I Power on my ECU and then I run my CANalyzer. Now for > > initial few periodic frames, I am not receiving them at correct > > periodicity but after sometime the periodicity becomes correct and the > > communication is proper. I dont get any error frame too. > > > Can anyone explain me the IInd scenario, why I am seeing this kind of > > behavior on CANalyzer trace window? > > > My initial guess was that there may be message buffer on the CANalyzer > > which stores few messages and then suddenly when I start the > > CANalyser, it throws out all the message and display the timestamp of > > priniting the messages, not the timestamp of message reception. > > > Please help me in this regard. > > > Thanks in advance > > > Regards > > AKhilesh > > Have you properly terminated the bus ? > > Is your ecu set as a master or a slave ? > Does canalyser act as a master or a slave ? > Is your canalyser set in the correct mode ? > > Alex- Hide quoted text - > > - Show quoted text -