Executing CodeWarrior app from command line - DEMO9S12XEP100

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Executing CodeWarrior app from command line - DEMO9S12XEP100

1,034 Views
pabloestebancam
Contributor II

Hi, All.

I am working with a DEMO9S12XEP100, and using CodeWarrior 5.1 as IDE.

For the project specifications, I cannot upgrade to a more recent version of CodeWarrior: must be 5.1.

I need to:

- execute one application from command line.

- passing parameters to that applications.

The requirement is just like we do it in high level programming. For instance: my_app.exe param1 param2

My question:

Could this be done using CodeWarrior and, if possible, could you advise me how to do it?

Is it possible to pass parameters to main() function just like we do it in high level programming: "main (int argc, char** argv)" ?

One of my doubts is that I cannot figure out which kind of interface should I use, since we do not have the command line api like in Linux or Windows (I am not thinking in a GUI).

 

Thanks in advance for your help!

 

PC.

Labels (1)
0 Kudos
2 Replies

727 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi PC.

The command line executable are located in the installation PROG directory.

            The HCS12 compiler is called CHC12.exe

            The HCS12 assembler is called AHC12.exe

            The HCS12 linker is called linker.exe

The Burner unit called burner.exe. This tool can be used to generate a S record file.

To generate an object library use libmaker.exe

While using our tools in batch mode, we would advise you to avoid any use of space in directory specification.

the HC12 compiler can be run in batchmode. That’s to say, we can put the compile command into a .bat file. And run .bat file in command line mode.

To have a project that will compile from different locations and for multiple users, we advise you to use a project.ini file while starting or calling our tools. This will give you a calling chain like following:

drive:\{CW install directory}\prog\maker.exe -Prod="path to project root"

If -Prod only option is used, the current directory is the directory the project file (project.ini) is in.

If -Prod option is used with a directory, the project.ini file in this directory is loaded.

If -Prod option is used with a directory and a project file (for example pro.ini), pro.ini file in this directory is loaded.

Please also refer to attached technical note tn100 for more detailed information.

you can also check The HC12 makefile sample code can be found in

{your CW install directory}\(CodeWarrior_Examples)\MakeFileSample_HC12.

This sample code is available for all HC(S)12 derivatives and can work under command line

In the sample code, you need change INSTALL PATH in build.bat, corresponding to your own CW installation. NOTE: blank character is forbidden for path!

Attachment is TN83 on how to use the Make utility. Please FYI.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

727 Views
pabloestebancam
Contributor II

Excellent answer, Zhang Jun! Thanks to you very much!

What about passing parameters to main() function from command line?

I will appreciate so much your comments!

Thanks again in advance!

Pablo.

0 Kudos