CRC value inside a Tx CAN message

  • Software
  • CRC value inside a Tx CAN message
Francisco Javier Lana Romero

Posted on 29.10.2018 09:24

Good morning,

 

We’ve some critical messages in CAN that include an internal CRC, it’s a message that I’d like to be sent by Dewe (configured as Tx), I’ve been trying to calculate a CRC using a mathematic function but, I’ve found some problems:

           -XOR function works only in binary, to calculate CRC-8 a xor of 8bits must be done.

           -2 dimensional arrays are not capable of using a variable value as index, I thought that a solution would be to have a function with all the XOR values calculated in a 2-dimensional array but, the requirement to have constant values in the index impedes this possibility.

 

           Is there a way to calculate a CRC using math functions?

 

Thank you.

 

Primož Gorenšek
Automotive Application Engineer
Posted on 07.11.2018 10:56

Hello Francisco,


Is it possible to get the setup you are using for transmitting the messages to see how are the messages specified and how many there are? Would you need CRC just for one or some or for all of them? It is not a trivial task so we would like to see the messages first to be able to give the best solution.


Thanks.


Francisco Javier Lana Romero

Posted on 07.11.2018 16:21

Hello Primož,


To control an ECU, we need to send from Dewesoft a periodical message that includes a CRC inside, generally the variables are quite static so, to solve the problem, we have created messages that include a precalculated CRC, what we do is choosing the message that we want to send, for the moment it has been enough but, is true that we have missed more flexibility. In any case, I understand that it’s something complicated, so maybe it’s a functionality that can be proposed for the next version, having a CRC math function.

 

Thank you.

Primož Gorenšek
Automotive Application Engineer
Posted on 15.11.2018 16:50

Francisco, I'm glad you found a workaround for the time being. It is also the simplest solution for now. We will put CRC for CAN on the feature list for future development.


Kind regards,

Primož


Login to reply to this topic. If you don't have account yet, you can signup for free account .