2 Replies Latest reply on Jul 28, 2015 2:13 AM by hbau11

    SN8200 SPI missing ACK/NAK SOM?

    hbarta

      I'm trying to implement sn8200 SPI wioth ACK/NAK protocol.

       

      First of all, it seems the checksum is not calculated according to the specification in "SNIC Serial Interface Specification." Version 2.6. The following message is accepted by the sn8200:

      02  SOM

      83  L1

      C0  L2 len=3, ACK set

      D0  CMD 50 - CMD_ID_WIFI

      04  subcommand  => WIFI_GET_STATUS_RSP

      0F  sequence

      00

      93  checksum - 83+C0+D0 => 213 ? 03 + 40 + 50 = 93 (*)

      04

       

      Please note that the sample message in this document w/out ACK bit is 02 83 80 D0 04 33 00 D3 04 and checksum must bit 7 from at least one of these values (83 80 D0) in order to be D3.

       

      A well formed ACK is not received. Instead in the buffer of the next receive I find values all 04 except for two consecutive 08 followed by two consecutive FF. This looks like the ACK which should be 02 80 80 FF FF 04 but with no SOM.

       

      A subsequent receive reads a well formed response to the status request.

       

      What happened to the SOM in the ACK?

       

      I appreciate any help I can get with this.

       

      I have code that I can provide that demonstrates this situation if that would help.

       

      thanks,

      hank

        • 1. Re: SN8200 SPI missing ACK/NAK SOM?
          hbarta

          Attached is an app derived from the STM32F429i-DISCO SPI example code that demonstrates the problem. See the README.txt for info on how to run it. In addition to the standard setup, you can connect PE4 to the sn8200 NSS input. The program will start and loop, sending status requests and reading ack and/or response. You can examine the incoming buffers to see what the sn8200 sends (or connect the protocol analyzer of your choice.)

           

          thanks,

          hank

          • 2. Re: SN8200 SPI missing ACK/NAK SOM?
            hbau11

            If not solved until now:

            02 83 80 D0 04 33 00 D3 04

            The calculation of CRC is:

             

            unsigned char cksum=0;

                cksum += TxBuffer[1]; // 0x83
               cksum += TxBuffer[2]; //0x80
               cksum += TxBuffer[3]; // 0x0
               cksum |= 0x80;   

             

            . Had the same problem.