EP8248 Startup Code - Where is it?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EP8248 Startup Code - Where is it?

3,315 Views
pedro1
Contributor I
Hello
 
I have just started working with the Codewarrior tools on an EP8248 development board. When I create a new project the project wizard lets me select that board and it generates startup code for me automatically. That's great because it would take me a long long time to figure out how to just initialize the SDRAM.
 
On my project, however, we will be designing new custom hardware so I might need to change the startup code. Unfortunately Codewarrior seems to compile the startup code into a library where I cannot see the source.
 
I can see the reset exception code in eppc_exception.asm and that branches to __reset() in ep8248_init.c but that routine branches to __start() and I cannot find the source for __start() anywhere.
 
It's really nice that CW generates the startup code for this eval board but I also want to see the source. Can I find this source anywhere in the distribution?
 
Please advise.
 
 Pedro1
Labels (1)
0 Kudos
2 Replies

1,006 Views
Teo
NXP Employee
NXP Employee
Hi Pedro,

You can find the startup code in {CW}\PowerPC_EABI_Support\Runtime\Src\__start.c

You'll find rare cases when you actually will have to modify this file. The start-up code is farely generic and ensures ABI complience of C code.

The usuall place where to put your HW initialization code is in "usr_init" method from "ep8248_init.c". Note that at the moment when "usr_init" is called you do not have a valid stack. I whould recommend in that place to initialize memory system and interrupt handlers only. More complex initialization could be done from "main".

Regards,
Teodor Madan
0 Kudos

1,006 Views
pedro1
Contributor I
Teodor
 
Thanks, that is just the kind of answer I needed. I'll check it out when I get into the lab.
 
 Pedro1
0 Kudos