Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 217475

Forum Post: RE: TMS320F28374S: Crc calculation using VCU and interrupt (Code reentrancy)

$
0
0
Thank you Sira. Yes, I have two separate CRC object, and at the begining I thougth it was enought, but looking at the library source files, it seems that this do not preserve the full context. If my reading is correct, looking at _CRC_run16BitPoly1 function in vcu2_crc_16.asm file, at first there is an istruction to reset CRC the result register, then some values, passed as arguments to the function, are moved to the correct registers (AR0 and VCRC) then is started a loop that feeds the CRC unit whith the values in the input buffer. At the beginig of the function there is a macro (CRC_CONTEXT_SAVE) that saves XAR1, XAR2, XAR3, but I think that it is not enought to manage the code reentrancy. In my case the CRC8 calculation, started in an interrupt function, will interrupts a crc16 calculation, reset the CRC unit, and modify the result register. When the interrupt function ends, the crc16 calculation will be resumed with a CRC unit context totally changed. Am I correct? So it seems that Todd's suggestion is the unique way to calculate two CRC, one in an iterrupt function and one at main level, i've no more ideas... Suggestions? Thank you. Paolo

Viewing all articles
Browse latest Browse all 217475

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>