This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2642R: Sequence Chart for CRC32 Command

Part Number: CC2642R

i am using CC2642R device and using below command to verify firmware was successfully programmed into the Flash memory or not?

my Flash Size 128KB = 131071 Byte. Also i have successfully write 128kb in flash memory, working properly but failed to match the Calculated CRC and Bootloader CRC. 

Data Address = 0x00000000;

ucCommand[0] = <size=15>;
ucCommand[1] = <checksum>;
ucCommand[2]= COMMAND_CRC32;
ucCommand[3]= 0x00;
ucCommand[4]= 0x00;
ucCommand[5]= 0x00;
ucCommand[6]= 0x00;
ucCommand[7]= 0x00;
ucCommand[8]= 0x01;
ucCommand[9]= 0xFF;
ucCommand[10]= 0xFF;
ucCommand[11]= 0x00;
ucCommand[12]= 0x00;
ucCommand[13]= 0x00;

By Sending above command i get single data byte which matched with first byte of calculated CRC .

but as per datasheet Bootloader returned the 4 bytes in a 6-byte packet. while i am getting single data byte.

so please help us to resolve the issue.

 

  • Hi Nitesh,

    I'm passing this off to one of our experts now. 

    Best,

    Nate

  • Hello Nitesh,

    I see that you are referring to Section 10.2.3.8 of the Technical Reference Manual.  Is ucCommand[14] missing by accident in your description?  Did you receive the ACK byte from the bootloader?  Are you able to successfully perform any other Bootloader commands?  Please provide a logic analyzer or oscilloscope capture of the UART lines during the command and response.  Have you considered evaluating the slbAppEx from SWRA466?  

    Regards,
    Ryan

  • hello sir,

    yes ucCommand[14] command is accidently removed which is ucCommand[14]= 0x00;  

     by sending below command i am getting only single byte from bootloader. this single byte matched with calculated Flash CRC.

    ucCommand[0] = <size=15>;
    ucCommand[1] = <checksum>;
    ucCommand[2]= COMMAND_CRC32;
    ucCommand[3]= 0x00;
    ucCommand[4]= 0x00;
    ucCommand[5]= 0x00;
    ucCommand[6]= 0x00;
    ucCommand[7]= 0x00;
    ucCommand[8]= 0x01;
    ucCommand[9]= 0xFF;
    ucCommand[10]= 0xFF;
    ucCommand[11]= 0x00;
    ucCommand[12]= 0x00;
    ucCommand[13]= 0x00;

    ucCommand[14]= 0x00;

     All other bootloader command working fine like command downloads. however I am able to write flash code in flash memory and BLE working fine ,Except CRC response.

    i am referring  SWRA466 document to write SBL.

    did i am sending write data in ucCommand ?

    Flash address 0x00000000 for CC2642R device.

    flash size 128kb so i am sending below command

    ucCommand[7]= 0x00;
    ucCommand[8]= 0x01;
    ucCommand[9]= 0xFF;
    ucCommand[10]= 0xFF;

    even i tried with below command

    ucCommand[7]= 0x00;
    ucCommand[8]= 0x02;
    ucCommand[9]= 0x00;
    ucCommand[10]= 0x00;

    read Repat count is 0x00000000

    but with these effort i am only single byte Response.

    so help us to resolve the issue.

  • Have you used any other bootloader commands that successfully return multiple bytes?  The calculateCrc32 function is an integral part of the sblAppEx.cpp main process, if you are able to run this demo then you could debug the return of this implementation to compare against your own.  Your packet structure appears to be correct.  Once more, a logic analyzer or oscilloscope would help confirm that only one byte is returned.

    Regards,
    Ryan

  • i am writing own SBL by referring datasheet.so i am sending command by MCU UART port. while i am able to get  multiple Byte as in CMD_DOWNLOAD.in CMD_DOWNLOAD i am getting multiple response byte, but in CMD_CRC32 Not.

    but if i send below command 

    ucCommand[7]= 0x00;
    ucCommand[8]= 0x00;
    ucCommand[9]= 0x00;
    ucCommand[10]= 0x04;

    above command Represent code size is 4 byte then i am getting 6 byte packet as mentioned in SWRA466 Document .

    but my code size is 128kb.

    Data value mentioned in Previous Post.

    I have Doubt on Data value in ucCommand ,So My data value in ucCommand is ok or not ?

  • COMMAND_DOWNLOAD doesn't expect multiple bytes to be returned.  Do you follow the Figure 4-6. Sequence Chart for Flash Write from SWRA466 to ensure that all data has been correctly programmed?  From the TRM: "The second parameter that holds the number of bytes must be higher than eight. If not, the returned checksum is 0xFFFF FFFF."  Have you tried any other values, and been sure to modify the checksum byte accordingly?  How long do you wait for a response from the UART before timing out, and what status is returned by COMMAND_GET_STATUS after COMMAND_CRC32 is completed?  Are you able to run sblAppEx on your system to observe how it performs?

    Regards,
    Ryan

  • yes, i am following Figure 4-6. Sequence Chart for Flash Write from SWRA466 to ensure that all data has been correctly programmed.

    as i told my Flash program working fine. but problem in CRC MATCHING.

    I does not understand The second parameter that holds the number of bytes must be higher than eight could you please elaborate.

    i am taking 5 Sec timing out for UART.

    Bootloader does not respond on COMMAND_GET_STATUS after COMMAND_CRC32.

    please verify my data value in ucCommand is ok or not ?

  • I does not understand The second parameter that holds the number of bytes must be higher than eight could you please elaborate

    You had mentioned a test using a value of four which was successful, but according to the TRM all 0xFF should be provided if the number of bytes is less than eight.

    You ucCommand values are correct.  The UART timeout is also reasonable.  Howevever the bootloader not responding after COMMMAND_CRC32 is concerning, possibly because the host is not sending an ACK/NACK to the incomplete CRC32 command?.  That is why I am requesting visual evidence of the UART RX/TX lines with an oscilloscope or logic analyzer.  sblAppEx has been verified with the CC2642R and it uses COMMAND_CRC32 which is why I am questioning the host's ability to receive/process multiple UART bytes successfully.

    Regards,
    Ryan