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.

LP-AM243: PRU CRC16/32 Module base code

Part Number: LP-AM243

Hello,

     I am using PRU CRC16/32 module for communication data check with CRC16 (x16+x15+x2+1 ) mode.

I found that the accumulated CRC output results do not match to the CRC16 online tool.

For example, I pushed 0x1304 into CRC16 and get 0xc2b9 as the results, but the correct result should be 0xf30c.

Below is the programming code:

; CRC16 enable.

    ldi32  r20, 0x00001304  ;  original data

    ldi      r25.b0, 0               ;  config CRC type

    xout     1, &r25, 1

    mov      r29, r20             ;  load CRC data

    xout     1, &r29, 2           ;  push CRC data to CRC16 module

    nop

    xin      1, &r29, 4       ;  load the accumlulated CRC result into PRU

May I have your comments?

BR,

Chen

  • I have started looking into the issue. Let me get back by friday.

  • Hi Nilabh,

        Any news on it ?

  • Hi Chen,

    I tried to follow your code, it seems your observation is correct. Let me check internally with the expert on this.

  • Hi Chen,

    1. As per TRM, R25 should be written 4 bytes at a time

    There is some info missing in TRM please find below.  It will be updated in next revision.

    2. PRU ICSS is based on little endian architecture, so the input data should be given as 0413

    3. Also For CRC16 mode, SW can read CRC_DATA_32_BFLIP[31:16] to get the correct bit order.

    Please find the working code below.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ; Copyright (C) 2023 Texas Instruments Incorporated - http://www.ti.com/
    ;
    ; Redistribution and use in source and binary forms, with or without
    ; modification, are permitted provided that the following conditions
    ; are met:
    ;
    ; Redistributions of source code must retain the above copyright
    ; notice, this list of conditions and the following disclaimer.
    ;
    ; Redistributions in binary form must reproduce the above copyright
    ; notice, this list of conditions and the following disclaimer in the
    ; documentation and/or other materials provided with the
    ; distribution.
    ;
    ; Neither the name of Texas Instruments Incorporated nor the names of
    ; its contributors may be used to endorse or promote products derived
    ; from this software without specific prior written permission.
    ;
    ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX