2006-08-02 05:55 AM
2006-08-02 02:49 AM
Hi.
I'm using CrossStudio and a STR712F12. I'm trying to get my variables to align to 16 bit addresses, i.e. align = 2. I've created a new memory segment in my memory map and created new program sections under that. Each program section is then allocated a specific address and size in on-chip RAM. All the variables that I want in those memory locations are then defined in a single .h file. Like so: #ifdef _PARAMETERS_ #define _SCOPEP_ __attribute__ ((section(''.parameters''))) #else #define _SCOPEP_ extern __attribute__ ((section(''.parameters''))) #endif _SCOPEP_ int overflow_count; _SCOPEP_ int processor_idle; etc. Now, I also need those variables to align to 16bits. I've tried changing the ''Alignment'' option for my program sections to ''2'', but it didn't do what I wanted. Any help would be appreciated. Thanks Neil2006-08-02 05:25 AM
use the __attribute__ ((aligned (2))) option.
Regards sjo2006-08-02 05:55 AM
Hi sjo.
I've already tried that, but it doesn't work either. I get no errors or warnings, but my variables remain aligned to 4. Neil