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.

Having trouble with iec60730 function: bool IEC60730_PC_TEST_testPcRegister(void)

Other Parts Discussed in Thread: MSP430AFE253

Below is all the code:

 

#include <stdbool.h>
#include "IEC60730_pc_test.h"
#include "IEC60730_user_config.h"
#include "IEC60730_system_config.h"
#include <msp430afe253.h>

//*****************************************************************************
// Function Definition
//*****************************************************************************
static void *IEC60730_PC_TEST_pcTestFunction1(void);
static void *IEC60730_PC_TEST_pcTestFunction2(void);

//*****************************************************************************
//
//! Tests Program Counter register for stuck at bits
//!
//! This function tests the Program Counter register for stuck at bits.
//! The routine call two test functions that return their addresses. Their
//! return values are compared to the PC test function address. If the value
//! matches, the function passes, if not it fails.
//! The PC test functions need to reside in separate memory locations such
//! that ,by the time all of them are called, all the Program Counter register
//! bits are set or cleared. Thus indirectly testing the PC register for
//! stuck at bits.
//! The user must define two sections named "pc_test_section_1",
//! "pc_test_section_2"
//!
//!
//! Modified registers are \b REGISTER_1, \b REGSITER_2, and \b REGISTER_3
//!
//! \return None
//

//*****************************************************************************

bool IEC60730_PC_TEST_testPcRegister(void)
{

uint8_t countPcTest;
void *pReturnFunctionAddress;
// Store function addresses in an array
void * (*pPcTestFunctions[2])(void) =
{
IEC60730_PC_TEST_pcTestFunction1,
IEC60730_PC_TEST_pcTestFunction2,
};


// Feed WDT in case user has WDT enabled before running CPU test
#if ENABLED_WDT
uint16_t wdtConfig = WDTCTL & 0x00ff;
WDTCTL = WDTPW + WDTCNTCL + wdtConfig;
#endif // ENABLED_WDT


for (countPcTest = 0; countPcTest < 2; countPcTest++)
{
pReturnFunctionAddress = (*pPcTestFunctions[countPcTest])();          Having trouble with this line. The error I get when I try and load the file is: 

MSP430: File Loader: Verification failed: Values at address 0x0000000000000010 do not match Please verify target memory and memory map.
MSP430: GEL: File: C:\Users\Steve Thomas\workspace_v6_1\77A000004-NH3\77A000004_NH3\Debug\77A000004_NH3.out: a data verification error occurred, file load failed.

It compiles with no errors. CAN YOU HELP?

// if the address returned doesn't match the address of
// the function return an error
if ((void *) pPcTestFunctions[countPcTest] != pReturnFunctionAddress)
{
return (TEST_FAILURE);
}
}

// Return success if all the functions return their own
// address
return (SIG_PC_REG_TEST);
} /* IEC60730_PC_TEST_testPcRegister */

//*****************************************************************************
//
//! Returns address of IEC60730_PC_TEST_pcTestFunction1
//!
//!
//! \return address of IEC60730_PC_TEST_pcTestFunction1
//
//*****************************************************************************
#ifdef __ICC430__
#pragma location = "PC_TEST_SECTION_1"
void *
IEC60730_PC_TEST_pcTestFunction1 (void)
{
return ((void *) IEC60730_PC_TEST_pcTestFunction1);
} /* IEC60730_PC_TEST_pcTestFunction1 */
#else /* ifdef __ICC430__ */
#pragma CODE_SECTION(IEC60730_PC_TEST_pcTestFunction1, ".pc_test_section_1")
void *IEC60730_PC_TEST_pcTestFunction1 (void)
{
return (IEC60730_PC_TEST_pcTestFunction1);
} /* IEC60730_PC_TEST_pcTestFunction1 */
#endif /* ifdef __ICC430__ */

//*****************************************************************************
//
//! Returns address of IEC60730_PC_TEST_pcTestFunction2
//!
//!
//! \return address of IEC60730_PC_TEST_pcTestFunction2
//
//*****************************************************************************
#ifdef __ICC430__
#pragma location = "PC_TEST_SECTION_2"
void *
IEC60730_PC_TEST_pcTestFunction2 (void)
{
return ((void *) IEC60730_PC_TEST_pcTestFunction2);
} /* IEC60730_PC_TEST_pcTestFunction2 */
#else /* ifdef __ICC430__ */
#pragma CODE_SECTION(IEC60730_PC_TEST_pcTestFunction2, ".pc_test_section_2")
void *IEC60730_PC_TEST_pcTestFunction2 (void)
{
return (IEC60730_PC_TEST_pcTestFunction2);
} /* IEC60730_PC_TEST_pcTestFunction2 */
#endif /* ifdef __ICC430__ */

//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************

STEVE