Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Find Supported Commands on XCP

Solved!
Go to solution

So in the XCP protocol there is a bunch of commands that are optional and if the ECU you are talking to doesn't support the command it will return with a negative response of Unknown Command.  Now is there a way to know what optional commands an ECU supports without first performing this command and seeing the error or not?  I thought the A2L might list the commands and sure enough near the start there is a "OPTIONAL_CMD" section and the comment for the example one from NI is 

 

/* XCP-Code of optional command supported by the slave */

 

But listed here is DOWNLOAD_MAX which if you issue on NI's simulated ECU returns the Unknown Command from earlier.  So my question is two-fold I guess.  How can I know what commands an ECU supports?  And if the answer is the A2L file then is NI's simulator not working properly?  Oh and is there an easier way to read these values, or do I need to do the file I/O and string parsing myself?  Thanks.

0 Kudos
Message 1 of 6
(3,264 Views)
Solution
Accepted by topic author Hooovahh

Hi Hooovahh,

I ran the question by the devs and received the following response.

 

For the specific question "... is there a way to know what optional commands an ECU supports..." the general answer is to work with the supplier of the ECU.

 

To answer more specifically... the A2L could list all supported optional commands, however, the keyword OPTIONAL_CMD is part of the non-formal section of the A2L definition. This section is optional and usually vendor specific so having faith in this section boils down to having faith in a specific ECU manufacturer populating it completely. 

 

The OPTIONAL_CMD isn't really used in the XcpECU.a2l file that ships with ECUMC. The OPTIONAL_CMD in the file is part of the type declaration section and simply indicates that we may use the keyword. We don't actually publish the optional commands for the Demo ECU within the a2l file. 

 

Jeff L
National Instruments
Message 2 of 6
(3,236 Views)

@JefeL

 For the specific question "... is there a way to know what optional commands an ECU supports..." the general answer is to work with the supplier of the ECU.  

Since working with the supplier is not always an option in my case, it seems the try it method and if error then don't use that function will be what I move forward with.  Keeping that in mind I can keep track of what optional commands returned an error and to know not to try that again in future calls.  Thanks.

0 Kudos
Message 3 of 6
(3,233 Views)

Obviously, it is easier to get the information from the suppliers when working with them.  However, If you are able to "listen" in on the communications for a particular ECU in its native environment, you should be able to "see" the primitive commands along with their data packets plus any optional commands that may be in use.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 4 of 6
(3,224 Views)

Also not possible in this case, as it is the testing environment, but thank you for your suggestion.

0 Kudos
Message 5 of 6
(3,220 Views)

I will file a feature request to see if we can add some new functionality. It won't be of immediate help but maybe we can improve a future version.

Jeff L
National Instruments
0 Kudos
Message 6 of 6
(3,218 Views)