cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Prasanna_K
Explorer
Explorer
627 Views
Registered: ‎07-24-2020

How to pass arguments to bare metal code in Vitis 2019.2

Jump to solution

Hello,

I am executing one of the benchmark code on both Petalinux and Bare metal. I have successfully executed my code on Petalinux, however, I am not able to execute the code in Vitis as I am not able to pass the arguments to the code. How can I pass arguments in Vitis.

Here's what I did so far, My main function looks something like this and accept command line arguments. 

 

int main(int argc, char **argv) {
/*
My code.....
*/
}

 

I cross compile using aarch64-linux-gnu-gcc and get the executable file.

I execute below command on the Petalinux to execute the program and get the expected output.

 

./ubench --mode compressible --size 65536 --validation 1

 

 

Now I am trying to execute the same code on the baremetal using Vitis and  I am trying to  pass arguments in Vitis like this but it didn't work.

Prasanna_K_0-1609774286069.png

I get below error because arguments did not pass and program failed.

 

#### benchmark configuration ####
# mode: (null)  
assertion "strcmp(mode_val, "compressible") == 0 || strcmp(mode_val, "random") == 0 || strcmp(mode_val, "both") == 0" failed: file "../src/ubench_main.c", line 113, function: main

 

Regards,

Prasanna

0 Kudos
1 Solution

Accepted Solutions
Prasanna_K
Explorer
Explorer
521 Views
Registered: ‎07-24-2020

System debugger supports cmdline args only for Linux applications. Cannot pass cmdline args for bare metal code on standalone system.

https://forums.xilinx.com/t5/Embedded-Development-Tools/SDK-Standalone-application-passing-arguments-to-main/m-p/997695#M49759

View solution in original post

1 Reply
Prasanna_K
Explorer
Explorer
522 Views
Registered: ‎07-24-2020

System debugger supports cmdline args only for Linux applications. Cannot pass cmdline args for bare metal code on standalone system.

https://forums.xilinx.com/t5/Embedded-Development-Tools/SDK-Standalone-application-passing-arguments-to-main/m-p/997695#M49759

View solution in original post