Command line tools

This section describes the usage the commandline tools installed with ppci.

Take for example the stm32f4 blinky project. To build this project, run ppci-build.py in the project folder:

$ cd examples/blinky
$ ppci-build.py

This command is used to construct build files.

Or specify the buildfile a the command line:

$ ppci-build.py -f examples/blinky/build.xml

Instead of relying on a build system, the c3 compiler can also be activated stand alone.

$ ppci-c3c.py --machine arm examples/snake/game.c3

ppci-c3c.py

C3 compiler. Use this compiler to produce object files from c3 sources and c3 includes. C3 includes have the same format as c3 source files, but do not result in any code.

usage: ppci-c3c.py [-h] [–log log-level] [–report report-file] [–verbose] [–version] –machine {6500,arm,avr,example,msp430,riscv,x86_64} [–mtune option] –output output-file [-i include] [-g] [-O {0,1,2,s}] source [source ...]

source

source file

-h, --help

show this help message and exit

--log <log-level>

Log level (info,debug,warn)

--report

Specify a file to write the compile report to

--verbose, -v

Increase verbosity of the output

--version, -V

Display version and exit

--machine, -m

target architecture

--mtune <option>

architecture option

--output, -o

output file

-i <include>, --include <include>

include file

-g

create debug information

-O {0,1,2,s}

optimize code

ppci-build.py

Build utility. Use this to execute build files.

usage: ppci-build.py [-h] [–log log-level] [–report report-file] [–verbose] [–version] [-f build-file] [target [target ...]]

target
-h, --help

show this help message and exit

--log <log-level>

Log level (info,debug,warn)

--report

Specify a file to write the compile report to

--verbose, -v

Increase verbosity of the output

--version, -V

Display version and exit

-f <build-file>, --buildfile <build-file>

use buildfile, otherwise build.xml is the default

ppci-asm.py

Assembler utility.

usage: ppci-asm.py [-h] [–log log-level] [–report report-file] [–verbose] [–version] –machine {6500,arm,avr,example,msp430,riscv,x86_64} [–mtune option] –output output-file [-g] sourcefile

sourcefile

the source file to assemble

-h, --help

show this help message and exit

--log <log-level>

Log level (info,debug,warn)

--report

Specify a file to write the compile report to

--verbose, -v

Increase verbosity of the output

--version, -V

Display version and exit

--machine, -m

target architecture

--mtune <option>

architecture option

--output, -o

output file

-g, --debug

create debug information

ppci-ld.py

Linker. Use the linker to combine several object files and a memory layout to produce another resulting object file with images.

usage: ppci-ld.py [-h] [–log log-level] [–report report-file] [–verbose] [–version] –output output-file [–layout layout-file] [-g] obj [obj ...]

obj

the object to link

-h, --help

show this help message and exit

--log <log-level>

Log level (info,debug,warn)

--report

Specify a file to write the compile report to

--verbose, -v

Increase verbosity of the output

--version, -V

Display version and exit

--output, -o

output file

--layout <layout-file>, -L <layout-file>

memory layout

-g

retain debug information

ppci-objcopy.py

Objcopy utility to manipulate object files.

usage: ppci-objcopy.py [-h] [–log log-level] [–report report-file] [–verbose] [–version] –segment SEGMENT [–output-format OUTPUT_FORMAT] input output

input

input file

output

output file

-h, --help

show this help message and exit

--log <log-level>

Log level (info,debug,warn)

--report

Specify a file to write the compile report to

--verbose, -v

Increase verbosity of the output

--version, -V

Display version and exit

--segment <segment>, -S <segment>

segment to copy

--output-format <output_format>, -O <output_format>

output file format

ppci-objdump.py

Objdump utility to display the contents of object files.

usage: ppci-objdump.py [-h] [–log log-level] [–report report-file] [–verbose] [–version] [-d] obj

obj

object file

-h, --help

show this help message and exit

--log <log-level>

Log level (info,debug,warn)

--report

Specify a file to write the compile report to

--verbose, -v

Increase verbosity of the output

--version, -V

Display version and exit

-d, --disassemble

Disassemble contents