This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM263P4: PRU Register Init when compiling from c-code

Part Number: AM263P4

Tool/software:

While experimenting with some basic data transfer functionality between PRU_0 and R5FSS0_0, I seem to be running into an issue that I have been unable to find an answer or reference.  I have a PRU project which successfully compiles down to a .hex file. That hex is brought into a project for R5FSS0, which is also responsible for starting up the PRU. At present, if I debug the PRU project by itself, all registers and RAM appear to update as expected.  However, if I initialize the the PRU from the R5FSS0, a value expected in R2 of the PRU doesn't get set correctly at startup and the code doesn't execute correctly.  How do I make sure that the values that the generated hex code expects to be set in the PRU registers get populated correctly when the PRU is initialized by R5FSS0?

PRU c-code:

#include <stdint.h>

/* TODO: define c */
/* a, b, and c are stored in a defined location in PRU memory */
#define a  (*((volatile unsigned int *)0x110))
#define b  (*((volatile unsigned int *)0x114))


void main(void)
{
    /* TODO: define y & z */
    /* The compiler decides where to store x, y, and z */
    uint32_t x = 1;

    a = 1;
    b = 0;

    while(1) {
        /*
         * TODO: store the sum of x and y in z
         */
        x = x + 1;
        if (2000000 <= x){
            x = 0;
            if (1 == a){
                a = 0;
                b = 1;
            } else {
                a = 1;
                b = 0;
            }
        }

        /*
         * TODO: store the sum of the numbers at memory locations a and
         * b in memory location c
         */
    }

    /* This program will not reach __halt because of the while loop */
    __halt();
}

PRU generated assembly:

;******************************************************************************
;* PRU C/C++ Codegen                                                PC v2.3.3 *
;* Date/Time created: Fri Jan 24 17:15:02 2025                                *
;******************************************************************************
	.compiler_opts --abi=eabi --diag_wrap=off --endian=little --hll_source=on --object_format=elf --silicon_version=3 --symdebug:dwarf --symdebug:dwarf_version=3 

$C$DW$CU	.dwtag  DW_TAG_compile_unit
	.dwattr $C$DW$CU, DW_AT_name("../main.c")
	.dwattr $C$DW$CU, DW_AT_producer("TI PRU C/C++ Codegen PC v2.3.3 Copyright (c) 2012-2018 Texas Instruments Incorporated")
	.dwattr $C$DW$CU, DW_AT_TI_version(0x01)
	.dwattr $C$DW$CU, DW_AT_comp_dir("C:\Software\50019F-HCS\50019F-COD001_System_Project\50019F-COD005_PRU_0_Project\Debug")
;	C:\ti\ti-cgt-pru_2.3.3\bin\acpiapru.exe -@C:\\Users\\nathano\\AppData\\Local\\Temp\\{66DEDE50-7C18-468D-ABF7-E78120A562F0} 
	.sect	".text:main"
	.clink
	.global	||main||

$C$DW$1	.dwtag  DW_TAG_subprogram
	.dwattr $C$DW$1, DW_AT_name("main")
	.dwattr $C$DW$1, DW_AT_low_pc(||main||)
	.dwattr $C$DW$1, DW_AT_high_pc(0x00)
	.dwattr $C$DW$1, DW_AT_TI_symbol_name("main")
	.dwattr $C$DW$1, DW_AT_external
	.dwattr $C$DW$1, DW_AT_TI_begin_file("../main.c")
	.dwattr $C$DW$1, DW_AT_TI_begin_line(0x0f)
	.dwattr $C$DW$1, DW_AT_TI_begin_column(0x06)
	.dwattr $C$DW$1, DW_AT_decl_file("../main.c")
	.dwattr $C$DW$1, DW_AT_decl_line(0x0f)
	.dwattr $C$DW$1, DW_AT_decl_column(0x06)
	.dwattr $C$DW$1, DW_AT_TI_max_frame_size(0x04)
	.dwpsn	file "../main.c",line 16,column 1,is_stmt,address ||main||,isa 0

	.dwfde $C$DW$CIE, ||main||

;***************************************************************
;* FNAME: main                          FR SIZE:   4           *
;*                                                             *
;* FUNCTION ENVIRONMENT                                        *
;*                                                             *
;* FUNCTION PROPERTIES                                         *
;*                            4 Auto,  0 SOE     *
;***************************************************************

||main||:
;* --------------------------------------------------------------------------*
	.dwcfi	cfa_offset, 0
        SUB       r2, r2, 0x04          ; [] 
	.dwcfi	cfa_offset, 4
$C$DW$2	.dwtag  DW_TAG_variable
	.dwattr $C$DW$2, DW_AT_name("x")
	.dwattr $C$DW$2, DW_AT_TI_symbol_name("x")
	.dwattr $C$DW$2, DW_AT_type(*$C$DW$T$22)
	.dwattr $C$DW$2, DW_AT_location[DW_OP_breg8 0]

	.dwpsn	file "../main.c",line 19,column 16,is_stmt,isa 0
        LDI       r14, 0x0001           ; [] |19| 
        SBBO      &r14, r2, 0, 4        ; [] |19| x
	.dwpsn	file "../main.c",line 21,column 5,is_stmt,isa 0
        LDI       r15, 0x0110           ; [] |21| 
        SBBO      &r14, r15, 0, 4       ; [] |21| 
	.dwpsn	file "../main.c",line 22,column 5,is_stmt,isa 0
        LDI       r0, 0x0000            ; [] |22| 
        LDI       r1, 0x0114            ; [] |22| 
        SBBO      &r0, r1, 0, 4         ; [] |22| 
	.dwpsn	file "../main.c",line 24,column 11,is_stmt,isa 0
