microblaze: execute program from external memory

Hi,

I would like to run my program (too big) from external memory. I don't know how to configure my project in Xilinx Platform Studio to complie it correctly. What parameter should I modify or is there any configureation file I should creat?

Any suggestion or help is greatly appreiciated!

Thanks Yongjie

Reply to
Yongjie Liu
Loading thread data ...

1 you need to modify (or create new) the linker script! good luck with that! for one who is not writing C programs all the day this may be quite a pain there are some example linker scripts I think, but you end up modifying them anyway 2 you need some means of loading the program into the external memory, this maybe even more complex than setting up the linker script during debug you can load the ext memory with XMD, but for standalone operation some boot option is needed, that is you need to copy the program from some nonvolatile media into the external memory, again for this also some examples exist, but they need to modified for your purpose

the steps 1, 2 above can easily take 2 man-weeks of time. Ok I agree, getting program into extram and loading running from XMD can be achived in few hours, a production quality bootloader solution can take up to 2 weeks easily.

in EDK dir there are some example scripts, also some reference desings include linker scripts, be aware that the linker scripts for microblaze and powerpc are quite different!

the minimal you need todo is to define one big chunk for extmem in linker script, and possible adjust the program start address

Antti

Reply to
Antti Lukats

If you don't leave holes into your program memory map the default linker script work very well

Walter.

"Yongjie Liu" a écrit dans le message de news: snipped-for-privacy@home.net...

Reply to
Walter Gallegos

Yongjie, What EDK release are you using. The latest EDK 6.3 has a graphical linker script generation tool that allows you specify where to put various sections of your program into internal or external memories present in your system.

Amit.

Y>Hi,

Reply to
Amit Kasat

Thanks for all your suggestions! I'm using EDK 6.2i. so I have to modify the linker script manually.

Best, Y> Yongjie,

--
Mega
Reply to
Yongjie Li

Yongjie,

If this is for development purposes and everything will be run out of external memory then you have two options.

The first and easiest option is to simply change the Program Start Address that is passed to the compiler. You can do this in EDK using the following steps:

  1. In EDK click on the Applications/Software Projects tab.
  2. Right click on the software project you are using and choose 'Set Compiler Options'
  3. In the Program Start Address put the start address of your external memory in your MHS file.
  4. Click 'OK' and recompile.
  5. You can download the new elf file to the memory using XMD and execute or debug the code as you wish.

The second way and they most embedded developers do this is using a linker script, as it has already been suggested. I would refer you to the Xilinx and GNU docs on writing linker scripts.

Cheers, Shal> Hi,

Reply to
Shalin Sheth

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.