LP-AM261: Problems when loading C application on the PRU programmatically (stuck in __TI_decompress_lzss)

Part Number: LP-AM261

Tool/software:

Hi!

I am having some problems when loading my C PRU application programmatically from the R5 with PRUICSS_loadFirmware()
The same application runs just fine when I load it from JTAG.
And I have built another small C application which just toggles a LED on/off, that one runs just fine when I load it from the R5 PRUICSS_loadFirmware()
But when I load my other application from the R5 and load the symbols on the PRU, it seems to be continuously calling __TI_decompress_lzss() and I don't understand why.
I do not have that problem when loading it from JTAG and my other "led blink" application does not exhibit the same problems when loaded from PRUICSS_loadFirmware().

Could you please help me figure out what is going on?

Best regards
Daniel

  • Hi Daniel,

    Thank you for sharing the details,

    Allow me sometime to reproduce this and debug the issue, I will try to get back by early next week.

  • Hi Daniel,

    I was not able to reproduce this,

    Did you set the entry point of the PRU project properly in arm linker option in project setting. Looks like that is missing.

  • Hi Nilabh,

    I tried setting in to main in the project  "--entry_point=main" but makes no difference.

    Here is my original map file without setting the entry point to main.

    ******************************************************************************
                         PRU Linker PC v2.3.3                      
    ******************************************************************************
    >> Linked Tue Sep  2 15:44:08 2025
    
    OUTPUT FILE NAME:   <PRU_0.out>
    ENTRY POINT SYMBOL: "_c_int00_noargs"  address: 00000458
    
    
    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
    PAGE 0:
      PRU_IMEM              00000000   00003000  000004b4  00002b4c  RWIX
    
    PAGE 1:
      PRU0_DMEM_0           00000000   00002000  00000160  00001ea0  RWIX
      PRU0_DMEM_1           00002000   00002000  00000000  00002000  RWIX
    
    PAGE 2:
      PRU_SHAREDMEM         00010000   00008000  00000000  00008000  RWIX
    
    
    SECTION ALLOCATION MAP
    
     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    .text      0    00000000    000004b4     
                      00000000    000000d0     rtspruv3_le.lib : copy_decompress_lzss.c.obj (.text:decompress:lzss:__TI_decompress_lzss)
                      000000d0    00000088                     : autoinit.c.obj (.text:__TI_auto_init_nobinit_nopinit:__TI_auto_init_nobinit_nopinit)
                      00000158    00000080     main.obj (.text:send_pixel)
                      000001d8    00000078     main.obj (.text:send_frame)
                      00000250    00000068     main.obj (.text:send_zero)
                      000002b8    00000064     main.obj (.text:send_one)
                      0000031c    00000040     main.obj (.text:delay_ms)
                      0000035c    00000034     rtspruv3_le.lib : memcpy.asm.obj (.text)
                      00000390    0000002c     main.obj (.text:error)
                      000003bc    00000028     rtspruv3_le.lib : copy_decompress_none.c.obj (.text:decompress:none:__TI_decompress_none)
                      000003e4    00000028     main.obj (.text:init)
                      0000040c    00000028     main.obj (.text:main)
                      00000434    00000024     main.obj (.text:send_reset)
                      00000458    00000020     rtspruv3_le.lib : boot.c.obj (.text:_c_int00_noargs)
                      00000478    0000001c     main.obj (.text:wait_for_interrupt)
                      00000494    0000000c     main.obj (.text:send_interrupt_to_r5)
                      000004a0    00000008     rtspruv3_le.lib : exit.c.obj (.text:abort)
                      000004a8    00000008                     : exit.c.obj (.text:loader_exit)
                      000004b0    00000004                     : startup.c.obj (.text:_system_post_cinit)
    
    .stack     1    00000000    00000100     UNINITIALIZED
                      00000000    00000004     rtspruv3_le.lib : boot.c.obj (.stack)
                      00000004    000000fc     --HOLE--
    
    .data      1    00000100    00000044     UNINITIALIZED
                      00000100    00000020     main.obj (.data:blank_frame)
                      00000120    00000020     main.obj (.data:red_frame)
                      00000140    00000004     main.obj (.data)
    
    .cinit     1    00000144    0000001c     
                      00000144    0000000f     (.cinit..data.load) [load image, compression = lzss]
                      00000153    00000001     --HOLE-- [fill = 0]
                      00000154    00000004     (__TI_handler_table)
                      00000158    00000008     (__TI_cinit_table)
    
    MODULE SUMMARY
    
           Module                       code   ro data   rw data
           ------                       ----   -------   -------
        .\
           main.obj                     716    0         68     
        +--+----------------------------+------+---------+---------+
           Total:                       716    0         68     
                                                                
        C:\App\ti\ti-cgt-pru_2.3.3\lib\rtspruv3_le.lib
           copy_decompress_lzss.c.obj   208    0         0      
           autoinit.c.obj               136    0         0      
           memcpy.asm.obj               52     0         0      
           copy_decompress_none.c.obj   40     0         0      
           boot.c.obj                   32     0         0      
           exit.c.obj                   16     0         0      
           startup.c.obj                4      0         0      
        +--+----------------------------+------+---------+---------+
           Total:                       488    0         0      
                                                                
           Stack:                       0      0         256    
           Linker Generated:            0      27        0      
        +--+----------------------------+------+---------+---------+
           Grand Total:                 1204   27        324    
    
    
    LINKER GENERATED COPY TABLES
    
    __TI_cinit_table @ 00000158 records: 1, size/record: 8, table size: 8
    	.data: load addr=00000144, load size=0000000f bytes, run addr=00000100, run size=00000044 bytes, compression=lzss
    
    
    LINKER GENERATED HANDLER TABLE
    
    __TI_handler_table @ 00000154 records: 2, size/record: 2, table size: 4
    	index: 0, handler: __TI_decompress_lzss
    	index: 1, handler: __TI_decompress_none
    
    
    SEGMENT ATTRIBUTES
    
        id tag      seg value
        -- ---      --- -----
         0 PHA_PAGE 1   1    
         1 PHA_PAGE 2   1    
    
    
    GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 
    
    page  address   name                          
    ----  -------   ----                          
    0     000004a8  C$$EXIT                       
    1     00000158  __TI_CINIT_Base               
    1     00000160  __TI_CINIT_Limit              
    1     00000154  __TI_Handler_Table_Base       
    1     00000158  __TI_Handler_Table_Limit      
    1     00000100  __TI_STACK_END                
    abs   00000100  __TI_STACK_SIZE               
    0     000000d0  __TI_auto_init_nobinit_nopinit
    0     00000000  __TI_decompress_lzss          
    0     000003bc  __TI_decompress_none          
    abs   ffffffff  __c_args__                    
    0     00000458  _c_int00_noargs               
    1     00000000  _stack                        
    0     000004b0  _system_post_cinit            
    0     000004a0  abort                         
    1     00000100  blank_frame                   
    0     0000031c  delay_ms                      
    0     00000390  error                         
    0     000003e4  init                          
    0     0000040c  main                          
    0     0000035c  memcpy                        
    1     00000120  red_frame                     
    0     000001d8  send_frame                    
    0     00000494  send_interrupt_to_r5          
    0     000002b8  send_one                      
    0     00000158  send_pixel                    
    0     00000434  send_reset                    
    0     00000250  send_zero                     
    1     00000140  shared_mem                    
    0     00000478  wait_for_interrupt            
    
    
    GLOBAL SYMBOLS: SORTED BY Symbol Address 
    
    page  address   name                          
    ----  -------   ----                          
    0     00000000  __TI_decompress_lzss          
    0     000000d0  __TI_auto_init_nobinit_nopinit
    0     00000158  send_pixel                    
    0     000001d8  send_frame                    
    0     00000250  send_zero                     
    0     000002b8  send_one                      
    0     0000031c  delay_ms                      
    0     0000035c  memcpy                        
    0     00000390  error                         
    0     000003bc  __TI_decompress_none          
    0     000003e4  init                          
    0     0000040c  main                          
    0     00000434  send_reset                    
    0     00000458  _c_int00_noargs               
    0     00000478  wait_for_interrupt            
    0     00000494  send_interrupt_to_r5          
    0     000004a0  abort                         
    0     000004a8  C$$EXIT                       
    0     000004b0  _system_post_cinit            
    1     00000000  _stack                        
    1     00000100  __TI_STACK_END                
    1     00000100  blank_frame                   
    1     00000120  red_frame                     
    1     00000140  shared_mem                    
    1     00000154  __TI_Handler_Table_Base       
    1     00000158  __TI_CINIT_Base               
    1     00000158  __TI_Handler_Table_Limit      
    1     00000160  __TI_CINIT_Limit              
    abs   00000100  __TI_STACK_SIZE               
    abs   ffffffff  __c_args__                    
    
    [30 symbols]
    

    Here is the map file with the entry point set to main.

    ******************************************************************************
                         PRU Linker PC v2.3.3                      
    ******************************************************************************
    >> Linked Tue Sep  2 15:46:54 2025
    
    OUTPUT FILE NAME:   <PRU_0.out>
    ENTRY POINT SYMBOL: "main"  address: 00000384
    
    
    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
    PAGE 0:
      PRU_IMEM              00000000   00003000  000003f8  00002c08  RWIX
    
    PAGE 1:
      PRU0_DMEM_0           00000000   00002000  00000060  00001fa0  RWIX
      PRU0_DMEM_1           00002000   00002000  00000000  00002000  RWIX
    
    PAGE 2:
      PRU_SHAREDMEM         00010000   00008000  00000000  00008000  RWIX
    
    
    SECTION ALLOCATION MAP
    
     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    .text      0    00000000    000003f8     
                      00000000    000000d0     rtspruv3_le.lib : copy_decompress_lzss.c.obj (.text:decompress:lzss:__TI_decompress_lzss)
                      000000d0    00000080     main.obj (.text:send_pixel)
                      00000150    00000078     main.obj (.text:send_frame)
                      000001c8    00000068     main.obj (.text:send_zero)
                      00000230    00000064     main.obj (.text:send_one)
                      00000294    00000040     main.obj (.text:delay_ms)
                      000002d4    00000034     rtspruv3_le.lib : memcpy.asm.obj (.text)
                      00000308    0000002c     main.obj (.text:error)
                      00000334    00000028     rtspruv3_le.lib : copy_decompress_none.c.obj (.text:decompress:none:__TI_decompress_none)
                      0000035c    00000028     main.obj (.text:init)
                      00000384    00000028     main.obj (.text:main)
                      000003ac    00000024     main.obj (.text:send_reset)
                      000003d0    0000001c     main.obj (.text:wait_for_interrupt)
                      000003ec    0000000c     main.obj (.text:send_interrupt_to_r5)
    
    .data      1    00000000    00000044     UNINITIALIZED
                      00000000    00000020     main.obj (.data:blank_frame)
                      00000020    00000020     main.obj (.data:red_frame)
                      00000040    00000004     main.obj (.data)
    
    .cinit     1    00000044    0000001c     
                      00000044    0000000f     (.cinit..data.load) [load image, compression = lzss]
                      00000053    00000001     --HOLE-- [fill = 0]
                      00000054    00000004     (__TI_handler_table)
                      00000058    00000008     (__TI_cinit_table)
    
    MODULE SUMMARY
    
           Module                       code   ro data   rw data
           ------                       ----   -------   -------
        .\
           main.obj                     716    0         68     
        +--+----------------------------+------+---------+---------+
           Total:                       716    0         68     
                                                                
        C:\App\ti\ti-cgt-pru_2.3.3\lib\rtspruv3_le.lib
           copy_decompress_lzss.c.obj   208    0         0      
           memcpy.asm.obj               52     0         0      
           copy_decompress_none.c.obj   40     0         0      
        +--+----------------------------+------+---------+---------+
           Total:                       300    0         0      
                                                                
           Linker Generated:            0      27        0      
        +--+----------------------------+------+---------+---------+
           Grand Total:                 1016   27        68     
    
    
    LINKER GENERATED COPY TABLES
    
    __TI_cinit_table @ 00000058 records: 1, size/record: 8, table size: 8
    	.data: load addr=00000044, load size=0000000f bytes, run addr=00000000, run size=00000044 bytes, compression=lzss
    
    
    LINKER GENERATED HANDLER TABLE
    
    __TI_handler_table @ 00000054 records: 2, size/record: 2, table size: 4
    	index: 0, handler: __TI_decompress_lzss
    	index: 1, handler: __TI_decompress_none
    
    
    SEGMENT ATTRIBUTES
    
        id tag      seg value
        -- ---      --- -----
         0 PHA_PAGE 1   1    
         1 PHA_PAGE 2   1    
    
    
    GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 
    
    page  address   name                    
    ----  -------   ----                    
    1     00000058  __TI_CINIT_Base         
    1     00000060  __TI_CINIT_Limit        
    1     00000054  __TI_Handler_Table_Base 
    1     00000058  __TI_Handler_Table_Limit
    0     00000000  __TI_decompress_lzss    
    0     00000334  __TI_decompress_none    
    abs   ffffffff  __c_args__              
    1     00000000  blank_frame             
    0     00000294  delay_ms                
    0     00000308  error                   
    0     0000035c  init                    
    0     00000384  main                    
    0     000002d4  memcpy                  
    1     00000020  red_frame               
    0     00000150  send_frame              
    0     000003ec  send_interrupt_to_r5    
    0     00000230  send_one                
    0     000000d0  send_pixel              
    0     000003ac  send_reset              
    0     000001c8  send_zero               
    1     00000040  shared_mem              
    0     000003d0  wait_for_interrupt      
    
    
    GLOBAL SYMBOLS: SORTED BY Symbol Address 
    
    page  address   name                    
    ----  -------   ----                    
    0     00000000  __TI_decompress_lzss    
    0     000000d0  send_pixel              
    0     00000150  send_frame              
    0     000001c8  send_zero               
    0     00000230  send_one                
    0     00000294  delay_ms                
    0     000002d4  memcpy                  
    0     00000308  error                   
    0     00000334  __TI_decompress_none    
    0     0000035c  init                    
    0     00000384  main                    
    0     000003ac  send_reset              
    0     000003d0  wait_for_interrupt      
    0     000003ec  send_interrupt_to_r5    
    1     00000000  blank_frame             
    1     00000020  red_frame               
    1     00000040  shared_mem              
    1     00000054  __TI_Handler_Table_Base 
    1     00000058  __TI_CINIT_Base         
    1     00000058  __TI_Handler_Table_Limit
    1     00000060  __TI_CINIT_Limit        
    abs   ffffffff  __c_args__              
    
    [22 symbols]
    

    Best regards
    Daniel

  • Hi Daniel,

    I will look into the project shared by you tomorrow, and give up an updated latest by Monday

  • Hi Nilabh!
    I have made some progress, I added  --ram_model to my PRU linker flags and I modified my PRU linker command script by adding .text:_c_int00* >  0x0,        PAGE 0 at the top of SECTIONS {
    So now I can load code on the PRU from the R5 and it's executing as expected.

    But now the access to the shared memory has stopped working, so when I write 0x55555555 from the PRU to the shared memory I only read 0 from the R5. 

    /* Specify the sections allocation into memory */
    SECTIONS {
    
        .text:_c_int00* >  0x0,         PAGE 0
        .text           >  PRU_IMEM,    PAGE 0
        .bss            >  PRU0_DMEM_0, PAGE 1
        .stack          >  PRU0_DMEM_0, PAGE 1
        .data           >  PRU0_DMEM_0, PAGE 1
        .cinit          >  PRU0_DMEM_0, PAGE 1
        .rodata         >  PRU0_DMEM_0, PAGE 1
    }
    

    ******************************************************************************
                         PRU Linker PC v2.3.3                      
    ******************************************************************************
    >> Linked Fri Sep  5 13:17:14 2025
    
    OUTPUT FILE NAME:   <PRU_0.out>
    ENTRY POINT SYMBOL: "_c_int00_noinit_noargs"  address: 00000000
    
    
    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
    PAGE 0:
      PRU_IMEM              00000000   00003000  000002f0  00002d10  RWIX
    
    PAGE 1:
      PRU0_DMEM_0           00000000   00002000  00000144  00001ebc  RWIX
      PRU0_DMEM_1           00002000   00002000  00000000  00002000  RWIX
    
    PAGE 2:
      PRU_SHAREDMEM         00010000   00008000  00000000  00008000  RWIX
    
    
    SECTION ALLOCATION MAP
    
     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    .text:_c_int00* 
    *          0    00000000    0000001c     
                      00000000    0000001c     rtspruv3_le.lib : boot.c.obj (.text:_c_int00_noinit_noargs)
    
    .text      0    0000001c    000002d4     
                      0000001c    00000080     main.obj (.text:send_pixel)
                      0000009c    00000078     main.obj (.text:send_frame)
                      00000114    00000068     main.obj (.text:send_zero)
                      0000017c    00000064     main.obj (.text:send_one)
                      000001e0    00000040     main.obj (.text:delay_ms)
                      00000220    0000002c     main.obj (.text:error)
                      0000024c    00000028     main.obj (.text:main)
                      00000274    00000024     main.obj (.text:send_reset)
                      00000298    00000020     main.obj (.text:init)
                      000002b8    0000001c     main.obj (.text:wait_for_interrupt)
                      000002d4    0000000c     main.obj (.text:send_interrupt_to_r5)
                      000002e0    00000008     rtspruv3_le.lib : exit.c.obj (.text:abort)
                      000002e8    00000008                     : exit.c.obj (.text:loader_exit)
    
    .stack     1    00000000    00000100     UNINITIALIZED
                      00000000    00000004     rtspruv3_le.lib : boot.c.obj (.stack)
                      00000004    000000fc     --HOLE--
    
    .data      1    00000100    00000044     
                      00000100    00000020     main.obj (.data:blank_frame)
                      00000120    00000020     main.obj (.data:red_frame)
                      00000140    00000004     main.obj (.data)
    
    .cinit     1    00000000    00000000     UNINITIALIZED
    
    MODULE SUMMARY
    
           Module         code   ro data   rw data
           ------         ----   -------   -------
        .\
           main.obj       708    0         68     
        +--+--------------+------+---------+---------+
           Total:         708    0         68     
                                                  
        C:\App\ti\ti-cgt-pru_2.3.3\lib\rtspruv3_le.lib
           boot.c.obj     28     0         0      
           exit.c.obj     16     0         0      
        +--+--------------+------+---------+---------+
           Total:         44     0         0      
                                                  
           Stack:         0      0         256    
        +--+--------------+------+---------+---------+
           Grand Total:   752    0         324    
    
    
    SEGMENT ATTRIBUTES
    
        id tag      seg value
        -- ---      --- -----
         0 PHA_PAGE 1   1    
         1 PHA_PAGE 2   1    
    
    
    GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 
    
    page  address   name                  
    ----  -------   ----                  
    0     000002e8  C$$EXIT               
    1     00000100  __TI_STACK_END        
    abs   00000100  __TI_STACK_SIZE       
    abs   ffffffff  __c_args__            
    0     00000000  _c_int00_noinit_noargs
    1     00000000  _stack                
    0     000002e0  abort                 
    1     00000100  blank_frame           
    0     000001e0  delay_ms              
    0     00000220  error                 
    0     00000298  init                  
    0     0000024c  main                  
    1     00000120  red_frame             
    0     0000009c  send_frame            
    0     000002d4  send_interrupt_to_r5  
    0     0000017c  send_one              
    0     0000001c  send_pixel            
    0     00000274  send_reset            
    0     00000114  send_zero             
    1     00000140  shared_mem            
    0     000002b8  wait_for_interrupt    
    
    
    GLOBAL SYMBOLS: SORTED BY Symbol Address 
    
    page  address   name                  
    ----  -------   ----                  
    0     00000000  _c_int00_noinit_noargs
    0     0000001c  send_pixel            
    0     0000009c  send_frame            
    0     00000114  send_zero             
    0     0000017c  send_one              
    0     000001e0  delay_ms              
    0     00000220  error                 
    0     0000024c  main                  
    0     00000274  send_reset            
    0     00000298  init                  
    0     000002b8  wait_for_interrupt    
    0     000002d4  send_interrupt_to_r5  
    0     000002e0  abort                 
    0     000002e8  C$$EXIT               
    1     00000000  _stack                
    1     00000100  __TI_STACK_END        
    1     00000100  blank_frame           
    1     00000120  red_frame             
    1     00000140  shared_mem            
    abs   00000100  __TI_STACK_SIZE       
    abs   ffffffff  __c_args__            
    
    [21 symbols]
    

  • Hi Daniel,

    Due to release activity I have not been able to debug this issue, Allow me somemore time to get back with observation.

    I will try to share more details by friday.

  • Hi Nilabh,

    I think that my problems might have to do with the fact that PRUICSS_loadFirmware() only loads data to the instruction ram of the PRU. I found this in another thread "However, there can be some issues with loading C code with the MCU+ PRUICSS driver. Fixing that behavior is still on the TODO list. If you run into problems, please reach out to us."

    AM2432: am2432 multiplication in PRU - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums