_startupData and start08.c

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

_startupData and start08.c

ソリューションへジャンプ
2,493件の閲覧回数
CyrilG_
Contributor I
Hello,

Every time I change my source code and I rebuilt it, the startupData changes (I can notice a difference by looking in the s19 file). The problem I am having is that I am working on some in-chip programmability and I can not update the part of the flash where the startup routine is stored. And the startupData is stored in this particular section. Is there any way to keep this part constant? What are this startupData used for ?, is it possible to know where it takes its initialization?

Thanks
Cyril
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
913件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
toCopyDownBeg points to the .copy section. As this section must be the last in a section list,
you could allocate .copy into its own segment in the prm file.
And yes, with __ONLY_INIT_SP globals wont be initialized, not even to 0.

Daniel

PS: I think the more usual setup is to have multiple applications for the fixed and the updated part just to make sure those are really independent and changes like this do not break the compatibility. Of course this approach works too, one just needs to be quite careful with all changes.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
913件の閲覧回数
CrasyCat
Specialist III
Hello
 
The startup structure is created by the linker and contains information processed at application startup.
Different fields and their usage are documented in the Build Tools reference manual.
 
Take a look at {Install}\Help\PDF\Build_Tools_Utilities.pdf.
In chapter "SmartLinker" section "Program Startup" you should be able to find information of the startup structure.
Looking into the .map file you can also see how this structure is initialized (and check what did change since last build).
 
You can decide to get rid of the startup code and startup structure but in that case you have to make sure that all global variables are initialized through assignment in the application code.
You cannot have any global variable defined with an initialization value in that case.
 
If this is the way you want to go just add the option -D__ONLY_INIT_SP to your compiler command line and make sure you rebuild at least the file start08.c
 
Be careful if you are working in that configuration it is your responsibility as a programmer to ensure that application global variables are initialized properly.
 
CrasyCat
0 件の賞賛
返信
913件の閲覧回数
CyrilG_
Contributor I
Thanks for this information. I tried what you said and I was able to pinpoint exactly what variable changes everytime I change the source code. It is the variable  toCopyDownBeg. Is there any way to keep this value constant (maybe by modifying the prm file?) or the only way is like you said, use the __ONLY_INIT_SP compiler option ? In the latter option,  I just have to ensure that all the global variables are initialized somewhere in the code (and not when I declare them), is that right?
 
Thanks
Cyril
0 件の賞賛
返信
914件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
toCopyDownBeg points to the .copy section. As this section must be the last in a section list,
you could allocate .copy into its own segment in the prm file.
And yes, with __ONLY_INIT_SP globals wont be initialized, not even to 0.

Daniel

PS: I think the more usual setup is to have multiple applications for the fixed and the updated part just to make sure those are really independent and changes like this do not break the compatibility. Of course this approach works too, one just needs to be quite careful with all changes.

0 件の賞賛
返信
913件の閲覧回数
CyrilG_
Contributor I
Thank you, it worked perfectly. In the prm file I added to a line to put the .copy in a particular location in memory and now I don't have any problem.
Regards,

Cyril
0 件の賞賛
返信