;* --------------------------------------------------------------------------*
;*   BEGIN LOOP ||$C$L1||
;*
;*   Loop source line                : 24
;*   Loop closing brace source line  : 44
;*   Known Minimum Trip Count        : 1
;*   Known Maximum Trip Count        : 4294967295
;*   Known Max Trip Count Factor     : 1
;* --------------------------------------------------------------------------*
||$C$L1||:    
	.dwpsn	file "../main.c",line 28,column 9,is_stmt,isa 0
        LBBO      &r16, r2, 0, 4        ; [] |28| x
        ADD       r16, r16, 0x01        ; [] |28| 
        SBBO      &r16, r2, 0, 4        ; [] |28| x
	.dwpsn	file "../main.c",line 29,column 9,is_stmt,isa 0
        LDI32     r17, 0x001e8480       ; [] |29| 
        QBGT      ||$C$L1||, r16, r17   ; [] |29| 
;* --------------------------------------------------------------------------*
	.dwpsn	file "../main.c",line 30,column 13,is_stmt,isa 0
        SBBO      &r0, r2, 0, 4         ; [] |30| x
	.dwpsn	file "../main.c",line 31,column 13,is_stmt,isa 0
        LBBO      &r16, r15, 0, 4       ; [] |31| 
        QBNE      ||$C$L2||, r16, 0x01  ; [] |31| 
;* --------------------------------------------------------------------------*
	.dwpsn	file "../main.c",line 32,column 17,is_stmt,isa 0
        MOV       r16, r0               ; [] 
        MOV       r17, r15              ; [] 
        SBBO      &r16, r17, 0, 4       ; [] |32| 
	.dwpsn	file "../main.c",line 33,column 17,is_stmt,isa 0
        SBBO      &r14, r1, 0, 4        ; [] |33| 
	.dwpsn	file "../main.c",line 34,column 13,is_stmt,isa 0
        JMP       ||$C$L1||             ; [] |34| 
;* --------------------------------------------------------------------------*
||$C$L2||:    
	.dwpsn	file "../main.c",line 35,column 17,is_stmt,isa 0
        MOV       r16, r15              ; [] 
        SBBO      &r14, r16, 0, 4       ; [] |35| 
	.dwpsn	file "../main.c",line 36,column 17,is_stmt,isa 0
        MOV       r16, r0               ; [] 
        SBBO      &r16, r1, 0, 4        ; [] |36| 
	.dwpsn	file "../main.c",line 24,column 11,is_stmt,isa 0
        JMP       ||$C$L1||             ; [] |24| 
;* --------------------------------------------------------------------------*
	.dwattr $C$DW$1, DW_AT_TI_end_file("../main.c")
	.dwattr $C$DW$1, DW_AT_TI_end_line(0x30)
	.dwattr $C$DW$1, DW_AT_TI_end_column(0x01)
	.dwendentry
	.dwendtag $C$DW$1


;******************************************************************************
;* TYPE INFORMATION                                                           *
;******************************************************************************
$C$DW$T$2	.dwtag  DW_TAG_unspecified_type
	.dwattr $C$DW$T$2, DW_AT_name("void")

$C$DW$T$4	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$4, DW_AT_encoding(DW_ATE_boolean)
	.dwattr $C$DW$T$4, DW_AT_name("bool")
	.dwattr $C$DW$T$4, DW_AT_byte_size(0x01)

$C$DW$T$5	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$5, DW_AT_encoding(DW_ATE_signed_char)
	.dwattr $C$DW$T$5, DW_AT_name("signed char")
	.dwattr $C$DW$T$5, DW_AT_byte_size(0x01)

$C$DW$T$6	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$6, DW_AT_encoding(DW_ATE_unsigned_char)
	.dwattr $C$DW$T$6, DW_AT_name("unsigned char")
	.dwattr $C$DW$T$6, DW_AT_byte_size(0x01)

$C$DW$T$7	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$7, DW_AT_encoding(DW_ATE_signed_char)
	.dwattr $C$DW$T$7, DW_AT_name("wchar_t")
	.dwattr $C$DW$T$7, DW_AT_byte_size(0x04)

$C$DW$T$8	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$8, DW_AT_encoding(DW_ATE_signed)
	.dwattr $C$DW$T$8, DW_AT_name("short")
	.dwattr $C$DW$T$8, DW_AT_byte_size(0x02)

$C$DW$T$9	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$9, DW_AT_encoding(DW_ATE_unsigned)
	.dwattr $C$DW$T$9, DW_AT_name("unsigned short")
	.dwattr $C$DW$T$9, DW_AT_byte_size(0x02)

