How to change an array from a different file in my C code?

Solution for How to change an array from a different file in my C code?
is Given Below:

I have two separate C files and I need to change the const u08_t NFC_NDEF_Message which is in a file called NDEF.C. This file is not imported in my main.C but when this is called, void initISO15693(u16_t parameters ), it goes into the other file. I don’t understand how that can work. I need to alter the NDEF message, but I don’t know where and how it’s being accessed in the main code. Any help would be appreciated. The two files will be below.

main.c:

/*
 * main.c
 *
 * RF430FRL152H NFC Only Example Project
 *
 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ 
 * 
 * 
 *  Redistribution and use in source and binary forms, with or without 
 *  modification, are permitted provided that the following conditions 
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright 
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the 
 *    documentation and/or other materials provided with the   
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
*/

#include "NDEF.h"
#include "types.h"
#include "patch.h"
#include <rf430frl152h.h>

//*****************************FUNCTION PROTOTYPES********************************/
void DeviceInit(void);
//********************************************************************************/

/*********************** SUMMARY **************************************************************************************************
 * This project *only* utilizes the RF stack (ISO15693) on the ROM of the RF430FRL15xH. This setup allows the user to make a
 * custom application that is run from FRAM.  Only the RF13M vector that runs the RF stack needs to be pointing to its
 * ROM location.
 */

 /**************************************************************************************************************************************************
*   Code Space
***************************************************************************************************************************************************
*
*  Please check the lnk_rf430frl152h_NFC_Only.cmd file to customize how much code space is used for NDEF message ("FRAM_NDEF")
*  or for code ("FRAM_CODE").  
*
**************************************************************************************************************************************************/

/**************************************************************************************************************************************************
*   Main
***************************************************************************************************************************************************
*
* Brief :       Program entry.
*
* Param[in] :   None
*
*
* Param[out]:   None
*
* Return :
*
**************************************************************************************************************************************************/

void main()
{
    WDTCTL = WDTPW + WDTHOLD;                   // Stop watchdog

    // ROM RF13M module setup ** The following three lines are needed for proper RF stack operation
    DS = 1;                                     // ROM variable needs to be initialized here
    asm ( " CALL #0x5CDA ");                    // Call ROM function ( Initialize function pointers)
    asm ( " CALL #0x5CAC ");                    // Call ROM function ( Check part configuration)


    initISO15693(CLEAR_BLOCK_LOCKS);  // clear all block locks
    //initISO15693(0);                  // leave block locks as they are set in FRAM

    //JTAG is set to be disabled in this function call
    DeviceInit();

    while(1)
    {
        // Enter application code here...
        __bis_SR_register(LPM3_bits + GIE);

    }
}

/**************************************************************************************************************************************************
*  DeviceInit
***************************************************************************************************************************************************
*
* Brief : Initialize the clock system and other settings
*         Patchable function
*
* Param[in] :   parameters:  has these independent options
*                            INITIALIZE_DEVICE_CLOCK_SYSTEM - initializes the clock system
*                            POPULATE_INTERRUPT_VECTOR_IN_INITIALIZATION - populate the default interrupt vectors and recalculate their CRC
*
* Param[out]:  None
*
* Return  None
*
* Patchable :   Yes
**************************************************************************************************************************************************/
void DeviceInit(void)
{
//  P1SEL0 = 0xF0; //keep JTAG
//  P1SEL1 = 0xF0; //keep JTAG
    P1SEL0 = 0x00; //no JTAG
    P1SEL1 = 0x00; //no JTAG

    P1DIR &= ~0xEF;
    P1REN = 0;

    CCSCTL0 = CCSKEY;                        // Unlock CCS

    CCSCTL1 = 0;                             // do not half the clock speed
    CCSCTL4 = SELA_1 + SELM_0 + SELS_0;      // Select VLO for ACLK and select HFCLK/DCO for MCLK, and SMCLK
    CCSCTL5 = DIVA_2 + DIVM_1 + DIVS_1;      // Set the Dividers for ACLK (4), MCLK, and SMCLK to 1
    CCSCTL6 = XTOFF;                         // Turns of the crystal if it is not being used
    CCSCTL8 = ACLKREQEN + MCLKREQEN + SMCLKREQEN; //disable clocks if they are not being used

    CCSCTL0_H |= 0xFF;                       // Lock CCS

  return;
}



