I would appreciate your help to fix this problem: -------------------------------------------------- <main.c>
// include files #include "main.h"
// main int main(void) { //test code for problem in h file
while (reg1) { // wait } }
// end
<main.h>
volatile unsigned char reg1 __at 0x40004000; //see the semicolon?
<build>
Build target 'Target 1'
compiling main.c...
main.h(1): error: #65: expected a ";"
Target not created
----------------------------------- Eric
After looking over many posts on this subject, (most of which did not work or were way too messy), this finally took care of the problem:
#include <absacc.h> or copy it from ARM/RV30/INC or from here into your project folder and use #include "absacc.h"
Realview Compiler
Project Options for target (target) Linker folder tab upper right hand corner R/O Base: 0x40000000 (lowest read-only addr) R/W Base: 0x40004000 (lowest R/W addr)
------------------- main.c ------------------- #include "absacc.h" #include "main.h"
int main(void) {
int test;
/* test code */
test = gpio_pins;
gpio_pins = test;
}
-------------------- absacc.h -------------------- /* absacc.h: header file that allows absolute variable location at C level */ /* Copyright 2006 ARM Limited. All rights reserved. */ /* version 0.01 */
#ifndef __at #define __at(_addr) __attribute__ \ ((section (".ARM.__AT_" #_addr)))
#endif --------------------- main.h --------------------- /* assign variable to absolute location */ /* use __at with 2 underscores in front and left paren in back */
volatile unsigned long gpio_pins __at(0x40004000); --------------------- Build! --------------------- Build target 'Target 1' compiling main.c... linking... "debug.axf" - 0 Error(s), 0 Warning(s).