$C$DW$T$10	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$10, DW_AT_encoding(DW_ATE_signed)
	.dwattr $C$DW$T$10, DW_AT_name("int")
	.dwattr $C$DW$T$10, DW_AT_byte_size(0x04)

$C$DW$T$11	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$11, DW_AT_encoding(DW_ATE_unsigned)
	.dwattr $C$DW$T$11, DW_AT_name("unsigned int")
	.dwattr $C$DW$T$11, DW_AT_byte_size(0x04)

$C$DW$T$22	.dwtag  DW_TAG_typedef
	.dwattr $C$DW$T$22, DW_AT_name("uint32_t")
	.dwattr $C$DW$T$22, DW_AT_type(*$C$DW$T$11)
	.dwattr $C$DW$T$22, DW_AT_language(DW_LANG_C)
	.dwattr $C$DW$T$22, DW_AT_decl_file("C:/ti/ti-cgt-pru_2.3.3/include/stdint.h")
	.dwattr $C$DW$T$22, DW_AT_decl_line(0x41)
	.dwattr $C$DW$T$22, DW_AT_decl_column(0x1c)

$C$DW$T$12	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$12, DW_AT_encoding(DW_ATE_signed)
	.dwattr $C$DW$T$12, DW_AT_name("long")
	.dwattr $C$DW$T$12, DW_AT_byte_size(0x04)

$C$DW$T$13	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$13, DW_AT_encoding(DW_ATE_unsigned)
	.dwattr $C$DW$T$13, DW_AT_name("unsigned long")
	.dwattr $C$DW$T$13, DW_AT_byte_size(0x04)

$C$DW$T$14	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$14, DW_AT_encoding(DW_ATE_signed)
	.dwattr $C$DW$T$14, DW_AT_name("long long")
	.dwattr $C$DW$T$14, DW_AT_byte_size(0x08)

$C$DW$T$15	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$15, DW_AT_encoding(DW_ATE_unsigned)
	.dwattr $C$DW$T$15, DW_AT_name("unsigned long long")
	.dwattr $C$DW$T$15, DW_AT_byte_size(0x08)

$C$DW$T$16	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$16, DW_AT_encoding(DW_ATE_float)
	.dwattr $C$DW$T$16, DW_AT_name("float")
	.dwattr $C$DW$T$16, DW_AT_byte_size(0x04)

$C$DW$T$17	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$17, DW_AT_encoding(DW_ATE_float)
	.dwattr $C$DW$T$17, DW_AT_name("double")
	.dwattr $C$DW$T$17, DW_AT_byte_size(0x08)

$C$DW$T$18	.dwtag  DW_TAG_base_type
	.dwattr $C$DW$T$18, DW_AT_encoding(DW_ATE_float)
	.dwattr $C$DW$T$18, DW_AT_name("long double")
	.dwattr $C$DW$T$18, DW_AT_byte_size(0x08)

	.dwattr $C$DW$CU, DW_AT_language(DW_LANG_C)

;***************************************************************
;* DWARF CIE ENTRIES                                           *
;***************************************************************

$C$DW$CIE	.dwcie 14
	.dwcfi	cfa_register, 8
	.dwcfi	cfa_offset, 0
	.dwcfi	same_value, 8
	.dwcfi	same_value, 9
	.dwcfi	same_value, 10
	.dwcfi	same_value, 11
	.dwcfi	same_value, 16
	.dwcfi	same_value, 17
	.dwcfi	same_value, 18
	.dwcfi	same_value, 19
	.dwcfi	same_value, 20
	.dwcfi	same_value, 21
	.dwcfi	same_value, 22
	.dwcfi	same_value, 23
	.dwcfi	same_value, 24
	.dwcfi	same_value, 25
	.dwcfi	same_value, 26
	.dwcfi	same_value, 27
	.dwcfi	same_value, 28
	.dwcfi	same_value, 29
	.dwcfi	same_value, 30
	.dwcfi	same_value, 31
	.dwcfi	same_value, 32
	.dwcfi	same_value, 33
	.dwcfi	same_value, 34
	.dwcfi	same_value, 35
	.dwcfi	same_value, 36
	.dwcfi	same_value, 37
	.dwcfi	same_value, 38
	.dwcfi	same_value, 39
	.dwcfi	same_value, 40
	.dwcfi	same_value, 41
	.dwcfi	same_value, 42
	.dwcfi	same_value, 43
	.dwcfi	same_value, 44
	.dwcfi	same_value, 45
	.dwcfi	same_value, 46
	.dwcfi	same_value, 47
	.dwcfi	same_value, 48
	.dwcfi	same_value, 49
	.dwcfi	same_value, 50
	.dwcfi	same_value, 51
	.dwcfi	same_value, 52
	.dwcfi	same_value, 53
	.dwcfi	same_value, 54
	.dwcfi	same_value, 55
	.dwendentry

;***************************************************************
;* DWARF REGISTER MAP                                          *
;***************************************************************

$C$DW$3	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$3, DW_AT_name("R0_b0")
	.dwattr $C$DW$3, DW_AT_location[DW_OP_reg0]

$C$DW$4	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$4, DW_AT_name("R0_b1")
	.dwattr $C$DW$4, DW_AT_location[DW_OP_reg1]