//#pragma vector = RFPMM_VECTOR
//__interrupt void RFPMM_ISR(void)
//{
//}
//
//#pragma vector = PORT1_VECTOR
//__interrupt void PORT1_ISR(void)
//{
//}
//
//#pragma vector = SD_ADC_VECTOR
//__interrupt void SD_ADC_ISR(void)
//{
//}
//
//#pragma vector = USCI_B0_VECTOR
//__interrupt void USCI_B0_ISR(void)
//{
//}
//#pragma CODE_SECTION(RF13M_ISR, ".fram_driver_code")  // comment this line for using ROM's RF13M ISR, uncomment next one, see .cmd file for details
#pragma CODE_SECTION(RF13M_ISR, ".rf13m_rom_isr")       // comment this line for creating a custom RF13M ISR that will exist in FRAM, bypassing ROM's, uncomment previous
#pragma vector = RF13M_VECTOR
__interrupt void RF13M_ISR(void)
{
    // Right now this vector is pointing to the ROMs firmware location that runs the RF stack. 
    // Entering code here will, without changing the CODE_SECTION lines
    // above, will cause an error.
    // Changing the code section above will cause the ROM RF stack to be bypassed.  New handler will need to be created.
}

//#pragma vector = WDT_VECTOR
//__interrupt void WDT_ISR(void)
//{
//}
//
//#pragma vector = TIMER0_A1_VECTOR
//__interrupt void TimerA1_ISR(void)
//{
//}
//
//#pragma vector = TIMER0_A0_VECTOR
//__interrupt void TimerA0_ISR(void)
//{
//}
//
//#pragma vector = UNMI_VECTOR
//__interrupt void UNMI_ISR(void)
//{
//}
//
//#pragma vector = SYSNMI_VECTOR
//__interrupt void SysNMI_ISR(void)
//{
//}

Here is the NDEF.C code:

/*
 * NDEF.c
 *
 * RF430FRL152H NFC Only Example Project
 *
 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
 *
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
*/

#include "types.h"
#include "NDEF.h"
#include "patch.h"
#include <string.h>

/* Firmware System Control Byte
 *
 *     Bit 0:   ISOBlockSize                0 - 4 byte,     1 - 8 byte
 *     Bit 1:   Page                        0 - page 1,     1 - page 0 (Effective only for 4-byte block mode)
 *     Bit 2:   ROMEUSCISupportEnabled      0 - disabled,   1 - enabled (Forced to 0 on RF430FRL153H)
 *     Bit 3-5: ReservedISO
 *     Bit 6:   NFCBridgeDisable            0 - enabled,    1 - disabled (see note below)
 *     Bit 7:   ROMSensorSupportEnable      0 - disabled,   1 - enabled (Forced to 0 on RF430FRL154H)
 *
 *     NFC bridge is recommended to be disabled in this project.  Unexpected behaviour can occur,
 *     trying to use it, due to the configuration being setup here.
 *
 *     If eUSCI host controller portion is needed along with the RF functionality, the default project
 *     must be used.  That is NFC cannot be supported in that application (because the I2C/SPI host controller
 *     control registers are in the same place that the NFC file needs to be).  However the rest of the FRAM
 *     memory can be used for storing and reading using ISO15693.
 */

//This project is based on the RF430FRL152H.  However it will work as well on the RF430FRL154H.
//However ROM_SENSOR_SUPPORT_DISABLED (or ROMSensorSupportEnable see above for both )must be set in the firmware system control register.  This is forced automatically on the RF430FRL154H.
//This setting is needed to disable the ROM which uses block 0... as virtual registers, however this memory is needed for NDEF purposes.
#define FIRMWARE_CONTROL_ADDRESS    0xF867
#pragma RETAIN(Firmware_System_Control_Byte);
#pragma location = FIRMWARE_CONTROL_ADDRESS
//This variable needs to be kept declared and as "volatile" for the BlockLockROM_Patched function to work properly.  Assignment can be changed however.
volatile const u08_t Firmware_System_Control_Byte = ROM_SENSOR_SUPPORT_DISABLED + EROM_EUSCI_SUPPORT_DISABLED + NFC_BRIDGE_DISABLED + FOUR_BYTE_BLOCK + FIRST_ISO_PAGE; //0x7F,     // this value sets the firmware system control register

// ROM variables - DO NOT CHANGE !!!
// Declared to protect from use by compiler
/********************************************/
#pragma RETAIN(DS)
#pragma location = 0x1C00
u08_t DS;
#pragma RETAIN(RF)
#pragma location = 0x1C6A
const u08_t RF;
#pragma RETAIN(NRX)
#pragma location = 0x1CA4 //rx
const u08_t NRX[34];
#pragma RETAIN(NTX)
#pragma location = 0x1CC6 //tx
const u08_t NTX[33];
#pragma RETAIN(EL)
#pragma location = 0x1CF2
const u08_t EL;
#pragma RETAIN(PF)
#pragma location = 0x1C0A
const u16_t PF[48];
/********************************************/

/*
 * This is an NDEF message: www.ti.com
 * This can be made longer and edited as necessary.  However it is limited to the first page (about 968 bytes),
 * the second page is mainly used for patch firmware, but can be read over NFC as well, with proper commands.
*/

