TI PRU C/C++ CODE GENERATION TOOLS 2.1.3 September 2016 =============================================================================== Contents: 1. Features 2. Changes from previous releases 3. Example usage 4. Common options 5. Linking with an ARM executable 6. Assembly language 7. Calling Convention 8. Language extensions 9. Sections in the linker command file =============================================================================== Features 1. Full support of C/C++. 2. Generates ELF relocatable object files and executables. 3. Complete support of the PRU instruction sets (v0, v1, v2, v3). 4. Constant table accesses from C 5. Intrinsics for XFER instructions in C 6. Little and big endian modes =============================================================================== Changes from 1.1.0B1 1. __delay_cycles intrinsic 2. Boot routine specialization to reduce code size 3. Generation of the LOOP instruction from C 4. Improved performance when accessing cregister symbols 5. Improved support for -o4 6. Improved disassembler output 7. Addition of near and far data qualifiers =============================================================================== Changes from 1.0.0B1 1. Performance improvements 2. Big endian support 3. Ability to link with an ARM executable 4. New support for accessing the constant table registers from C =============================================================================== Example Usage If installed with the default options, the C compiler will get installed at below path C:\Program Files (x86)\Texas Instruments\PRU Code Generation Tools 1.1.0B1 The first thing you need to do is add the bin folder of the toolchain in your path. If working from a Dos command window, type: set path=%path%;C:\Program Files (x86)\Texas Instruments\PRU Code Generation Tools 1.1.0B1 An example command line for compiling/linking your code for PRU0 of the AM335x: clpru --silicon_version=3 -o1 main.c tests.c -z AM3359_PRU.cmd -o PRU_tests.out -m PRU_tests.map If you have CCS 6.0 you should be able to load the executable using the CCS loader. If the version of CCS you have does not support direct loading, please follow the steps below. The next step is to generate the data and program binary files for loading in CCS debugger: hexpru bin.cmd PRU_tests.out This generates 2 files: data.bin (containing the data sections) and text.bin (containing the .text sections). The example AM3359_PRU.cmd and bin.cmd files are included in this directory for reference. In Code Composer Studio, connect to PRU0 of the AM3359. In the Memory Browser, R-click -> Load memory. Select text.bin then click on Next. Select: - Start address 0 - Memory page: Program_Memory - Type-size: 32-bits Click on Finish. Code sections get loaded in the PRU program memory. In the Memory Browser, R-click -> Load memory. Select data.bin then click on Next. Select: - Start address 0 - Memory page: Data_Memory - Type-size: 32-bits Click on Finish. Data sections get loaded in the PRU data memory. You are ready for code execution. Launch from PC = _c_int00 address Note: the address of labels in the linker generated map file are 8-bit addresses. So to get the real address to be used/observed in CCS debugger - 32-bit -, you need to divide this address by 4. =============================================================================== Common options A list of all compiler options can be obtained with clpru --help. To get detailed information about an option run clpru