$C$DW$5	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$5, DW_AT_name("R0_b2")
	.dwattr $C$DW$5, DW_AT_location[DW_OP_reg2]

$C$DW$6	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$6, DW_AT_name("R0_b3")
	.dwattr $C$DW$6, DW_AT_location[DW_OP_reg3]

$C$DW$7	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$7, DW_AT_name("R1_b0")
	.dwattr $C$DW$7, DW_AT_location[DW_OP_reg4]

$C$DW$8	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$8, DW_AT_name("R1_b1")
	.dwattr $C$DW$8, DW_AT_location[DW_OP_reg5]

$C$DW$9	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$9, DW_AT_name("R1_b2")
	.dwattr $C$DW$9, DW_AT_location[DW_OP_reg6]

$C$DW$10	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$10, DW_AT_name("R1_b3")
	.dwattr $C$DW$10, DW_AT_location[DW_OP_reg7]

$C$DW$11	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$11, DW_AT_name("R2_b0")
	.dwattr $C$DW$11, DW_AT_location[DW_OP_reg8]

$C$DW$12	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$12, DW_AT_name("R2_b1")
	.dwattr $C$DW$12, DW_AT_location[DW_OP_reg9]

$C$DW$13	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$13, DW_AT_name("R2_b2")
	.dwattr $C$DW$13, DW_AT_location[DW_OP_reg10]

$C$DW$14	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$14, DW_AT_name("R2_b3")
	.dwattr $C$DW$14, DW_AT_location[DW_OP_reg11]

$C$DW$15	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$15, DW_AT_name("R3_b0")
	.dwattr $C$DW$15, DW_AT_location[DW_OP_reg12]

$C$DW$16	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$16, DW_AT_name("R3_b1")
	.dwattr $C$DW$16, DW_AT_location[DW_OP_reg13]

$C$DW$17	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$17, DW_AT_name("R3_b2")
	.dwattr $C$DW$17, DW_AT_location[DW_OP_reg14]

$C$DW$18	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$18, DW_AT_name("R3_b3")
	.dwattr $C$DW$18, DW_AT_location[DW_OP_reg15]

$C$DW$19	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$19, DW_AT_name("R4_b0")
	.dwattr $C$DW$19, DW_AT_location[DW_OP_reg16]

$C$DW$20	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$20, DW_AT_name("R4_b1")
	.dwattr $C$DW$20, DW_AT_location[DW_OP_reg17]

$C$DW$21	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$21, DW_AT_name("R4_b2")
	.dwattr $C$DW$21, DW_AT_location[DW_OP_reg18]

$C$DW$22	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$22, DW_AT_name("R4_b3")
	.dwattr $C$DW$22, DW_AT_location[DW_OP_reg19]

$C$DW$23	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$23, DW_AT_name("R5_b0")
	.dwattr $C$DW$23, DW_AT_location[DW_OP_reg20]

$C$DW$24	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$24, DW_AT_name("R5_b1")
	.dwattr $C$DW$24, DW_AT_location[DW_OP_reg21]

$C$DW$25	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$25, DW_AT_name("R5_b2")
	.dwattr $C$DW$25, DW_AT_location[DW_OP_reg22]

$C$DW$26	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$26, DW_AT_name("R5_b3")
	.dwattr $C$DW$26, DW_AT_location[DW_OP_reg23]

$C$DW$27	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$27, DW_AT_name("R6_b0")
	.dwattr $C$DW$27, DW_AT_location[DW_OP_reg24]

$C$DW$28	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$28, DW_AT_name("R6_b1")
	.dwattr $C$DW$28, DW_AT_location[DW_OP_reg25]

$C$DW$29	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$29, DW_AT_name("R6_b2")
	.dwattr $C$DW$29, DW_AT_location[DW_OP_reg26]

$C$DW$30	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$30, DW_AT_name("R6_b3")
	.dwattr $C$DW$30, DW_AT_location[DW_OP_reg27]

$C$DW$31	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$31, DW_AT_name("R7_b0")
	.dwattr $C$DW$31, DW_AT_location[DW_OP_reg28]

$C$DW$32	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$32, DW_AT_name("R7_b1")
	.dwattr $C$DW$32, DW_AT_location[DW_OP_reg29]

$C$DW$33	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$33, DW_AT_name("R7_b2")
	.dwattr $C$DW$33, DW_AT_location[DW_OP_reg30]

$C$DW$34	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$34, DW_AT_name("R7_b3")
	.dwattr $C$DW$34, DW_AT_location[DW_OP_reg31]

$C$DW$35	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$35, DW_AT_name("R8_b0")
	.dwattr $C$DW$35, DW_AT_location[DW_OP_regx 0x20]

$C$DW$36	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$36, DW_AT_name("R8_b1")
	.dwattr $C$DW$36, DW_AT_location[DW_OP_regx 0x21]

$C$DW$37	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$37, DW_AT_name("R8_b2")
	.dwattr $C$DW$37, DW_AT_location[DW_OP_regx 0x22]

$C$DW$38	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$38, DW_AT_name("R8_b3")
	.dwattr $C$DW$38, DW_AT_location[DW_OP_regx 0x23]