#define NDEF_START_ADDRESS  0xF868
#pragma RETAIN(NFC_NDEF_Message);
#pragma location = NDEF_START_ADDRESS;                                                                  // the location of the address
const u08_t NFC_NDEF_Message[23] = {

        // Block 0
        0xE1,       // NDEF Magic Number
        0x40,       // Version Number, read/write access conditions
        0x79,  //0x7E,      // 1008 bytes / 8 = 126 blocks
        0x00,//0x04,//8 byte extended memory //0x00,        // does not support read multiple blocks (limited to only 3 blocks)

        // Block 1
        0x03,       // NDEF Message present
        0x0D,       // Length , 11 bytes-> payload of 7, pauload of 18 is 22 byte length
        0xD1,       // Record header
        0x01,       // type length

        // Block 2
        0x09,       // Payload length
        0x55,       // Record Type U (URI)
        0x01,       // URI header identifier
        0x7A,       // 'z'
        0x74,       // 't'

        // Block 3
        0x69,       // 'i'
        0x2E,       // '.'
        0x63,       // 'c'
        0x64,       // 'd'
        0x6F,       // 'o'

        // Block 4
        0x6D,       // 'm'
        0xFE,       // TLV terminator
        0x00,       // Empty don't care
        0x00        // Empty don't care
};

/**************************************************************************************************************************************************
*  initISO15693
***************************************************************************************************************************************************
*
* Brief : Initializes the RF Stack
*
* Param[in] :   parameter - the configuration to setup the ISO15693 (option to clear the lock blocks)
*
* Param[out]:   None
*
* Return        None
**************************************************************************************************************************************************/
void initISO15693(u16_t parameters )
{

  RF13MCTL |= RF13MTXEN + RF13MRXEN + RF13MRFTOEN;  // set up rx and tx functionality on RF13M module
  // enable interrupts  ** Do not change the following two lines, needed for proper RF stack operatoin
  RF13MINT |= RF13MRXIE + RX13MRFTOIE;              // enable interrupts on RX and on timeout and over and under flow checking

  if (parameters & CLEAR_BLOCK_LOCKS )
  {
    memset ((u08_t *) FRAM_LOCK_BLOCKS, 0xFF, FRAM_LOCK_BLOCK_AREA_SIZE);     //block is locked with a zero bit, clears FRAM and RAM lock blocks
  }

//  BlockLockAPI(3, LOCK_BLOCK);  //Test this API
//
//  BlockLockAPI(3, CHECK_LOCK);  //Test this API
}

/**************************************************************************************************************************************************
*  BlockLockAPI
***************************************************************************************************************************************************
*
* Brief : Locks a block either in FRAM or in RAM.
*
* Param[in] :   block - The block to lock.  In 4-byte mode this will lock two blocks and depends on the page selected.
*
* Param[out]:   None
*
* Return        None
**************************************************************************************************************************************************/
u16_t BlockLockAPI(u16_t block, u08_t checkLock)
{
    u16_t locked;

    locked = BlockLockROM_Patched(block, checkLock );
    return locked;
}

Here is NDEF.h

/*
 * NDEF.h
 *
 * RF430FRL152H NFC Only Example Project
 *
 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
 *
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
*/
#include <rf430frl152h.h>
#include "types.h"

#ifndef NDEF_H
#define NDEF_H

//*****************************FUNCTION PROTOTYPES********************************/
void initISO15693(u16_t parameters );
u16_t BlockLockAPI(u16_t block, u08_t checkLock);

extern u08_t DS;

#define CLEAR_BLOCK_LOCKS                               BIT3
#define FRAM_LOCK_BLOCK_AREA_SIZE                       38
#define FRAM_LOCK_BLOCKS                                0xF840  //Address of ISO15693 lock blocks


#define ROM_EUSCI_SUPPORT_ENABLED       BIT2
#define EROM_EUSCI_SUPPORT_DISABLED     0
#define ROM_SENSOR_SUPPORT_ENABLED      BIT7
#define ROM_SENSOR_SUPPORT_DISABLED     0
#define NFC_BRIDGE_DISABLED             BIT6
#define NFC_BRIDGE_ENABLED              0
#define EIGHT_BYTE_BLOCK                BIT0
#define FOUR_BYTE_BLOCK_MASK            BIT0
#define FOUR_BYTE_BLOCK                 0
#define FIRST_ISO_PAGE_MASK             BIT1
#define FIRST_ISO_PAGE                  BIT1
#define SECOND_ISO_PAGE                 0
#define FRAM_BLOCKS_8                   0xF3


#define CHECK_LOCK                  1
#define LOCK_BLOCK                  0
#define LOCKED_FLAG                 BIT0

#endif

Here is patch.h

/*
 * Patch.h
 *
 * RF430FRL152H NFC Only Example Project
 *
 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
 *
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
*/
#include "types.h"
#ifndef PATCH_H
#define PATCH_H


