Sign in

username:

password:



Not a member?

Search c3x



Search tips

Subscribe to c3x



c3x by Keywords

Boot | C31 | TMS320VC33 | VC33

Ads

Discussion Groups

Discussion Groups | TMS320C3x | global variable not accessible!

Technical discussions about the TI C3x DSPs (including the C31, C32 and C33 DSPs).

  

Post a new Thread

global variable not accessible! - Saqib Ali - Nov 11 21:58:00 2002



hi

i have been coding on the code composer in the emulator . my project contains 4
source files . i have a global variable in teh file containong main ... but when
i try to access it through the sub routine which is present in the other file ,
in which the global variable is refrenced as extern , it dont take the value , i
have enabled teh file-level optimization in te compiler options ... anybody have
any idea ?

Saqib





(You need to be a member of c3x -- send a blank email to c3x-subscribe@yahoogroups.com )

Re: global variable not accessible! - Keith E. Larson - Nov 12 14:54:00 2002

Hello Saqib

1- Global variables are typicaly loaded using direct addressing. Make sure
the DP register is correct or has not been corrupted

2- Have you linked the correct RTS libraries. Mixing large/small memory
models and or libraries with the non-matching register passing can lead to
side effects.

3- You did not say exactly what was not working, but if this involves a math
function other than the base add/sub/mpy functions (EG handled in hardware),
you might need to add #inclide <math.h> to the top of your file. This
compiler does not report missing prototype functions (an interesting
loop-hool in the old ANSI-C standards). If no prototype is known, the
compiler will assume integer input and outputs per the count of the calling
function.

4- Tell the linker create a map file for you and make sure the variables
storage location looks sensible. Might be reserved or non-existing memory?

5- Open (or relocate) a memory window at that location. You should see the
variable name and you should be able to edit the displayed data.

Hope this helps,
Keith Larson
====================================
At 01:58 PM 11/11/02 -0800, you wrote:
>hi
>
>i have been coding on the code composer in the emulator . my project
contains 4 source files . i have a global variable in teh file containong
main ... but when i try to access it through the sub routine which is
present in the other file , in which the global variable is refrenced as
extern , it dont take the value , i have enabled teh file-level optimization
in te compiler options ... anybody have any idea ?
>
>Saqib
+-----------------------------------------------+
|Keith Larson |
|Member Group Technical Staff |
|Texas Instruments Incorporated |
| |
| 281-274-3288 |
| |
| www.micro.ti.com/~klarson |
|-----------------------------------------------+
| TMS320C3x/C4x/VC33 Applications |
| |
| TMS320VC33 |
| The lowest cost and lowest power 500 µw/Mflop |
| floating point DSP on the planet! |
+-----------------------------------------------+




(You need to be a member of c3x -- send a blank email to c3x-subscribe@yahoogroups.com )