Hi,
While going to the start up code I come across the startupData structure.
*********************************************************************************************
STARTUP SECTION
---------------------------------------------------------------------------------------------
Entry point: 0xFE004F (_EntryPoint)
_startupData is allocated at 0xFE00A2 and uses 20 Bytes
extern struct _tagStartup {
unsigned nofZeroOut 1
_Range pZeroOut 0x1200 62
_Copy *toCopyDownBeg 0xFE052A
int nofInitBodies 0
_Cpp *initBodies 0xFE00BD
int nofFiniBodies 0
_Cpp *finiBodies 0xFE00BD
} _startupData;
I understood the code, but I would like to know that, how it gets initialized?
Who is responsible for the same?
And is it always located at address 0xFE00A2 ?
Also Is EntryPoint address (0xFE004F is always same?
Regards,
Amey
Hi Amey,
Please check start12z.c and start12z.h file in your project/Project Settings/Startup_Code.
This structure is used for initialize RAM prior start main() routine. The default bare metal project execute _Startup() function after reset. This _Startup() function will erase and initialize RAM.
Note: If you use ProcessorExpert, the reset vector points to _EntryPoint() instead of _Startup() .
Startup code is placed by linker, therefore location of this code could vary according linker settings and your project size.
Note: prm linker file is in your project/Project Settings/Linker_Files.
You could try for example specifying some part of RAM and filling them by some pattern. For example:
RAM3 = READ_WRITE 0x003000 TO 0x003FFF FILL 0x33;
In that case startup code will initialize this part of RAM prior enter into main() function.
The similar way you could also copy some code from flash into RAM (RELOCATE_TO).
See "c:\Freescale\CW MCU v10.6\MCU\Help\PDF\MCU_Build_Tools_Utilities.pdf" document for more details.
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------