Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Connection timeout error

I am currently trying to connect to a third party ECU via the ECU toolkit. I am running V8.2 of labview and V2.1 of the toolkit with a series 2 hi-speed PCI NI-CAN card. When I try to connect to the ECU I get a timeout error "-301096: Timeout ocurred while waiting for response from slave device".
When the A2L file is initially loaded, the individual characteristic and measurement tables load without a problem but the CAN settings do not load. As a result, I use the MC set property vi to manually set CRO id, DTO id, baud rate, byte order and command byte order (after using the hex string to number conversion vi). I also manually set the seedkey dll's but I don't think that the program is getting that far since I have also tried putting in non-existant seedkey dll's and this has no effect.
I have tried increasing the timeout by factors of 10 and 100 by using the "Set Prop Timing factor" Vi as this is given as a solution to problems with the series 1 boards but this does not help.
I am using extended (29 bit) identifiers and in one of the supplied examples, there is a multiplication by 20 million and I have also tried this (it changes the CRO id from 0CCCCCCC to 2CCCCCCC for example).
I have tried using an XCP type connection but I get the same error.
I have checked the physical state of the CAN bus by looking at the CAN0 channel in MAX and the bus monitor reports no errors and seems to have 3 distinct messages that keep repeating. When in 'listen only mode', the number of repeated messages returns to 1.
I have included here an excerpt from the A2L file I am using and I have been manually setting up the ECU properties as follows:
 
connection type CCP:CAN0
baud 250000
CRO id: 0CCCCCCC
DTO id: 0DDDDDDD
Station address: 100
Byte order/cmd byte order: 1
 
Is there a way to tell if the Exchange_id function in the CCP protocol is being called? It seems to me that it must be falling over somewhere in here as this is needed in order to compute a correct seedkey for any unlocking of parameters. I would be grateful of any suggestions to help get this up and running.
 
Note that I have changed the proprietary A2L information.
Dan
 
0 Kudos
Message 1 of 9
(15,966 Views)

Hi,

The data structure of the A2L file snipped you attached, does not comply to what our parser expects. What tool did you use to create the A2L file.

DirkW

0 Kudos
Message 2 of 9
(15,938 Views)

Hi Dirk,

I was given the A2L file by one of our customers, I do not know what tool was used to create it. I have gotten past the timeout error now by changing the DTO and CRO id's. The new error message is that the ECU resources were unable to be unlocked and to check the relevant Seedkey dll's. The Seedkey dll's are in the same directory as the A2L file and the VI's. I know that the Seedkey is the correct one because I can use it with the A2L with a different program (VISION). Is there any way to manually check what data is being received for the seed? Should I try an use a call library node to call the Seedkey dll directly to check that it is calculating correctly and if so is there a way to obtain the function prototype for this dll (it only has one exposed function which is calculate from seed)? 

Alternatively, would it be easier to try and capture the frames sent by VISION to unlock the ECU and duplicate these at a low level by calling ncWrite or similar in a call library node?

Dan

 

0 Kudos
Message 3 of 9
(15,933 Views)
Hi Dan
 
I dont think there is a way of manualy checking data from the seed. Did you manage to get this sorted by grabbing the Vision frames and trying this duplication method. It looks like an interesting problem you have, how did it go/is it going?
 
best regards
Graham Green

Sr. Product Marketing Manager

National instruments
0 Kudos
Message 4 of 9
(15,752 Views)
If the problem is  with the A2l file have you tried creating your own as a constant or control, testing this and then reverting back to the one used by your client? 

You can generate .a2l files through various third-party utilities. For example:

https://www.vector-worldwide.com/vi_asap2_editor_en,,9656.html

best regards

Graham Green

Sr. Product Marketing Manager

National instruments
0 Kudos
Message 5 of 9
(15,748 Views)

Hi Graham,

I tried starting off from a completely blank A2L and added connection parameters one at a time until I was sure each line was being read correctly by the toolkit parser. This seemed to work fine but the connection would open, try to unlock ECU resources and then return an error that the resources were unavailable and I should try a different seedkey.dll. I captured the CAN frames that were being sent via a second CAN card to look at the exact command sequence. I then extracted the seed data from the get seed reply frame and used a call library node function to call the seedkey.dll. This returned a different key to the one that was being sent in the unlock command so I could only assume that the toolkit is not calling the seedkey correctly somehow but since this is all hidden in a dll, I could not look at the exact mechanics to see what was going wrong. I then built a  VI using the frame API stuff that comes with the NI-CAN drivers cd to manually send the the frames required to connect then get seed. I use the same call library node function to call the seedkey.dll and then build another frame with the returned key. This all seems to work fine and I have an unlocked ECU. Unfortunately since I did all this with the frame API, there was no way to subsequently use the toolkit vi's as they are built around the channel API which is apparently incompatible. Feeling completely frustrated with the non-functional toolkit and having logged a couple of tech help requests with NI I have given up on the tooklit altogether, built my own A2L parser and I am almost finished with the communications interface using the frame APIs. Thanks anyway,

Dan

0 Kudos
Message 6 of 9
(15,716 Views)

Dan,

Sorry to hear that you could not get it running with the TK. Attached you can fin a CCP Logger example to log the CCP communication on a certain Bus. If you have a spare CAN port connected to the same Bus as your ECU communication is running, you could run this logger to log the low level CCP communication between your application and ECU.

Perhaps it helps fixing the seed Key issue if you see what the details are.

If you are still interested, please post the log file, so i could have a look to it.

DirkW

0 Kudos
Message 7 of 9
(15,692 Views)
As the seed is different each time, there was no way to copy an old key code copied from Vision.
I dont think that the steps tacken  to unlock the ECU was ASAM valid hence the Toolkit failed.
Some calls must be in Intel format even if the rest is Motoroler (ASAM2 specs).
The code reverses the four seed code bytes before getting the Key then reverses the four Key byte before Unlocking the ECU.
How would the Toolkit know that it needed to do this as I can not find anything in the ASAM spects that require this.
Am I missing something here.
 
The a2l file was invalid and fails using the Vector a2l Editor, the first line was (version number) .
There was new and old ASAM Version formats mixed together.
I failed to fix all the problems.
 
Our inhouse a2l files are also invalid as created by the tool used, but I have managed to fix all the problems with the file
so the it loads OK with the Toolkit except that the number of measurements are  around 13,000 ( 19,500 with carateristics ) which is slow to load and some time, times out loading.
As we are not using a seed key I forsee no problem but I am unable to test untill I have a test ECU.
The only problem I see is that there are some odd bits added by Vision to get there software working with our ECU.
If this proves to be  a problem would NI do the same to get there Toollkit working with our ECU?
 
Ta
Colin
Delphi
 
 
      
Message 8 of 9
(15,449 Views)
Dan 55, you say you built your own .A2L parser? I was just about to do this myself. I don't suppose you would consider posting your vis?

Thanks, Smiley Wink
Troy
Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 9 of 9
(15,309 Views)