Thank you, that's exactly what I did and it works perfectly.
Yvan
From: Arnd-Hendrik Mathias <arnd-hendrik.math...@stud.uni-erlangen.de>
Reply-To: mspgcc-users@lists.sourceforge.net
To: mspgcc-users@lists.sourceforge.net
Subject: Re: [Mspgcc-users] writing variables (not constants) in own
section of flash
Date: Sun, 26 Sep 2004 17:40:52 +0200
Hi Yvan,
in general you are writing flash with the procedure described in the user's
guide (disable watchdog, enable flash writing, poll BUSY flag, set memory,
if executing from RAM: poll BUSY-flag, disable flash writing, enable
watchdog). As Tom already wrote preceeding flash erasing may be necessary.
This is always necessary as long as you cannot provide that you are only
setting bits from erased (1) to 0, especially in your example where your
array is initialized with zero's (all bits set in terms of flash
controller).
According to Tom I wouldn't expect the compiler to insert code
automatically for it doesn't even know anything 'bout the planned
positioning of the array (compilers don't read linker files).
Regards
Arnd-Hendrik
Thomas W. Carley wrote:
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
-------------------------------------------------------
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
-------------------------------------------------------
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
_________________________________________________________________
Take charge with a pop-up guard built on patented Microsoft® SmartScreen
Technology
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
Start enjoying all the benefits of MSN® Premium right now and get the
first two months FREE*.