Hi,
I recently installed the 20120716 release (following the instructions in
the readme and wiki). The installation seems fine as I can compile and
correctly run the my code from v4.6.
My chip is msp430f5438a on the experimenter board.
I would like to put a lookup table in the far memory region. I was testing
some simple code using the __far__ attribute, but the code seems to be
getting placed in the near region. I'm sure I'm missing something silly.
Can somebody please help. (Note: The code is not mean to produce anything
meaningful. I simply need to see if the memory assignment is happening
correctly, for which I am using msp430-objdump
My sample code
#include <stdio.h>
#include "sj.h"
/* contains an initialized array declared as
const char kuttest[30000] __attribute__((__far__)) =
{ 1, \
2, \
2, \
2, \
2, \
2, \
...
};
int putchar(int c) {return 0;}
void main() {
int res;
const char * __attribute__((__a20__)) abc = kuttest;
for(res = 0; res < 10; res++)
printf("%x abc", *(abc+res));
}
I am compiling this will the most conservative options
msp430-gcc-4.7.0 -mmcu=msp430f5438a -md20 -msr20 -mdata-region=far -mc20
-mcode-region=far fardata.c -Wall -o fardata
The code compiles fine (with the warning about main return type not being
int).
The objectdump shows me
Disassembly of section .rodata:
000066d6 <kuttest>:
66d6: 01 02 mova #4, r1 ;r2 As==10
66d8: 02 02 mova #4, r2 ;r2 As==10
66da: 02 02 mova #4, r2 ;r2 As==10
66dc: 02 02 mova #4, r2 ;r2 As==10
66de: 02 02 mova #4, r2 ;r2 As==10
66e0: 02 02 mova #4, r2 ;r2 As==10
66e2: 02 02 mova #4, r2 ;r2 As==10
66e4: 02 02 mova #4, r2 ;r2 As==10
The variable is not in the far address space.
Any help is appreciated.
Thanks a lot
Shalabh
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users