//****Patch functions********************************************************************/
void GetSystemInfo_Patched();
void GetMultipleBlockSecurityStatus_Patched();
u16_t BlockLockROM_Patched(u16_t blockNumber , u08_t checkLock);

void userCustomCommand();

typedef void(*DriverFunction)(void);

//------------------------------------------------------------------------------
// Driver section
//------------------------------------------------------------------------------
extern volatile const u08_t Firmware_System_Control_Byte;

#define CRC_LENGTH_IN_BUFFER          2  // the CRC bytes take 2 bytes in the packet
#define DATA_IN_LENGTH                1  // only 1 byte of data in expected


#define DRIVER_TABLE_START              0xFFCE                  // starting address for driver table
#define DRIVER_TABLE_KEY                0xCECE                  // identifier indicating start and end of driver table
#define BLOCK_LOCK_ID                   0x2600                  // Block Lock Code for ROM
#define GET_SYSTEM_INFO_ID              0x002B                  // Get System Info ISO15693 command ID
#define GET_MUL_BLCK_SEC_STATUS_ID      0x002C                  // Get Multiple Block Security Status ISO15693 command ID
#define USER_CUSTOM_COMMAND_ID          0x00AA                  // user custom command, range from A0 - D0

#define NUMBER_OF_DRIVER_FUNCTIONS      4                       // the amount of patched functions
//------------------------------------------------------------------------------
#define CUSTOM_COMMAND         (DRIVER_TABLE_START-2)
#define CUSTOM_COMMAND_ADDR    (DRIVER_TABLE_START-4)

#define GET_SYSTEM_INFO_COMMAND (DRIVER_TABLE_START-6)                  // DIGITAL_SENSOR_DRIVER_ID, see below
#define GET_SYSTEM_INFO_ADDR    (DRIVER_TABLE_START-8)

#define GET_MULTIPLE_BLOCK_SECURITY_STATUS_COMMAND (DRIVER_TABLE_START-10)                      // INIT_DIGITAL_SENSOR_DRIVER_ID, see below
#define GET_MULTIPLE_BLOCK_SECURITY_STATUS_ADDR    (DRIVER_TABLE_START-12)

#define BLOCK_LOCK_ROM_COMMAND (DRIVER_TABLE_START-14)                      // INIT_DIGITAL_SENSOR_DRIVER_ID, see below
#define BLOCK_LOCK_ROM_ADDR    (DRIVER_TABLE_START-16)

#define DRIVER_TABLE_END  (DRIVER_TABLE_START-2-(NUMBER_OF_DRIVER_FUNCTIONS*4))

#endif

You have asked two distinct and unrelated questions – normally better to post separate questions.

With respect to NFC_NDEF_Message:

The following code:

#define NDEF_START_ADDRESS  0xF868
#pragma RETAIN(NFC_NDEF_Message);
#pragma location = NDEF_START_ADDRESS;                                                                  // the location of the address
const u08_t NFC_NDEF_Message[23] = {

Means:

Locate NFC_NDEF_Message at address 0xF868 and do not allow the linker to remove the data object even if no code explicitly references it.

To change the data at 0xF868 to 0xF87F, you simply change the source in NDEF.c. The #pragma directives will ensure that the NFC_NDEF_Message is stored at that location.

With respect to how initISO15693() can be called:

initISO15693() has external linkage and is declared in NDEF.h.

When the preprocessor #includes NDEF.h the compiler uses the declaration to say

“these symbols exist in some other module that may be resolved by the linker later”

The compiler puts unresolved link placeholders in the object code. The source NDEFS.c is then separately compiled and the symbols initISO15693 etc. are created in its object code referring to the actual data instances and code.

The linker then combines the two compiled object modules (together with any other modules in the project build and libraries and run-time start-up code). During this combination, the unresolved links are matched up with the corresponding concrete instances in other modules and libraries.

That is also how you can break your own code into separately compiled modules. Which you would want to do for any not-trivial application.

Take a look in the NDEFS.h header or any other header file including the standard library headers to see how these declarations are made. The header files do not (normally) contain the library code or data objects, they normally contain just declarations or code/data that exists elsewhere to be resolved by the linker.

There are (at least) three stages to building an executable:

  1. Preprocessoing : replacing #include with the included file content, replacing macros with their #define‘ed text, removing code depending on #if etc.
  2. Compilation : turning the individual preprocessed source modules into native machine code object modules, with unresolved links to external code/data.
  3. Linking : combining object modules from individual compilation and from libraries, resolving any unresolved links.

Understanding these steps (often hidden or obscured by the use of an IDE such as CCS) will help you understand better how to resolve issues when they arise; for example “undefined symbol” is a compilation error (you did not declare a symbol or include a required header), while “unresolved symbol” is a linker error (you did not add a required object module or library to your build – and in turn may not have added the source to your project).