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.

Looking to store a calculated crc to flash

Other Parts Discussed in Thread: MSP430F6721

I am trying to calculate a crc at the very beginning of my init coded and then I'd like to store it to the location 0xFFCE in flash.

I am trying to use the following     #pragma location = 0xFFCE

 

#includes

uint16_t IEC60730_StoreCRC (void)
{
#pragma location = 0xFF50
const uint16_t crc_value = IEC6070_CRC1;
}

then call this function

#ifdef TEST_IEC60730 // Defined in IEC60730_user_config.h Enable or Disable there

//////////////////////////////////// IEC60730 CLASS B TESTNG //////////////////////////////
// Get and store 1st CRC calculation
// The CRC test checks for single bit faults using word protection with multi-bit redundancy (H.2.19.8.1)
IEC6070_CRC1 = privateCalculateCRC((uint16_t*)MSP430F6721_FLASH_START_ADDR0, MSP430F6721_MEMORY_SIZE);
IEC60730_StoreCRC();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

The problem is that nothing gets written to that location

How can I calculate the crc and then using code, store it at that location.?

Is there a way?

Steve

**Attention** This is a public forum