Re: Global variables not initialized properly (Win CE 5.0)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You're probably accessing the variable too early. You have to wait until
after the KernelRelocate function has been called.

--
Dean Ramsier - eMVP
BSQUARE Corporation


"E Semmes" <E Semmes@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D7742529-E75F-4A31-BDB7-69B898B87589@xxxxxxxxxxxxxxxx
Hello all,

I developed a RAM-based application and was able to build a debug image
successfully. In it I initialize several global variable to set values,
ie.

#define S3C2412_REG_GPCDAT 0x56000024
unsigned long * gpcConData = (unsigned long *) S3C2412_REG_GPCDAT;

However, during execution my global variable, *gpcConData, is not set to
the
correct value, 0x56000024. Instead it's a seemingly random number. Upon
inspection of the S-record file (EBOOT.SRE), I see that the linker is NOT
initializing that value at all. My fix for the time being is to perform
the
initialization in executed code. This applies to all user-defined global
variables. Obviously, this isn't acceptable as I don't want to have to
initialize all my global variables during run-time.

Is there a env var, flag or setting that must be changed to force the
linker
to actually initialize globals with the value I set them to?

Please help!

Thanks,
Emile

The platform is a Samsung S3C2412 ARMV4I-based uC with 32MB SDRAM mapped
at
0x3000 0000. I am using Platform Builder


.



Relevant Pages

  • Re: ensuring certain code runs when returning to a form...
    ... then you should initialize them after you've gotten what ... I find the idea of using global variables for this to be highly ... it's always better to use vbNullString instead of "" in VBA, ...
    (comp.databases.ms-access)
  • Re: Global variables not initialized properly (Win CE 5.0)
    ... I go through a basic CPU HW init in my fw.s ... Isn't there a way to force the linker set ... In it I initialize several global variable to set values, ... initialize all my global variables during run-time. ...
    (microsoft.public.windowsce.platbuilder)
  • Help with "Concurrent Network Server" Design
    ... initialize a few databases from files every time it launches and needs ... Since I use global variables I need to ... make sure that for each new connection, I need to initialize all these ... I need to know the perfect "Concurrent Network Server" design for the ...
    (comp.lang.c)
  • Help with "Concurrent Network Server" Design
    ... global variables and data structures. ... initialize a few databases from files every time it launches and needs ... for each new connection, I need to initialize all these global ... I need to know the perfect "Concurrent Network Server" design for the ...
    (comp.unix.programmer)
  • Re: Initial values of File scoped and Block level variables
    ... global variables are not "initialized" by the compiler. ... > segment memory using callocwhich does the "initialization" to NULL ... An implementation could use callocto initialize globals that aren't ...
    (comp.lang.c)