Using "__at" obscures symbol (MSP430)
Hi,
I am trying to understand exactly how "__at" works, as I have been getting some linker errors when using it.
As an eaxample of this I have generadted a very simple application with three file:
main,c
#include <__cross_studio_io.h>
#include "Globals.h"
void main(void) {
for (gbl_Uint = 0; gbl_Uint < 5; gbl_Uint++) {
debug_printf("hello world\n");
}
debug_exit(0);
}
Globals.c
unsigned int gbl_Uint __at 0x2380;
Globals.h
extern unsigned int gbl_Uint;
If i compile this without the "__at 0x2380" it compiles and runs, but with the "__at 0x2380" I get an undefined symbol for '_gbl_Uint'.
Normally, to share a Global variable amongst various 'C' files I would use this genral format of defining the variable in a single C file and then use an extern declaration in a header to publish it to other C files that required acces to it.
Any advice on the best way of using "__at" with globals that need to be accessed by different C files would be appreciated.
Regards
Roy
Please sign in to leave a comment.
Comments
0 comments