Can you simply do that? Does the compiler insert code to write the flash? I
thought you had to explicitly erase the whole flash section and then do a
single write to each location. Then erase it again before you write it
again. Also, I did not think you could just write flash like normal memory.

- Tom

-----Original Message-----
From: mspgcc-users-ad...@lists.sourceforge.net
[mailto:mspgcc-users-ad...@lists.sourceforge.net] On Behalf Of Yvan
Castilloux
Sent: Friday, September 24, 2004 11:36 AM
To: mspgcc-users@lists.sourceforge.net
Subject: [Mspgcc-users] writing variables (not constants) in own section of
flash

Hi,

I'm currently trying to write variables (and not constants) in my own 
section of flash with mspgcc (not IAR) that I created in a linker script.  
The section is created.  I can create constants with __logdata__ 
__attribute__((section(".logdata"))).   I got rid of the const specifier and

initialized the data.  The data is indeed written in the right address range

of memory when initialized, but when I try to change the array in the code, 
it doesn't change the initialization data.  Is it only possible to create 
constants with this method?  If not, how can you create variables that are 
modified by the program?  I tried the pragma call such as:

#pragma memory=constseg("logdata");  //or #pragma memory=constseg("logdata")
Word2_t RssiData[10] ={0,0,0,0,0,0,0,0,0,0};
#pragma memory = default

but the compiler gives a message that it ignored the pragma ("ignoring 
#pragma memory").  What is wrong?  Can I create a variable with such a call 
in mspgcc?

I'm thinking of creating my own function that uses low-level assembly that 
would write into flash.  However, I would like to avoid doing that.

Best regards,

Yvan

_________________________________________________________________
Take advantage of powerful junk e-mail filters built on patented MicrosoftR 
SmartScreen Technology. 
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=htt
p://hotmail.com/enca&HL=Market_MSNIS_Taglines 
  Start enjoying all the benefits of MSNR Premium right now and get the 
first two months FREE*.



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to