$C$DW$39	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$39, DW_AT_name("R9_b0")
	.dwattr $C$DW$39, DW_AT_location[DW_OP_regx 0x24]

$C$DW$40	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$40, DW_AT_name("R9_b1")
	.dwattr $C$DW$40, DW_AT_location[DW_OP_regx 0x25]

$C$DW$41	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$41, DW_AT_name("R9_b2")
	.dwattr $C$DW$41, DW_AT_location[DW_OP_regx 0x26]

$C$DW$42	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$42, DW_AT_name("R9_b3")
	.dwattr $C$DW$42, DW_AT_location[DW_OP_regx 0x27]

$C$DW$43	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$43, DW_AT_name("R10_b0")
	.dwattr $C$DW$43, DW_AT_location[DW_OP_regx 0x28]

$C$DW$44	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$44, DW_AT_name("R10_b1")
	.dwattr $C$DW$44, DW_AT_location[DW_OP_regx 0x29]

$C$DW$45	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$45, DW_AT_name("R10_b2")
	.dwattr $C$DW$45, DW_AT_location[DW_OP_regx 0x2a]

$C$DW$46	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$46, DW_AT_name("R10_b3")
	.dwattr $C$DW$46, DW_AT_location[DW_OP_regx 0x2b]

$C$DW$47	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$47, DW_AT_name("R11_b0")
	.dwattr $C$DW$47, DW_AT_location[DW_OP_regx 0x2c]

$C$DW$48	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$48, DW_AT_name("R11_b1")
	.dwattr $C$DW$48, DW_AT_location[DW_OP_regx 0x2d]

$C$DW$49	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$49, DW_AT_name("R11_b2")
	.dwattr $C$DW$49, DW_AT_location[DW_OP_regx 0x2e]

$C$DW$50	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$50, DW_AT_name("R11_b3")
	.dwattr $C$DW$50, DW_AT_location[DW_OP_regx 0x2f]

$C$DW$51	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$51, DW_AT_name("R12_b0")
	.dwattr $C$DW$51, DW_AT_location[DW_OP_regx 0x30]

$C$DW$52	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$52, DW_AT_name("R12_b1")
	.dwattr $C$DW$52, DW_AT_location[DW_OP_regx 0x31]

$C$DW$53	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$53, DW_AT_name("R12_b2")
	.dwattr $C$DW$53, DW_AT_location[DW_OP_regx 0x32]

$C$DW$54	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$54, DW_AT_name("R12_b3")
	.dwattr $C$DW$54, DW_AT_location[DW_OP_regx 0x33]

$C$DW$55	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$55, DW_AT_name("R13_b0")
	.dwattr $C$DW$55, DW_AT_location[DW_OP_regx 0x34]

$C$DW$56	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$56, DW_AT_name("R13_b1")
	.dwattr $C$DW$56, DW_AT_location[DW_OP_regx 0x35]

$C$DW$57	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$57, DW_AT_name("R13_b2")
	.dwattr $C$DW$57, DW_AT_location[DW_OP_regx 0x36]

$C$DW$58	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$58, DW_AT_name("R13_b3")
	.dwattr $C$DW$58, DW_AT_location[DW_OP_regx 0x37]

$C$DW$59	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$59, DW_AT_name("R14_b0")
	.dwattr $C$DW$59, DW_AT_location[DW_OP_regx 0x38]

$C$DW$60	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$60, DW_AT_name("R14_b1")
	.dwattr $C$DW$60, DW_AT_location[DW_OP_regx 0x39]

$C$DW$61	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$61, DW_AT_name("R14_b2")
	.dwattr $C$DW$61, DW_AT_location[DW_OP_regx 0x3a]

$C$DW$62	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$62, DW_AT_name("R14_b3")
	.dwattr $C$DW$62, DW_AT_location[DW_OP_regx 0x3b]

$C$DW$63	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$63, DW_AT_name("R15_b0")
	.dwattr $C$DW$63, DW_AT_location[DW_OP_regx 0x3c]

$C$DW$64	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$64, DW_AT_name("R15_b1")
	.dwattr $C$DW$64, DW_AT_location[DW_OP_regx 0x3d]

$C$DW$65	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$65, DW_AT_name("R15_b2")
	.dwattr $C$DW$65, DW_AT_location[DW_OP_regx 0x3e]

$C$DW$66	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$66, DW_AT_name("R15_b3")
	.dwattr $C$DW$66, DW_AT_location[DW_OP_regx 0x3f]

$C$DW$67	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$67, DW_AT_name("R16_b0")
	.dwattr $C$DW$67, DW_AT_location[DW_OP_regx 0x40]

$C$DW$68	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$68, DW_AT_name("R16_b1")
	.dwattr $C$DW$68, DW_AT_location[DW_OP_regx 0x41]

$C$DW$69	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$69, DW_AT_name("R16_b2")
	.dwattr $C$DW$69, DW_AT_location[DW_OP_regx 0x42]

$C$DW$70	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$70, DW_AT_name("R16_b3")
	.dwattr $C$DW$70, DW_AT_location[DW_OP_regx 0x43]

$C$DW$71	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$71, DW_AT_name("R17_b0")
	.dwattr $C$DW$71, DW_AT_location[DW_OP_regx 0x44]

