No initialized variable in RAM


#1

Hi,

i need to use in my application, global variable in no initialized RAM. Others compilers have pragma or special key for this type. Is there something else like this in open AT with Visual C++ ?

thanks,

Hegler


#2

Perhaps if you explained what you are actually trying to achieve, people might be able to suggest appropriate ways to do it… :question:


#3

I´m needing a type of variable that is not initialized when the application starts. I use two other compilers C, IAR and Dynamic C, and these compilers have two special keywords as “noinit” and “bb” (backup battery). Thus the variables of these types never are initialized…

Examples :

// Global variables -> Dynamic C compiler
bb int aux;
bb char x;

// Global variables -> IAR C compiler
noinit int aux;
noinit char x;

such compilers never initialize those variables.

I know that, by default, all global variables are initialized with “0”, however i need other kind that don´t be initialized with START UP C ROUTINE.

Hegler


#4

These are probably for writing “stand-alone” applications, but your Open-AT application is not “stand-alone” - it is a Task running within the Wavecom environment.
Therefore, even if you did read the GCC Manual and find the appropriate switch, it might not help you!

Again, why do you think you need this?

As I said before, if you explained what you are actually trying to achieve, people might be able to suggest appropriate ways to do it…

Remember: the value of an uninitialised variable is undefined at startup - so it is quite possible that it could be zero anyway! You code has to cope with this, so why is it a problem if the values does just “happen” always to be zero?? :wink:


#5

Hello,

I think he would like to hold the data in the memory, for example when a reset happens. But as awneil said, the Open AT application is a task, the memory is handled by the Wavecom OS. You can’t even be sure that you get the same part of the memory when you start your application. It is not impossible, but it must be strongly supported by the OS, which is not the case as far as i know.

Best Regards,
tom


#6

Yes, that would be my guess, too!

But, until he explains what he’s actually trying to do, it remains just a guess - so no real answers can be given.

Unfortunately, he seems to have lost interest now. :frowning:


#7

vars not initialized???
what the hell is he talking about?
if you ? what is the value? (globals are know of course)(locals are dirty)

i am sure he is doing another question

if he wants to get the var value if a resets happend of course there are a non volatile memory as all we know it is call ROM


#8

ROM wouldn’t help since that is Read Only Memory. So you wouldn’t be able to write it from the application at all! You probably mean Flash or EEPROM?

Best Regards,
Jan


#9

absolutely rigth, i was talking about in a general way.

indeed flash is an EEPROM with block size reading and writing


#10

Hi all,
I will try to justify myself better. By default, all global variable are initialized by startup code, that run before the call to the main function. Start up initialize global variables, initialize also the stack and all memory space that will be used by the program. That is valid in such a way for the development of software or firmware. In some compilers is possible to use global variables that don´t be initialized by start up code. These variables are kept in memory regions, where the CPU preserves them with battery, thus when the equipment if disconnect such values is not lost. In my application I need an variable that is not initialized by startup code and that it keeps its value in case that the equipment is kept energized, if equipment restart for many times without it is turned off, the value of those variables must be preserved and will have to lose its value when the equipment will be off.
I know that in Wavecom modules have OS in a layer before the application and when its restart the OS run before the application !! (is it correct ?). However, those variables type (not initialized) may not be possible.
That is my problem, know if equipment was turned on or restarted !!
Someone have any idea ?

Thanks,
and sorry for my english !!

Hegler


#11
  1. the first thing is to know if this is posible in your wavecom module.

  2. if the feature it is availble, can you asign your var at some location in wavecom OS?

  3. if your var it is not update to much you can keep it in the eeprom, and playwith that.

from my point of view point number 1 it is need, if you do not have such behaviour your question it is out of coverage.


#12

hi ofernandez,

i´m using 24NG with 6.57 firmware and OAT 3.13.

answer !

  1. the first thing is to know if this is posible in your wavecom module.
    I’m sure that is possible with that module, however if OS allows it !! i don’t know…

  2. if the feature it is availble, can you asign your var at some location in wavecom OS?
    That is what I want !! How can I do it ?

  3. if your var it is not update to much you can keep it in the eeprom, and playwith that.
    This is not possible, because when module were turned off, the variable don’t lose its value, and in my application it is very important !

Hegler


#13

Hello hegler,

I’ve already told you that my opinion is that this is not supported by the OS 6.57 and i don’t think it will be in the future, but i’ve heard something about an external RAM feature in the future OS 6.6x versions. Unfortunately i have no more information about that, but my guess is, that it is going to be what you need. Please contact your distributor to get information for you about this feature. If your development is in an early phase, i suggest changing to q268x processor because you will miss the new things in the future.

Best Regards,
tom


#14

well when the app start init the var, how easy

it is dificult to me understand that you want to keep a value when the app it is not running, but when the app run againg you do not want to use it, how and who will use this value then?

if procesor is running the app is running, the only way to stop the app it is turning off the procesor
whe n you turn on agains then all will be restarted

i do not know if you are asking for low power modes? (the app still running in power save mode)


#15

Why is it so difficult to understand?
It could be very useful to keep logging information or measurement datas on that and you don’t have to worry about flash memory cycles, altough today’s flashes are quite durable.
Just think about GPS receivers, what do you think how can they achive warm and hot starts ( < 1 sec )?

Cheers,
tom


#16

hi tom

thank you very much. Unfortunately i’ll find another way…to solve my problem.

Hegler,


#17

Maybe SPI RAM?

cheers


#18

Yes, it’s a good idea ! I already use SPI to control logic in FPGA. Then i´ll implement only one register with flip-flop there and so… all right.

thank you so much,

Hegler