Forum Discussion
Altera_Forum
Honored Contributor
13 years agoThe attribute directive must be added after the function declaration.
For example you declare: int myFunction (void) __attribute__ ((section (".onchip_mem_code"))); Then the function definition without any attribute: int myFunction (void) { // function body } Similarly for data, except here you must specify attribute when you define the variable, not when you declare it: int myVariable __attribute__ ((section (".onchip_mem_data"))); For external referencing the variable, don't use any attribute: extern int myVariable;