MCUXpresso User Startup File

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

MCUXpresso User Startup File

Jump to solution
2,524 Views
kaarthick
Contributor II

Please tell me how to use own startup file instead of system generated.

0 Kudos
1 Solution
2,297 Views
BlackNight
NXP Employee
NXP Employee

>>If I make duplicate of the same file , exclude original startup file from build then its working fine.Is this right way?

yes, but do this in the project, not in the SDK respository.

If you modify the startup code in the SDK (from where the projects get created/copied), then of course this will affect all projects you will generate from that SDK. I recommend that you add the SDKs as ZIP files to the IDE, then the files will be copied and you keep the original SDK files intact.

pastedImage_1.png

I hope this helps,

Erich

View solution in original post

0 Kudos
10 Replies
2,297 Views
BlackNight
NXP Employee
NXP Employee

Maybe you could be more specific (device used, what is exactly what you want to accomplish)?

But the startup code with the SDK is not 'generated': it is added to the project at project creation time, and you are free to change it, delete and replace it or whatever you want.

I hope this helps,

Erich

0 Kudos
2,297 Views
kaarthick
Contributor II

Hai Erich,

I am using MK10DN512VLQ controller with MCUXpresso. Using SDK Development tool I Generated SDK for the same. Every time i create new project i found startup file loaded from sdk. if i change anything in that startup file, the same will affect on another project also. If i delete startup file and add it into another folder with correction which i want, i am facing debug issue which points to sdk generated file is missing. 

Now i need solution which eliminate sdk generated startup from compilation or linking.

I think Linking stage makes an error. Where i can change the startup path for linker. 

0 Kudos
2,297 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Changing the startup file in one project does not affect there startup file of other projects. What actually is the problem you think you are seeing?

Regards,

MCUXpresso IDE Support

0 Kudos
2,297 Views
kaarthick
Contributor II

I am using MCUXpresso IDE. Controller used MK10DN512VLQ. SDK downloaded from SDK Development tool Kit.

Startup file added to project from that SDK. if i modify from startup file, this will affect another project also.

If I make duplicate of the same file , exclude original startup file from build then its working fine.Is this right way?

0 Kudos
2,298 Views
BlackNight
NXP Employee
NXP Employee

>>If I make duplicate of the same file , exclude original startup file from build then its working fine.Is this right way?

yes, but do this in the project, not in the SDK respository.

If you modify the startup code in the SDK (from where the projects get created/copied), then of course this will affect all projects you will generate from that SDK. I recommend that you add the SDKs as ZIP files to the IDE, then the files will be copied and you keep the original SDK files intact.

pastedImage_1.png

I hope this helps,

Erich

0 Kudos
2,089 Views
Lukas_Frank
Senior Contributor I

Hi after a long time.

How can I create own startup file if I do not want to use a SDK project? So, how can I do that without manipulate existing one.  For example, in the IMXRT1024 model there is a startup file named "startup_mimxrt1024.c". What is the logic of behind the startup_mimxrt1024.c file. How compiler knows to go into it firstly before run "void main()" function?

Tags (1)
0 Kudos
2,086 Views
converse
Senior Contributor V

When the processor boots, it loads the stack pointer and PC from address 0x0 and 0x4 which are the first two entries of the vector table. By convention NXP  specify ResetISR as the PC (but it can be called anything). This function is the executed, which in the provided startup code, performs necessary processor initialisation, copies initialised vales from flash to RAM, sets up the C (or C++) libraries and then finally calls main(). It’s a complex process and needs to be done correctly, in the right order for your C code to run correctly.

why do you want to write this yourself, when the tools do this for you?

0 Kudos
2,070 Views
Lukas_Frank
Senior Contributor I

Actually, I'm not focusing directly to do this. There is an obscurity around how processors knows startup_mimxrt1024.c file for entry file point. I'm new on NXP and I could not find a entry point input for determining file name on MCUxpresso IDE. I could not find any specifier related to the startup_mimxrt1024.c file. Could you explain where this information is in the processors and MCUxpresso IDE.

 

Thanks and Regards. 

0 Kudos
2,067 Views
converse
Senior Contributor V

Suggest you read about Cortex-M processors from ARM about how the boot. But, briefly

Processor reads stack pointer from0x0 and PC from 0x4. These are the first two entries of the vector table.

the vector table is defined in the startup file

the rest boots from there.

0 Kudos
2,296 Views
kaarthick
Contributor II

Thanks . Its helping me

0 Kudos