I want to calculate the CRC_16 of my memory flash. I have the routins and I know the way to do it.
I have a especial table to calculate a fast CRC_16, and I need to save it also in flash. The matter here is that I want to save the CRC value in a specific location in memory flash.
I declare as a const my table and then in my main I write:
#pragma DATA_SECTION (crc_16_ccitt, "sec_crc")
unsigned int crc_16_ccitt;
Acording the memory map(see below), the variable 'crc_16_ccitt' should store the CRC value in position 07F44h.
I compile the code but 'crc_16_ccitt' isn't where I want.
Has anybody used de 'pragma' directive?
PAGE 0 : VECTORS: origin = 0h , length = 40h /* VECTORS */
CODE : origin = 44h , length = 07F00h /* PROGRAM */
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 */
.text :> CODE PAGE 0
.cinit :> CODE PAGE 0
.data :> SARAM PAGE 1
.stack :> SARAM PAGE 1
.bss :> SARAM PAGE 1
.vectors:> VECTORS PAGE 0
.const :> CODE PAGE 0
sec_crc :> CRC PAGE 0