$C$DW$72	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$72, DW_AT_name("R17_b1")
	.dwattr $C$DW$72, DW_AT_location[DW_OP_regx 0x45]

$C$DW$73	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$73, DW_AT_name("R17_b2")
	.dwattr $C$DW$73, DW_AT_location[DW_OP_regx 0x46]

$C$DW$74	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$74, DW_AT_name("R17_b3")
	.dwattr $C$DW$74, DW_AT_location[DW_OP_regx 0x47]

$C$DW$75	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$75, DW_AT_name("R18_b0")
	.dwattr $C$DW$75, DW_AT_location[DW_OP_regx 0x48]

$C$DW$76	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$76, DW_AT_name("R18_b1")
	.dwattr $C$DW$76, DW_AT_location[DW_OP_regx 0x49]

$C$DW$77	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$77, DW_AT_name("R18_b2")
	.dwattr $C$DW$77, DW_AT_location[DW_OP_regx 0x4a]

$C$DW$78	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$78, DW_AT_name("R18_b3")
	.dwattr $C$DW$78, DW_AT_location[DW_OP_regx 0x4b]

$C$DW$79	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$79, DW_AT_name("R19_b0")
	.dwattr $C$DW$79, DW_AT_location[DW_OP_regx 0x4c]

$C$DW$80	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$80, DW_AT_name("R19_b1")
	.dwattr $C$DW$80, DW_AT_location[DW_OP_regx 0x4d]

$C$DW$81	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$81, DW_AT_name("R19_b2")
	.dwattr $C$DW$81, DW_AT_location[DW_OP_regx 0x4e]

$C$DW$82	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$82, DW_AT_name("R19_b3")
	.dwattr $C$DW$82, DW_AT_location[DW_OP_regx 0x4f]

$C$DW$83	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$83, DW_AT_name("R20_b0")
	.dwattr $C$DW$83, DW_AT_location[DW_OP_regx 0x50]

$C$DW$84	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$84, DW_AT_name("R20_b1")
	.dwattr $C$DW$84, DW_AT_location[DW_OP_regx 0x51]

$C$DW$85	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$85, DW_AT_name("R20_b2")
	.dwattr $C$DW$85, DW_AT_location[DW_OP_regx 0x52]

$C$DW$86	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$86, DW_AT_name("R20_b3")
	.dwattr $C$DW$86, DW_AT_location[DW_OP_regx 0x53]

$C$DW$87	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$87, DW_AT_name("R21_b0")
	.dwattr $C$DW$87, DW_AT_location[DW_OP_regx 0x54]

$C$DW$88	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$88, DW_AT_name("R21_b1")
	.dwattr $C$DW$88, DW_AT_location[DW_OP_regx 0x55]

$C$DW$89	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$89, DW_AT_name("R21_b2")
	.dwattr $C$DW$89, DW_AT_location[DW_OP_regx 0x56]

$C$DW$90	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$90, DW_AT_name("R21_b3")
	.dwattr $C$DW$90, DW_AT_location[DW_OP_regx 0x57]

$C$DW$91	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$91, DW_AT_name("R22_b0")
	.dwattr $C$DW$91, DW_AT_location[DW_OP_regx 0x58]

$C$DW$92	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$92, DW_AT_name("R22_b1")
	.dwattr $C$DW$92, DW_AT_location[DW_OP_regx 0x59]

$C$DW$93	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$93, DW_AT_name("R22_b2")
	.dwattr $C$DW$93, DW_AT_location[DW_OP_regx 0x5a]

$C$DW$94	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$94, DW_AT_name("R22_b3")
	.dwattr $C$DW$94, DW_AT_location[DW_OP_regx 0x5b]

$C$DW$95	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$95, DW_AT_name("R23_b0")
	.dwattr $C$DW$95, DW_AT_location[DW_OP_regx 0x5c]

$C$DW$96	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$96, DW_AT_name("R23_b1")
	.dwattr $C$DW$96, DW_AT_location[DW_OP_regx 0x5d]

$C$DW$97	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$97, DW_AT_name("R23_b2")
	.dwattr $C$DW$97, DW_AT_location[DW_OP_regx 0x5e]

$C$DW$98	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$98, DW_AT_name("R23_b3")
	.dwattr $C$DW$98, DW_AT_location[DW_OP_regx 0x5f]

$C$DW$99	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$99, DW_AT_name("R24_b0")
	.dwattr $C$DW$99, DW_AT_location[DW_OP_regx 0x60]

$C$DW$100	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$100, DW_AT_name("R24_b1")
	.dwattr $C$DW$100, DW_AT_location[DW_OP_regx 0x61]

$C$DW$101	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$101, DW_AT_name("R24_b2")
	.dwattr $C$DW$101, DW_AT_location[DW_OP_regx 0x62]

$C$DW$102	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$102, DW_AT_name("R24_b3")
	.dwattr $C$DW$102, DW_AT_location[DW_OP_regx 0x63]

$C$DW$103	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$103, DW_AT_name("R25_b0")
	.dwattr $C$DW$103, DW_AT_location[DW_OP_regx 0x64]

