UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor cenault
Visitor
289 Views
Registered: ‎07-30-2018

[SDK - Standalone application] passing arguments to main

Jump to solution

Hello,

I am developping several standalone applications on both CPU of a Zynq-7020 (Zedboard) that could received arguments.
How can arguments can be given to both executables ?

If impossible, how can parameters can be givend to execubables for standalone application ?

Regards,

Cyril

1 Solution

Accepted Solutions
Moderator
Moderator
191 Views
Registered: ‎03-25-2019

Re: [SDK - Standalone application] passing arguments to main

Jump to solution

Hi Cyril (@cenault),

System debugger supports cmdline args only for Linux applications.

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
7 Replies
Highlighted
Moderator
Moderator
249 Views
Registered: ‎03-25-2019

Re: [SDK - Standalone application] passing arguments to main

Jump to solution

Hi @cenault,

Could you please give more details about your use case?

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Visitor cenault
Visitor
231 Views
Registered: ‎07-30-2018

Re: [SDK - Standalone application] passing arguments to main

Jump to solution

Hello,
Thanks for your repy.

 

My use case is some baremetal applications running each one on one CPU of Zynq-7020 using each one an instance of hardware IP from PL.


These are test applications for which I would like to pass some arguments (test kind, size of buffer, IP ID to use... ).

I may have two implementation of the IP with 2 differents drivers and I would like to select IP version (and even more IP ID if several IP of same kind implemented). Test initialization is quite similar and I would like not ti duplicate the same code.

I would like to run :

Application on CPU0: <CPU0Appl.elf> <arguments list for CPU0 application>

<arguments list for CPU0 application>: to be retrieve as argv arguments for main

Application on CPU1: <CPU1Appl.elf> <arguments list for CPU1 application>

<arguments list for CPU1 application>: to be retrieve as argv arguments for main

Regards,

Cyril

Moderator
Moderator
221 Views
Registered: ‎03-25-2019

Re: [SDK - Standalone application] passing arguments to main

Jump to solution

Hi Cyril (@cenault),

Passing parameters to a bare metal application from the beginning does not make much sense as you don't have a way to pass them (i.e. a terminal).
So, if your goal is just to not duplicate code, you can use preprocessor macros/directives and define their value before compilation.

If you don't like to set these values during compilation and you prefer to to pass them during runtime, then the only remaining options are to either implement a kind of command prompt on your code or to run your application using the debugger and modify the values of your variable before continuing execution.

 

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Visitor cenault
Visitor
215 Views
Registered: ‎07-30-2018

Re: [SDK - Standalone application] passing arguments to main

Jump to solution

Thanks for the reply,

I am using 2017.3. In "Run configuration", there is tab "(x)= Arguments", so I wanted to use it...

Regards,

0 Kudos
Moderator
Moderator
192 Views
Registered: ‎03-25-2019

Re: [SDK - Standalone application] passing arguments to main

Jump to solution

Hi Cyril (@cenault),

System debugger supports cmdline args only for Linux applications.

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
Visitor cenault
Visitor
185 Views
Registered: ‎07-30-2018

Re: [SDK - Standalone application] passing arguments to main

Jump to solution

Ok,
Thanks for your response

Moderator
Moderator
182 Views
Registered: ‎03-25-2019

Re: [SDK - Standalone application] passing arguments to main

Jump to solution

You are welcome!

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos