Building CodeWarrior 10 Projects from Command Line

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

Building CodeWarrior 10 Projects from Command Line

6,964 Views
jimfell
Contributor III

I'm having a little trouble building my CodeWarrior 10 projects from the command line.  I'm looking at the document "CodeWarrior Development Studio for Microcontrollers V10.x ColdFire Architectures Build Tools Reference Manual," but what it really needs is some good examples for invoking the compiler and linker.  So far, this is what my batch script looks like:

 

@ECHO OFF

SET PROJECT_DIR=.
SET WORKSPACE_DIR=%PROJECT_DIR%\..
SET EMBEDDED_DIR=%WORKSPACE_DIR%\..\..\..
SET CWFolder="C:\Program Files\Freescale\CW MCU v10.2"
SET PATH=%PATH%\%CWFolder%\MCW\bin;%CWFolder%\MCU\ColdFire_Tools\Command_Line_Tools

SET MWCIncludes=%CWFolder%\ColdFire_Support\ewl\EWL_C\Include
SET MWCIncludes=%MWCIncludes%;%CWFolder%\ColdFire_Support\ewl\EWL_C++\Include
SET MWCIncludes=%MWCIncludes%;%CWFolder%\ColdFire_Support\ewl\EWL_C\Include\sys
SET MWCIncludes=%MWCIncludes%;%EMBEDDED_DIR%\Libs\Private\Includes
SET MWCIncludes=%MWCIncludes%;%EMBEDDED_DIR%\Libs\Public\Includes
SET MWCIncludes=%MWCIncludes%;%EMBEDDED_DIR%\Shared\Includes
SET MWLibraries=%CWFolder%\MCU\ColdFire_Suppport\ewl\lib

 

SET COMPILE_ARGS="-sym full -msgstyle parseable -proc 51JMe -lavender model=ewl ,print=int ,scan=int ,io=raw -c -nostdinc -nosyspath -enc ascii -i "C:\Users\jim.fell\Source\Embedded\Libs\Make\cw10\CSLock_MCF51JM/Project_Headers" -i "C:\Users\jim.fell\Source\Embedded\Libs\Make\cw10\CSLock_MCF51JM/Project_Settings/Startup_Code" -i "C:\Users\jim.fell\Source\Embedded\Libs\Make\cw10/../../Private/Includes" -i "C:\Users\jim.fell\Source\Embedded\Libs\Make\cw10/../../Public/Includes" -i "C:\Users\jim.fell\Source\Embedded\Libs\Make\cw10/../../../Shared/Includes" -i "C:\Program Files\Freescale\CW MCU v10.2\eclipse\../MCU/ColdFire_Support/hcs08_compatibility" -i "C:\Program Files\Freescale\CW MCU v10.2\eclipse\../MCU/ColdFire_Support/ewl/EWL_C/include" -i "C:\Program Files\Freescale\CW MCU v10.2\eclipse\../MCU/ColdFire_Support/ewl/EWL_C/include/sys" -i "C:\Program Files\Freescale\CW MCU v10.2\eclipse\../MCU/ColdFire_Support/ewl/EWL_Runtime/Runtime_ColdFire/Source" -i "C:\Program Files\Freescale\CW MCU v10.2\eclipse\../MCU/ColdFire_Support/derivatives/device/include" -i "C:\Program Files\Freescale\CW MCU v10.2\eclipse\../MCU/ColdFire_Support/derivatives/device/asm_include" -warn illpragmas -warn unwanted -warn extended -warn hidevirtual -warn implicitconv -warn unusedarg -warn unusedvar -warn extracomma -warn emptydecl -warn structclass -opt level=0 -opt space -inline on -align coldfire -model nearRelCode -model farData -fp soft -nocoloring -noscheduling -nopeephole -sdata all -requireprotos -bool off -Cpp_Exceptions off -RTTI off -char unsigned -str nopool -str reuse -ipa off -define CONSOLE_IO_SUPPORT=1"

