AnsweredAssumed Answered

BF561: #pragma file_attr(), #pragma section() for shared objects

Question asked by Yaniv.Sapir on Jul 12, 2011
Latest reply on Jul 15, 2011 by StuartS

Following the sample code generated by the Project Wizard, objects that are mutual to both cores and reside in L2 are declared in module shared.c with:


#pragma file_attr("sharing=MustShare")
#pragma section("l2_shared")
volatile int shared_var;


As the project grows, there is a long list of shared objects.


1. Can the file_attr() pragma appear just once before the declarations list?


2. Can the section() pragma be as such?


UPDATE: reading the book, I found the #pragma default_section() which supposedly answers question #2. Is that correct?


UPDATE 2: apparently, it did not. I replaced all the instances of #pragma section("l2_shared") with one #pragma default_section(DATA, "l2_shared") line. All variables were allocated in core A's L1 memory. Why didn't this work?