AM2634: Unable to read/write access the internal data memory from PRU1

Part Number: AM2634
Other Parts Discussed in Thread: SYSCONFIG

Hi, dear TI support service!

I am developing a simple program that uses PRU0 to generate a real time bit bang on GPIOs and it works very well.

Now I am trying to debug a program for the PRU1 that checks the data generated from the PRU0 program but I am having the issue that I am unable from PRU1 to access both the data memory DMEM0 and DMEM1.

My program boots OK up to the main() function, but when the first access to the memory (read or write) is tried, the emulation stops with the red error on the Debug Output window:
ICSSM_PRU_1: Trouble Halting Target CPU: (Error -2062 @ 0x0) Unable to halt device. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 20.4.0.3756) 

In the following my linker.cmd file (I am unable to upload it)

MEMORY
{
    PAGE 0:
      /* 12 KB PRU Instruction RAM */
      PRU_IMEM          : org = 0x00000000 len = 0x00003000

    PAGE 1:
      /* Data RAMs */
      /* 8 KB PRU Data RAM 0 */
      PRU0_DMEM_0       : org = 0x00000000 len = 0x00002000
      /* 8 KB PRU Data RAM 1 */
      PRU0_DMEM_1       : org = 0x00002000 len = 0x00002000

    PAGE 2:
      /* C28 needs to be programmed to point to SHAREDMEM, default is 0 */
      /* 32 KB Shared general purpose memory RAM with ECC, shared between PRU0 and PRU1 */
      PRU_SHAREDMEM     : org = 0x00010000 len = 0x00008000
    // IMPORTANT
    // the value 11 for CREGISTER is found in the AM263P_tech_ref_spruj55d.pdf file
    // chapter 7.3.5.2.1 PRU Constant Table
    // EntryNo. Region Pointed To             Value [31:0]
    // 11       PRU-ICSS PRU0 Control (local) 0002_2000h PRU0
    //
    // or, just check the file: C:\ti\pru_support_package\labs\Getting_Started_Labs\assembly_code\solution\am62x\AM62x_PRU0.cmd
    // where all the settings are explicited
    //
      PRU0_CTRL: origin=0x00022000 length=0x30 CREGISTER=11      
}

/* Specify the sections allocation into memory */
SECTIONS {

    .text:_c_int00* >  0x0, PAGE 0
    .text           >  PRU_IMEM,    PAGE 0
    .data_RAM : ALIGN(4)
    {
      *(ramdata)
    } > 0x2000, PAGE 1
    .bss            >  PRU0_DMEM_1, PAGE 1
    .stack          >  PRU0_DMEM_1, PAGE 1

    .shared_RAM : ALIGN(4)
    {
      *(shared_PRUs)
    }> PRU_SHAREDMEM, PAGE 2  
}
The main program starts with
int main(void)
{
    if (numloopOK > 10)
    {
        numloopOK = 0;
    }
 
And it hangs while read-accessing the numloopOK variable, the same happens if I write first on the variable.
 
In the disassembly window, the PRU1 hangs while trying to execute the instruction LBBO at offset 0x24
immagine.png
 

In the following an excerpt of the map file (I am unable to upload it)

GLOBAL SYMBOLS: SORTED BY Symbol Address 

page  address   name                     
----  -------   ----                     
0     00000000  _c_int00_noinit_noargs   
0     0000001c  main                     
0     000003ec  __TI_zero_init_nomemset  
0     00000418  abort                    
0     00000420  C$$EXIT                  
0     00000438  __TI_Handler_Table_Base  
0     0000043a  __TI_Handler_Table_Limit 
0     0000043c  __TI_CINIT_Base          
0     0000044c  __TI_CINIT_Limit         
1     00002000  numerr                   
1     00002028  numloopOK                
1     0000202c  _stack                   
1     0000212c  __TI_STACK_END           
2     00010000  shared_R30               
2     00022000  CT_PRU0_CTRL             
abs   0000000b  __PRU_CREG_PRU0_CTRL     
abs   00000100  __TI_STACK_SIZE          
abs   00022000  __PRU_CREG_BASE_PRU0_CTRL
abs   ffffffff  __c_args__        

The variable numloopOK is allocated at 0x2028 so it seems OK.

As stated, the program runs just fine until a data memory access is executed.

As stated, a more complex program for the PRU0 works OK.

 

Best regards and many thanks again for your help!

Michele Sponchiado