SET LINKER_ARGS="-sym full -msgstyle parseable -proc 51JMe -lavender model=ewl ,print=int ,scan=int ,io=raw -nostdlib "C:\Users\jim.fell\Source\Embedded\Libs\Make\cw10\CSLock_MCF51JM/Project_Settings/Linker_Files/Project.lcf" -m __startup -L"C:\Program Files\Freescale\CW MCU v10.2\eclipse\../MCU/ColdFire_Support/ewl/lib" -library -map -map keep -srec -sreclength 252 -sreceol dos -w on"

 

ECHO Beginning compile . . .
mwccmcf.exe %COMPILE_ARGS%

 

IF NOT %ERRORLEVEL%==0 GOTO END

 

ECHO Beginning link . . .
mwldmcf.exe %LINKER_ARGS%

 

:END

 

 

 

However, I'm getting an error that I really don't know what to do wth:

 

Beginning compile . . .
### mwccmcf.exe Driver Error:
#   Cannot find my executable 'mwccmcf.exe'
### mwccmcf.exe Usage Error:
#   Unknown option 'sym full -msgstyle parseable -proc 51JMe -lavender model'

Errors caused tool to abort.

 

Any ideas?  Also, I've noticed that when my project compiles in CW the first command to launch is this mingw32-make:

 

C:\Program Files\Freescale\CW MCU v10.2\gnu\bin\mingw32-make -j16 all

 

Where do I find the documenation for this, and how do I use it?  Thanks.

Labels (1)
6 Replies

2,966 Views
Monica
Senior Contributor III

Hey Jimfell!

How is the project going? Were you able to solve the issues?

Regards!

0 Kudos

2,966 Views
jimfell
Contributor III

No.  It seems that the process for building CodeWarrior 10 projects from the command line is very complex, and this problem is low priority for me right now.  In most IDEs that I've used it's not nearly so problematic--just run an executable with the project or makefile as an argument.  The project settings are used to generate the target output.  It's very simple.  The IDE never launches and everything builds from the command line.  It would be nice to at least get an example that shows the minimal necessary steps to build a CW10 project from the command line.

2,966 Views
BlackNight
NXP Employee
NXP Employee

That error simply says that it cannot find the compiler executable. You need to provide the path to it in the batch file (either in the command, or adding it to the PATH variable).

I suggest that you use a make file instead of a batch file. How this could be done, maybe have a look at

Make my Make with Eclipse and MCU10 | MCU on Eclipse

mingw32 is such a make utility, which comes with the minGW GNU tool collection (MinGW - Wikipedia, the free encyclopedia).

See as well GeneralUsageInstructions – mingw-w64.

Hope this helps,

Erich

0 Kudos

2,966 Views
jimfell
Contributor III

Hi Erich.  Thanks.  I can generate the make file from within the CW10 IDE, but how do I use it to build, from the command line, the firmware image to be loaded onto my target?

0 Kudos

2,966 Views
BlackNight
NXP Employee
NXP Employee

Hi Jim,

you can build things with the make file, both within the IDE, and as well from a DOS shell.

For the debugger, simply use the TCL shell, see

Standalone Flash Programmer | MCU on Eclipse

And this one shows how you flash the device from a DOS shell as well:

CodeWarrior Flash Programming from a DOS Shell | MCU on Eclipse

Hope this helps,

Erich

0 Kudos

2,968 Views
BlackNight
NXP Employee
NXP Employee

Oh, and I missed to mention the thing about ecd.exe: that allows you to run (and build with) Eclipse from the DOS command prompt too, e.g.

"C:\Freescale\CW MCU v10.2\eclipse\ecd.exe" -build -verbose -cleanall -data E:/CFProjects/WORKSPACE -project E:/CFProjects/WORKSPACE/FOO -config MCF52255_Internal_Flash

So with this (and above), you can build/debug/script/download from a DOS shell.

Erich

0 Kudos