How to pass multi arguments to main() in Arm Development Studio?

我想将配置文本作为 argv[1] 传递给 main() 函数,并且已经尝试过命令行。set semihosting args "config txt" ,but it seems like the config txt is argv[0] not argv[1],so how to pass multi arguments to main()?

Parents
  • Hi again

    You wrote:
    >I tried to launch the FVP model with e.g. "-C cluster.cpu0.semihosting-enable=0" in the Model Parameters field, _and_ have "set semihosting args 1 2 3" in the .ds script.
    >When connected it shows that semihosting breakpoint address has not be specified.

    Yes, for an Armv8/9-A/R target system that uses HLT-based semihosting, you must specify the semihosting breakpoint address.  This tells the debugger at what address it should set a breakpoint to trap semihosting requests.

    By default on an Armv8/9-A/R FVP model, the semihosting breakpoint address is at EL3:0x00000200. 
    So you must update your .ds script to, e.g.

    set semihosting vector ADDR EL3:0x00000200
    set semihosting enabled on
    set semihosting args 1 2 3

    I've tested this on the Cortex-A53 FVP model in Arm DS and it works as expected.
    The "Model parameters" I used for this were:
    -C cluster0.NUM_CORES=1 -C bp.secure_memory=false -C semihosting-enable=0

    The semihosting breakpoint address will depend on (and is an offset from) the Vector Base Address Register (VBAR) for the current EL.

    >why disable_sve_traps is necessary in sve examples but not necessary in hardware device like mobile phones.

    It depends how the target system is initially configured.  For an Arm FVP model running bare-metal code, the SVE traps must be disabled to allow SVE code to execute.
    In a hardware device like a mobile phone, that has an OS running, the OS might have disabled the traps for the application environment for you already.


    Hope this helps

    Stephen

Reply
  • Hi again

    You wrote:
    >I tried to launch the FVP model with e.g. "-C cluster.cpu0.semihosting-enable=0" in the Model Parameters field, _and_ have "set semihosting args 1 2 3" in the .ds script.
    >When connected it shows that semihosting breakpoint address has not be specified.

    Yes, for an Armv8/9-A/R target system that uses HLT-based semihosting, you must specify the semihosting breakpoint address.  This tells the debugger at what address it should set a breakpoint to trap semihosting requests.

    By default on an Armv8/9-A/R FVP model, the semihosting breakpoint address is at EL3:0x00000200. 
    So you must update your .ds script to, e.g.

    set semihosting vector ADDR EL3:0x00000200
    set semihosting enabled on
    set semihosting args 1 2 3

    I've tested this on the Cortex-A53 FVP model in Arm DS and it works as expected.
    The "Model parameters" I used for this were:
    -C cluster0.NUM_CORES=1 -C bp.secure_memory=false -C semihosting-enable=0

    The semihosting breakpoint address will depend on (and is an offset from) the Vector Base Address Register (VBAR) for the current EL.

    >why disable_sve_traps is necessary in sve examples but not necessary in hardware device like mobile phones.

    It depends how the target system is initially configured.  For an Arm FVP model running bare-metal code, the SVE traps must be disabled to allow SVE code to execute.
    In a hardware device like a mobile phone, that has an OS running, the OS might have disabled the traps for the application environment for you already.


    Hope this helps

    Stephen

Children
No data