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.
Hi all,
I would love to have some help with the CRC functions, I'm new with them and with Texas, and I'm having problems trying to compile the code.
I have a working project in CCS(6.0.1.00040) with a TMS320F28069PNT that make use of ADC, FIR and SCI. But now I need to run a CRC-CCITT to 22 bytes of data before sending them.
Taking a look to "TMS320x2806x Piccolo Technical Reference Manual" I found VCRC16P2L_1 and VCRC16P2H_1 as part of the instruction set, so I create a new .asm source with the example code:
; ------------------- ; Calculate the CRC of a block of data ; This function assumes the block is a multiple of 2 16-bit words ; .global _CRC16P2 _CRC16P2 VCRCCLR ; Clear the result register MOV AL, *+XAR4[4] ; AL = CRCLen ASR AL, 2 ; AL = CRCLen/4 SUBB AL, #1 ; AL = CRCLen/4 - 1 MOVL XAR7, *+XAR4[2] ; XAR7 = &CRCData .align 2 NOP ; Align RPTB to an odd address RPTB _CRC16P2_done, AL ; Execute block of code AL + 1 times VCRC16P2L_1 *XAR7 ; Calculate CRC for 4 bytes VCRC16P2H_1 *XAR7++ ; ... VCRC16P2L_1 *XAR7 ; ... VCRC16P2H_1 *XAR7++ ; ... _CRC16P2_done MOVL XAR7, *_+XAR4[0] ; XAR7 = &CRCResult MOV32 *+XAR7[0], VCRC ; Store the result LRETR ; return to caller
and get a lot of errors... E0002, E0003, E0004:
Any help would be appreciated, thanks !!
Ok, removing the underscore solves part of the problem, but the MOV32 instruction still doesn't compiling, even changing it to MOVL. Searching in Tech_reference I found VMOV32. I tried and it compiles, but I'm not pretty sure if it's going to work properly.
Sorry for bothering you, but as you may have noticed, I lack in assembler knowledge, and try changes over a Texas example code that I am unable to compile, makes me think I'm doing something wrong.
New "CRC16P2_done" code:
Thank you again Sal !
Unfortunately not yet. All your help was very useful, but I'm in a hurry to finish a project, so I worked in a C code instead of using VCU (I'm not proud of this decision, but It was Important to have something working quickly).
For me, to understand adequately all the example codes, is necessary to learn much more assembler, how to make C callable functions, working with the stack, and so on... Once I have enough, I would be able to retake the VCU and make things properly, but now I'm just too noob.
I hope to return soon, and anyway, thank you two!