This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How will I pass command line arguments to cross compiler code?

Hi people,

I have an interesting problem here. I need to generate a number (a 4-digit Integer) and give it as a command line argument to my exe file generated by the cross compiler.

The problem is, EXE file would be executed by the chip & not by the PC, hence giving any command line argument would need a connection between the chip & one of the ports on the PC.

Is there a way/mechanism by which I can give a command line argument during compile-time and not during the run-time?

Is there any functionality provided by the tool on these lines?

Regards,
Jinen.

Parents
  • What toolset?

    "I need to generate a number (a 4-digit Integer) and give it as a command line argument to my exe file generated by the cross compiler."

    For a start, none of the Keil tools generates exe files.
    exe files are specifically for execution on the PC; Keil tools generate image files to be loaded (somehow) into target hardware and run there - not on the PC.

    "The problem is, EXE file would be executed by the chip & not by the PC, hence giving any command line argument would need a connection between the chip & one of the ports on the PC."

    An RS232 link is a very common way to interface a PC to an embedded system.
    All sorts of other interfaces are also possible to control the embedded system, including keypads, buttons, etc, etc


    "Is there a way/mechanism by which I can give a command line argument during compile-time and not during the run-time?"

    If you give it at compile time, it becomes a fixed part of the generated code - so it can hardly be called an "argument"
    What exactly do you mean?

    Perhaps if you described what you're actually trying to achieve we could come up with some suggestions as to how to achieve that...?

Reply
  • What toolset?

    "I need to generate a number (a 4-digit Integer) and give it as a command line argument to my exe file generated by the cross compiler."

    For a start, none of the Keil tools generates exe files.
    exe files are specifically for execution on the PC; Keil tools generate image files to be loaded (somehow) into target hardware and run there - not on the PC.

    "The problem is, EXE file would be executed by the chip & not by the PC, hence giving any command line argument would need a connection between the chip & one of the ports on the PC."

    An RS232 link is a very common way to interface a PC to an embedded system.
    All sorts of other interfaces are also possible to control the embedded system, including keypads, buttons, etc, etc


    "Is there a way/mechanism by which I can give a command line argument during compile-time and not during the run-time?"

    If you give it at compile time, it becomes a fixed part of the generated code - so it can hardly be called an "argument"
    What exactly do you mean?

    Perhaps if you described what you're actually trying to achieve we could come up with some suggestions as to how to achieve that...?

Children
No data