DSPRelated.com
Forums

CRC

Started by ilmo...@yahoo.es September 10, 2007
Hello,
I need to calculate the CRC_16 of my flash. I have the routins and I know the way to do it. I just have a problem: I need to save into flash a CRC_TABLE to calculate a fast CRC_16 and I need to put the result in a known location of memory.
I declarate the CRC table as a const (so in flash, see below map memory)
To save the CRC I use de pragma diective as:
#pragma DATA_SECTION (crc_16_ccitt, "sec_crc");
unsigned int crc_16_ccitt;

Map of memory:
MEMORY
{
PAGE 0 : VECTORS: origin = 0h , length = 40h CODE : origin = 44h , length = 07F00h
CRC : origin = 07F44h, length = 1h /* CRC_16 */

PAGE 1 : MMRS : origin = 0000h , length = 060h /* MMRS */
DARAM_B2: origin = 0060h , length = 020h /* DARAM */
DARAM_B0: origin = 0200h , length = 0100h /* DARAM */
DARAM_B1: origin = 0300h , length = 0100h /* DARAM */
SARAM : origin = 0800h , length = 0800h /* SARAM */

}

SECTIONS
{
.text :> CODE PAGE 0
.cinit :> CODE PAGE 0
.data :> SARAM PAGE 1
.stack :> SARAM PAGE 1
.bss :> SARAM PAGE 1
.vectors:> VECTORS PAGE 0
.sec_crc:> CRC PAGE 0
.const :> CODE PAGE 0

}