modifying linker script for EMIF acess -> variable initialization

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

Hi,

   

 

   

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.

   

This document www.cypress.com/ describes the basics of linker file modification on page 28. Additionally, I found a example project here www.cypress.com/ in the last posting.

   

 

   

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?

   

 

   

Regards,

   

 

   

Ralf

0 Likes
5 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

 Hello ,

   

 

   

I'll check internally with the Application Note authors and will get back to you.Thank you for the patience.

   

 

   

Thanks,

   

Hima

0 Likes
Anonymous
Not applicable

 Can you check at the last forum post in http://www.cypress.com/?app=forum&id=2232&rID=78398

0 Likes
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

Hi BMAH,

   

 

   

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...

   

 

   

Regards,

   

 

   

Ralf

0 Likes
Anonymous
Not applicable

 Hi Ralf,

   

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)

   

  {

   

    *(.MY_EMIF_sect) 

   

  } >EMIF >rom

   

Regards

   

BMAH

0 Likes
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

Hi BMAH,

   

 

   

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?

   

 

   

Regards,

   

 

   

Ralf

0 Likes