Post Go back to editing

User input arguments to QEMU

Category: Software
Product Number: ADSP-SC594
Software Version: CCES 2.12.0

Hello,

I'm using QEMU via command line to run an A5 bare-metal executable that I built with CCES 2.12.0. I'm able to run the executable as per the instructions in the Appendix A - Simulation Environment Selection for Different Purposes:

qemu-system-arm -semihosting -cpu adsp-sc589 -kernel armprogram

What I'm currently not able to do is to pass user arguments to the ARM program. Appending those arguments via the -append option or just attaching them to the command above don't seem to help and I always get argc=0 in my main() function..
I've also tried to read the /proc/cmdline file and read the environment variables, none of which have helped.

Is it possible to achieved that somehow?

Thanks in advance!
Parents
  • Hi,

    We are able to use the commands provided in the QEMU help section from the command line.

    You can get the help commands by running below command.
    C:\Analog Devices\CrossCore Embedded Studio 2.12.0\ARM\qemu> qemu-system-arm.exe -help

    Also, please let us know if you are running QEMU in Linux or windows platform. And, please share us the command that you have tried in command line. It will help to proceed further.

    Regards,
    Nishanthi.V

  • Hello,

    I had looked into the help for more hints, but to no luck. I'm using it on Windows 11. The command is the one from my main post:

    qemu-system-arm.exe -semihosting -cpu adsp-sc589 -kernel armprogram

    To which I tried appending user input arguments in various manners:

    qemu-system-arm.exe -semihosting -cpu adsp-sc589 -kernel armprogram arg1 arg2
    qemu-system-arm.exe -semihosting -cpu adsp-sc589 -kernel armprogram "arg1" "arg2"
    qemu-system-arm.exe -semihosting -cpu adsp-sc589 -kernel armprogram -append "arg1 arg2"
    qemu-system-arm.exe -semihosting -cpu adsp-sc589 -kernel armprogram -append "arg1=argv1 arg2=argv2"
    qemu-system-arm.exe -semihosting -cpu adsp-sc589 -kernel armprogram -append arg1=argv1 arg2=argv2
     

    None of which succeeded.

  • Hi,

    Could you please try with the below command line for appending the arguments.

    qemu-system-arm.exe -semihosting -cpu adsp-sc589 -kernel programname -append arg1 -append arg2

    Hope this helps!

    Regards,
    Nishanthi.V

  • Hello,

    I tried this and unfortunately it doesn't work. The arguments given are not listed in main's argv/argc.

    Best,

    Edgar

  • Hi,

    Apologies for the confusion here.

    Unfortunately, GNU ARM Bare-Metal applications does not support argc/argv. Therefore, the argc/argv was removed from an ARM project's source file generation itself.

    Regards,
    Nishanthi.V

Reply Children
No Data