cancel
Showing results for 
Search instead for 
Did you mean: 

Need help about startup file

Asraful
Associate III

I am trying to write own startup file in c++ till now everything is working but I am having issue when declaring and defining something in the global scope it's most probably related to the static constructor that cpp need but I don't know how to fix this can anyone help me with this? 
Thanks in advance 

2 REPLIES 2
TDK
Guru

> I am having issue when declaring and defining something in the global scope

What issue are you having? To define something in the global scope is a straightforward task.

uint32_t global_variable = 42;

> it's most probably related to the static constructor that cpp need but I don't know how to fix this can anyone help me with this? 

Maybe, maybe not. Show the issue in more detail.

Part of the job of the startup file is to initialize global objects, so you won't be able to use them until you do this.

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Evangelist III

Please see the startup files in latest CMSIS libraries from ARM. The startup files there are written in C (not C++).