I want to use the EMIF. Since the EMIF is not part of the GCC default linker file, a custom linker file has to be created.
Now, my question is about initializing the variables located in external memory. According to the PDF document global and/or static initialized and zero initialized variables must reside in the .data/.bss sections, otherwise they're not initialized, even if they're explicitely initialized. To ensure variables are initialized, the AT keyword has to be used (see page 24).
Viewing the example project mentioned above shows that the linker file also has a SECTIONS entry for the EMIF with the AT keyword. The question is why it uses the AT if initialization is ignored? Or does it mean that only local variables can be initialized?
I'll check internally with the Application Note authors and will get back to you.Thank you for the patience.
thank you for the link, my project is based on that example and AN89610. However, it doesn't state what really happens regarding initialization, etc. Maybe I'll connect a SRAM and look what happens...
As you said the variable is not initialized. I think you can skip the keyword "AT" as we are not initializing the EMIF variable. You can try modifying the .ld file as:
.EMIF_ASYNC : ALIGN(8)
} >EMIF >rom
we'll have to turn-around the question: it simply means that EMIF variables can't be initialized, right? The original question was if any EMIF variables, wether global or local, can be initialized?