cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
552 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
Highlighted
Moderator
Moderator
454 Views
Registered: ‎03-25-2019

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

View solution in original post

7 Replies
Highlighted
Moderator
Moderator
512 Views
Registered: ‎03-25-2019

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
Highlighted
Visitor
Visitor
494 Views
Registered: ‎07-30-2018

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

Highlighted
Moderator
Moderator
484 Views
Registered: ‎03-25-2019

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
Highlighted
Visitor
Visitor
478 Views
Registered: ‎07-30-2018

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
Highlighted
Moderator
Moderator
455 Views
Registered: ‎03-25-2019

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

View solution in original post

Visitor
Visitor
448 Views
Registered: ‎07-30-2018

Ok,
Thanks for your response

Highlighted
Moderator
Moderator
445 Views
Registered: ‎03-25-2019

You are welcome!

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