$C$DW$104	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$104, DW_AT_name("R25_b1")
	.dwattr $C$DW$104, DW_AT_location[DW_OP_regx 0x65]

$C$DW$105	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$105, DW_AT_name("R25_b2")
	.dwattr $C$DW$105, DW_AT_location[DW_OP_regx 0x66]

$C$DW$106	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$106, DW_AT_name("R25_b3")
	.dwattr $C$DW$106, DW_AT_location[DW_OP_regx 0x67]

$C$DW$107	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$107, DW_AT_name("R26_b0")
	.dwattr $C$DW$107, DW_AT_location[DW_OP_regx 0x68]

$C$DW$108	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$108, DW_AT_name("R26_b1")
	.dwattr $C$DW$108, DW_AT_location[DW_OP_regx 0x69]

$C$DW$109	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$109, DW_AT_name("R26_b2")
	.dwattr $C$DW$109, DW_AT_location[DW_OP_regx 0x6a]

$C$DW$110	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$110, DW_AT_name("R26_b3")
	.dwattr $C$DW$110, DW_AT_location[DW_OP_regx 0x6b]

$C$DW$111	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$111, DW_AT_name("R27_b0")
	.dwattr $C$DW$111, DW_AT_location[DW_OP_regx 0x6c]

$C$DW$112	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$112, DW_AT_name("R27_b1")
	.dwattr $C$DW$112, DW_AT_location[DW_OP_regx 0x6d]

$C$DW$113	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$113, DW_AT_name("R27_b2")
	.dwattr $C$DW$113, DW_AT_location[DW_OP_regx 0x6e]

$C$DW$114	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$114, DW_AT_name("R27_b3")
	.dwattr $C$DW$114, DW_AT_location[DW_OP_regx 0x6f]

$C$DW$115	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$115, DW_AT_name("R28_b0")
	.dwattr $C$DW$115, DW_AT_location[DW_OP_regx 0x70]

$C$DW$116	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$116, DW_AT_name("R28_b1")
	.dwattr $C$DW$116, DW_AT_location[DW_OP_regx 0x71]

$C$DW$117	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$117, DW_AT_name("R28_b2")
	.dwattr $C$DW$117, DW_AT_location[DW_OP_regx 0x72]

$C$DW$118	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$118, DW_AT_name("R28_b3")
	.dwattr $C$DW$118, DW_AT_location[DW_OP_regx 0x73]

$C$DW$119	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$119, DW_AT_name("R29_b0")
	.dwattr $C$DW$119, DW_AT_location[DW_OP_regx 0x74]

$C$DW$120	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$120, DW_AT_name("R29_b1")
	.dwattr $C$DW$120, DW_AT_location[DW_OP_regx 0x75]

$C$DW$121	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$121, DW_AT_name("R29_b2")
	.dwattr $C$DW$121, DW_AT_location[DW_OP_regx 0x76]

$C$DW$122	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$122, DW_AT_name("R29_b3")
	.dwattr $C$DW$122, DW_AT_location[DW_OP_regx 0x77]

$C$DW$123	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$123, DW_AT_name("R30_b0")
	.dwattr $C$DW$123, DW_AT_location[DW_OP_regx 0x78]

$C$DW$124	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$124, DW_AT_name("R30_b1")
	.dwattr $C$DW$124, DW_AT_location[DW_OP_regx 0x79]

$C$DW$125	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$125, DW_AT_name("R30_b2")
	.dwattr $C$DW$125, DW_AT_location[DW_OP_regx 0x7a]

$C$DW$126	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$126, DW_AT_name("R30_b3")
	.dwattr $C$DW$126, DW_AT_location[DW_OP_regx 0x7b]

$C$DW$127	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$127, DW_AT_name("R31_b0")
	.dwattr $C$DW$127, DW_AT_location[DW_OP_regx 0x7c]

$C$DW$128	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$128, DW_AT_name("R31_b1")
	.dwattr $C$DW$128, DW_AT_location[DW_OP_regx 0x7d]

$C$DW$129	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$129, DW_AT_name("R31_b2")
	.dwattr $C$DW$129, DW_AT_location[DW_OP_regx 0x7e]

$C$DW$130	.dwtag  DW_TAG_TI_assign_register
	.dwattr $C$DW$130, DW_AT_name("R31_b3")
	.dwattr $C$DW$130, DW_AT_location[DW_OP_regx 0x7f]

	.dwendtag $C$DW$CU

NOTE: R2 is used to hold the RAM address of variable X, but it is NOT set as part of the assembly code (and therefore not set as part of the generated hex).

R5 c-code:

#include <stdio.h>
#include <kernel/dpl/DebugP.h>
#include "ti_drivers_config.h"
#include "ti_drivers_open_close.h"
#include "ti_board_open_close.h"
#include <drivers/pruicss.h>

#include <pru0_load_bin.h>
#include <pru1_load_bin.h>
#if defined(SOC_AM64X) || defined(SOC_AM243X)
#include <rtupru0_load_bin.h>
#include <rtupru1_load_bin.h>
#include <txpru0_load_bin.h>
#include <txpru1_load_bin.h>
#endif

/*
* This is an example project to show R5F
* loading PRU firmware.
*/

