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.

About memcpy()

About memcpy()

In SPRA958 there is a example named ‘The F2808_example_nonBIOS_flash.pjt’ as bellow breifly:

1, main_nonBIOS.c

………

#include "F2808_example.h"

….

void main(void)

{

……..

// Section secureRamFuncs contains user defined code that runs from CSM secured RAM

       memcpy(&secureRamFuncs_runstart,

                     &secureRamFuncs_loadstart,

                     &secureRamFuncs_loadend - &secureRamFuncs_loadstart);

………..

} // end of main()

 

2,  F2808_example.h

……..

       extern Uint16 secureRamFuncs_loadstart;

       extern Uint16 secureRamFuncs_loadend;

       extern Uint16 secureRamFuncs_runstart;

……….

//--- end of F2808_example.h file

 

 

3, f2808_nonBIOS_flash.cmd

………

SECTIONS

{

………..

secureRamFuncs    : LOAD = FLASH_ABCD, PAGE = 0 /* Used by InitFlash() in SysCtrl.c */

                   RUN = L0SARAM,     PAGE = 0

                   LOAD_START(_secureRamFuncs_loadstart),

                   LOAD_END(_secureRamFuncs_loadend),

                   RUN_START(_secureRamFuncs_runstart)

}

//--- end of 2808_nonBIOS_flash.cmd

 

There are two question:

 

Q1:Why does function of memcpy() don’t  declared implicitly using extern?

 

Q2:If need,should declare the memcpy() as:

   extern void MemCopy(Uint16 *, Uint16 *, Uint16 *);

   or as:

   extern void MemCopy(Uint16 , Uint16 , Uint16 );

 

   or others?

 thank