NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on The site is now set to read only.


From Texas Instruments Wiki
Jump to: navigation, search

Content is no longer maintained and is being kept for reference only!
For the most up to date PRU-ICSS collateral click here

^ Up to main Programmable Realtime Unit Software Development Table of Contents

This arcticle is part of a collection of articles describing software development on the PRU subsystem included in OMAP-L1x8/C674m/AM18xx devices (where m is an even number).  To navigate to the main PRU software development page click on the link above.

Assembler Use and Overview

PASM is a command line driven assembler for the Programmable Real-time execution unit (PRU) of the Programmable Real-time Unit Subsystem (PRUSS). It is designed to build single executable images using a flexible source code syntax and a variety of output options. PASM is available for Windows and Linux.

Calling Syntax

The command line syntax to PASM is:

    pasm [-bBcmldexz] SourceFile [OutFileBasename] [-Dname=value] [-CArrayName]

Note that only the source file SourceFile is required on the command line. The assembler will default to output option "-c" which generates a C array containing the binary opcode data. The majority of the option flags select a variety of output formats.

The output file OutFileBasename is a base name only. It defaults to the same name as the source file (for example "myprog.p" would have a default base name of "myprog". Standard filename extensions are applied to the base name to create the final output filename(s), depending on the output option(s) selected.

When specifying PASM options, options can be specified individually or as a group. For example, either of the two invocations below is valid:

    pasm –cdl myprog.p
    pasm –c –d -l myprog.p

Also filenames and options can be mixed for example:

    pasm myprog.p -cdl
    pasm –cd myprog.p –DMYVAL=1 -l 

Output Formats

All program images start at Programmable Realtime Unit (PRU) address 0. For example, if a program has an internal origin of 8, the first eight 32 bit words of the program image output will be zero.

The following output options are supported. The output file name shown in the table is generated assuming a base name of "myprog":

Command Line Option Output Format Output Filename
-b Little endian binary file myprog.bin
-c C include file containing unsigned long array called PDSPcode[]* myprog_bin.h
-m Image file containing one 32 bit hex opcode per line myprog.img
-l Listing file containing the source code and generated opcodes myprog.lst
-d pView debugger output file (opcodes with source and label info) myprog.dbg
*The name "PDSPcode[]" can be redefined using the –C option.

Additional Options

PASM supports some additional command line options that are not associated with output file format:

Command Line Option Function
-C Rename the code array declared when using the –c option
-D Constant definition
-x Force legacy behavior
-z Enable debug output

Rename the Code Array for the –c Option

By default, the –c option will create an output file with a name ending in "_bin.h". Inside this created include file, the output code is defined as a C array of 32 bit values. The default name of the array is "PDSPcode[]". The –C option allows the user to redefine this name to something more appropriate. For example the following command line will create an output file named "myprog_bin.h", and the C array inside the created file will be called "MyProg_Release_003a[]".

   pasm –c myprog.p –CMyProg_Release_003a

Constant Definitions

When the "-D" option is specified, the remaining command line argument is interpreted as a constant assignment. For example, to add an assignment "1" to the constant "MYVAL", any of the following is valid:

   pasm –cdl myprog.p –DMYVAL=1
   pasm –c –d -l –DMYVAL=1 myprog.p
   pasm myprog.p –cdlDMYVAL=1

Since the default value assigned to a constant is "1", the following is also equivalent:

   pasm –c –d -l –DMYVAL myprog.p

Note that constants defined on the command line do not override constants defined in the source code.

Return to Main Page on PRU Software Development

Click here.