/** \brief Global Structure pointer holding PRUSS1 memory Map. */

PRUICSS_Handle gPruIcss0Handle;


void pru_io_empty_example_main(void *args)
{

System_init();
Board_init();


uint32_t gpioBaseAddr;
Drivers_open(); // check return status

int status;
status = Board_driversOpen();
DebugP_assert(SystemP_SUCCESS == status);
gpioBaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(GPIO_LED_RED_BASE_ADDR);
GPIO_setDirMode(gpioBaseAddr, GPIO_LED_RED_PIN, GPIO_LED_RED_DIR);
GPIO_setDirMode(gpioBaseAddr, GPIO_LED_GREEN_PIN, GPIO_LED_GREEN_DIR);

gPruIcss0Handle = PRUICSS_open(CONFIG_PRU_ICSS0);

status = PRUICSS_initMemory(gPruIcss0Handle, PRUICSS_DATARAM(PRUICSS_PRU0));
DebugP_assert(status != 0);

status = PRUICSS_loadFirmware(gPruIcss0Handle, PRUICSS_PRU0, PRU_IO_Test_image_0, sizeof(PRU_IO_Test_image_0));
DebugP_assert(SystemP_SUCCESS == status);

uint8_t red_status;
uint8_t green_status;

while (1)
{
//ClockP_usleep(1);

red_status = HW_RD_REG8(CSL_ICSSM0_INTERNAL_U_BASE + 0x110);
green_status = HW_RD_REG8(CSL_ICSSM0_INTERNAL_U_BASE + 0x114);

if (0 < red_status){
GPIO_pinWriteLow(gpioBaseAddr, GPIO_LED_RED_PIN);
} else {
GPIO_pinWriteHigh(gpioBaseAddr, GPIO_LED_RED_PIN);
}

if (0 < green_status){
GPIO_pinWriteLow(gpioBaseAddr, GPIO_LED_GREEN_PIN);
} else {

GPIO_pinWriteHigh(gpioBaseAddr, GPIO_LED_GREEN_PIN);
}

}

Board_driversClose();
Drivers_close();
}

 

It seems apparent to me that there should be some initialization of the registers in the PRU, since it the compiled hex never sets R2 but utilizes its value. How do I fix this?

  • This is expected behavior by C compiler as R2 is used as stack pointer and initialized during system init (via rts library/boot.c shipped with compiler)

    https://www.ti.com/lit/ug/spruhv7c/spruhv7c.pdf 

    Section 6.1.2 C/C++ System Stack

    The run-time stack grows from the high addresses to the low addresses. The compiler uses the R2 register to manage this stack. R2 is the stack pointer (SP), which points to the next unused location on the stack. The linker sets the stack size, creates a global symbol, __STACK_SIZE, and assigns it a value equal to the stack size in bytes. The default stack size is 256 bytes. You can change the stack size at link time by using the --stack_size option with the linker command. For more information on the --stack_size option, see the linker description chapter in the PRU Assembly Language Tools User's Guide. At system initialization, SP is set to a designated address for the top of the stack. This address is the first location past the end of the .stack section. Since the position of the stack depends on where the .stack section is allocated, the actual address of the stack is determined at link time.

    Section 6.7 System Initialization

    Before you can run a C/C++ program, you must create the C/C++ run-time environment. The C/C++ boot routine performs this task using a function called c_int00 (or _c_int00). The run-time-support source library, rts.src, contains the source to this routine in a module named boot.c (or boot.asm). To begin running the system, the c_int00 function can be called by reset hardware. You must link the c_int00 function with the other object files. This occurs automatically when you use the --rom_model or -- ram_model link option and include a standard run-time-support library as one of the linker input files. When C/C++ programs are linked, the linker sets the entry point value in the executable output file to the symbol c_int00. The c_int00 function performs the following tasks to initialize the environment: 1. Switches to the appropriate mode, reserves space for the run-time stack, and sets up the initial value of the stack pointer (SP). The stack is not aligned on specific boundary. 2. Calls the function _ _TI_auto_init to perform the C/C++ autoinitialization. The _ _TI_auto_init function does the following tasks: www.ti.com System Initialization SPRUHV7C–July 2014–Revised July 2018 119 Submit Documentation Feedback Copyright © 2014–2018, Texas Instruments Incorporated Run-Time Environment • Processes the binit copy table, if present. • Performs C autoinitialization of global/static variables. For more information, see Section 6.7.2. • Calls C++ initialization routines for file scope construction from the global constructor table. For more information, see Section 6.7.2.6. 3. Calls the main() function to run the C/C++ program. You can replace or modify the boot routine to meet your system requirements. However, the boot routine must perform the operations listed above to correctly initialize the C/C++ environment

  • Thank you for this information, and I continue to review additional information in the Compiler User's Guide. Unfortunately, this information doesn't not help me fix my problem. according to the section you have copy pasted here to answer my question, I should be able to set the --rom_model or --ram_model link option and have this occur automatically. I have always built with that option set, and get the same results if no matter how I set that option.

    Please provide details on how to properly make these changes within the CCS environment. What adjustments and code are necessary in the PRU project and code? What adjustments are necessary in the R5 project and code?