CYRF6936 CRC computation

More
21 Mar 2017 21:22 #60488 by Notou
CYRF6936 CRC computation was created by Notou
Hello everyone,

I'm in the process of building a DSMx decoder using software defined radio (gnuradio) as a student project.
It works quite well, I can decode the signal, get the proper pn code, decode data and even follow the frequency hopping sequence.
That's thanks to you guys for a big part, I would probably have been lost without the doc you put up about the DSM2/DSMx protocol. :)

But I'm stuck on something: the CRC computation. and that prevents me from sending data.
I know that with deviation, since you directly use the chip, you don't really need to know how the crc is computed and transmitted but maybe you can help me anyway.

I tried to implement the algorithm following the doc's description, switching bit orders and then swapping bits and bytes of what I calculate to check all endianness possibilities.
Here is my basic algorithm:
for(int i =0; i<8;i++){
    if ( (data >> i) & 0x01) { //Take one bit at a time
      data_bit = 1;
    } else {
      data_bit = 0;
    }
    d_high_reminder = (d_reminder & 0x8000) >> 15; 
    d_reminder = (d_reminder << 1) & 0xFFFE;           //Shift the register


    xored = data_bit ^ d_high_reminder;
    if( xored ){  //Check if current bit XOR high reminder is 1
      d_reminder = d_reminder ^ 0x8005;             //XOR with generator polynomial
    }
  }

My assumption is that the seed is used to initialise the register prior to the computation.

I used RevEng to compare with the output of my algorithm (using the proper parameters of course :)) and it checks out.

On top of that, according to Jonathan Andersson (the guy that presented his icarus project in october, I believe there is a post about that somewhere in the forum), The algorithm used to generate the coding sequences from the pn codes might be different for the data and the CRC :/

Unfortunately, I don't have access to the chip, it's embedded in the remote controller, I don't trust my soldering skills and I can't really afford to lose it. So I can't access the registers to see what is the actual CRC computed by the chip to verify if it's my implementation that's not working of if there is something else going on.


Thanks for your help :)

Please Log in or Create an account to join the conversation.

More
22 Mar 2017 04:14 #60499 by vlad_vy
Replied by vlad_vy on topic CYRF6936 CRC computation
Spektrum do not want to share real hardware algorithm:

www.rcgroups.com/forums/showthread.php?2...1-Spektrum-SRXL-port

Please Log in or Create an account to join the conversation.

Time to create page: 0.041 seconds
Powered by Kunena Forum