Variable declaration at a hard coded address

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Variable declaration at a hard coded address

2,531 Views
NeedHelp
Contributor I

Hi there!
I've got a problem and have not been able to solve it for weeks. I've tried what ya'll had suggested-without much luck.
PLEASE GIVE ME A SIMPLE SOLUTION. MAYBE 4-5 lines of sample code?? PLEAE PLEASE PLEASE!
What I want to do:
1. Declare a variable at a fixed address location and be able to use it from wherever.
What I did:
dword _FLASHAddr:smileyvery-happy:VECT_FLASH_ADDR;
word  _FLASHData:smileyvery-happy:VECT_FLASH_DATA;
When I do this and compile I get a linker error. Says " Link Error: Undefined: "F_FLASHAddr" Referenced from ...."
Aparently I need to do something in the linker as well? What do I need to do?

2. Say I have a function called Boot(). I also have a hard coded constant variable CVECT_BOOT = some location in program memory. I want to be able to invoke function boot by calling a constant function pointer to CVECT_BOOT.
For example in SiLabs IDE I do both A and B:
A. In STARTUP.51 I specify the jump table for shared functions.
                                CSEG    AT      0x007B
                                EXTRN   CODE (boot)
                                AJMP        Boot
B. ((void (code *) (void)) 0x007B)();  // this calls my function boot

How do I do A and B in codewarrior?

Guys your help will be hugely hugely appreciated. Thanks in advance.

 

Installed_Plugins.txt

Message Edited by t.dowe on 2009-10-15 05:44 PM
Labels (1)
Tags (1)
0 Kudos
4 Replies

380 Views
trytohelp
NXP Employee
NXP Employee
Hi,
 
I will handle this SR.
According to the info you sent you're noot using the last version : DSC 8.2.
You can download this version on our web site via the link:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW-56800E-DSC
For details please have a look in:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW-56800E-DSC&tab=In-Depth_Tab
In the download tab you can download the Special Edition or the Evaluation.
The Special edition contains the special edition license limited to 32 kb of Code.
If you need another version of the license please contact your local distributor.
You can have several versions installed on the same PC.
There is only one restriction: install them on separate folder.
If you're using an old version, please backup your project before to try it with this new version.
If you will meet some compatibility issue you could back to the older version without problem.
 
Regards
Pascal
 
0 Kudos

380 Views
trytohelp
NXP Employee
NXP Employee
Hi,
 
attached to this email you will find an example for the point 1.
For the point 2 I recommend you to contact the support team.
Please use Freescale on line support web page.
  - Go to following URL: http://www.freescale.com/TechSupport
  - Click on Submit a Service Request. You will come to a login page.
  - You can submit your request through the web from there.
 
Regards
Pascal
0 Kudos

380 Views
NeedHelp
Contributor I
Thanks Pascal. Ill try to figure things out. Will let you know if I run into barriers.
Thanks again bud.
0 Kudos

380 Views
trytohelp
NXP Employee
NXP Employee
your welcome.
 
Pascal
0 Kudos