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.

TMS570LS3137: About VIM4 Periodic Hardware CRC Check of SRAM Contents

Part Number: TMS570LS3137


Please tell me about VIM's CRC.

Is there a CRC storage location in the VIM area?

Please tell me how to respond to this safety function
Also, is this a safety function assuming what kind of breakdown is it?

  • Hi,

    The VIM doesn't have any sort of CRC that I am aware of or see in the VIM chapter of the reference manual.
  • Usually, VIM RAM is constant in the application once it is initialized. Since it is constant and based on you application, the resulting CRC can be a constant defined in your code to which you can compare the result of a CRC calculation over the VIM RAM space to insure validity of the VIM RAM content. i.e., you should be able to determine what your vectors are and run these through the same CRC algorithm offline and put the result in your code as a CONST or #define.

  • Thank you
    Can I use the CRC module function for VIM RAM area?
    Also, in that case do you know how long the execution time is?
  • Hi user4777395,

    So practically you have to consider that some VIM registers will change depending on the state of the system when
    you execute such a CRC. For example different interrupts may be pending in the INTREQ[] registers at any given time.

    Also you need to consider that reading some registers can change the state of the VIM; for example if you read FIQVECREG it
    actually will clear the highest pending interrupt and change the vector to the next highest pending interrupt.

    So this suggestion is in practice something that has to be implemented with extreme care.

    Also note that the hardware CRC module is not bus mastering so you are basically going to have to write a test that uses the CPU to read the 'statically' configured registers in the VIM.... which will be a small subset of all the VIM registers; and then use the CRC module hardware to compute the signature. OR you could just decide that the hardware CRC isn't worth the trouble and use the CPU to compute the CRC as it reads the handful of registers.

    You need to read through 14.2.2 CRC Modes of Operation to really understand this.... There are three modes.

    Since there are too many hazards in the VIM register file (registers whose contents are dynamic or have side effects on read) you probably need to use the full CPU mode 14.2.2.3 if you want to use the hardware CRC. You have to decide if it's worth the effort v.s. just adding CPU code to compute the CRC...

    Anyway since this is all CPU driven assume it's going to be about 22-25 cycles of the CPU for each register you read plus any time needed to compute the CRC.

    Best Regards,
    Anthony
  • Thank you.
    I'll give it a try.
  • Hello User,

    Please note that the safety mechanism VIM4 is intended to be only implemented on the VIM RAM and not the registers. The registers would be covered by the mechanism Periodic Readback of Static Control registers. The CRC is not intended to be used on dynamically changing content so the issues that Anthony has pointed out should not be a concern. If, however, you desired to do so, it isn't a forbidden practice to use the CRC for the register space just take care of the cautionary note that Anthony mentions..