Jump to content
  • 0

When do I need to generate a linker script for a Vitis Application


Tparng

Question

The Vitis software platform provides a linker script generator to simplify the task of creating a linker script.  

When testing the ZedBoard_FMC_Pcam_Adapter_demo app (checked out from https://github.com/Digilent/ZedBoard-SW),  if I run the app right after check out form GitHub Repo, it runs successfully.  However, after I updated the system_wrapper[Platform] from the new Bitstream produced from the HW project, if I do Generate Linker Script before doing  Build Project on the ZedBoard_FMC_Pcam_Adapter_demo app. then the demo app will fail and exit with "terminate called without an active exception" error. 

If I do not do Generate Linker Script before doing Build Project, then the demo app can run successfully. 

Does that mean I should not do  Generate Linker Script before Build Project or I haven't used the right options/settings for Generate Linker Script command? 

In general, my question is: Under what situation I will need to generate a linker script for a Vitis Application and under what situation I don't need to ?

Thanks,

Tparng

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @Tparng

Demo projects typically come with a predefined linker script. You can see lscript.ld here: https://github.com/Digilent/ZedBoard-SW/tree/FMC-Pcam-Adapter/master/src/FMC_Pcam_Adapter_demo/src. In general, you should not generate new linker scripts with these projects, since, in some cases, creating a new one will cause the demo to not work, as the script may have been customized - like to increase heap or stack size, for example.

As an aside, there is a bug in some versions of Vitis which cause the linker script to not be added correctly when importing projects from release ZIP archives (rather than checked out sources), which has a workaround documented here: https://digilent.com/reference/programmable-logic:guides:using-github-releases#baremetal_release_workaround_before_programming

Thanks,

Arthur

Link to comment
Share on other sites

  • 0

@Arthur and Edenwheeler,

Thanks for your answers that clarify most of my confusion.

One more question: If I created my hardware design from scratch (using IP blocks or rtl modules), exported the hardware, created a new application system and hardware platform in Vitis,  and then created my test program starting from the "empty C application" template, do I need to generate a linker script or just use the default one given by Vitis?

Thanks,

Tparng

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...