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.

AM4376: PRU initialization example

Part Number: AM4376

I have a working OS (RTEMS) running on an AM4376 board.  I have been using routines based on starterware to implement drivers for some of the peripherals.

Now I want to fire up a PRU and have it manage communications for a serial port.

Is there a simple example or documentation for how to activate a PRU from the ARM processor on the AM4376?   What modules need to be activated and clock domains enabled?

My attempt at using starterware hangs waiting for the PRU to become active.

Every downloadable example I find is multiple megabytes of SDK for Code Composer that I need to sort through and it is not obvious where the PRU initialization code is located.

Thanks for your help,

Cliff

  • Hi Clifford, We have several examples using PRU-ICSS, but let me try to find out which one is simple enough so it would be easier to follow...

    thank you,

    Paula 

  • Hi Clifford, let me point you to a doc, which can help you.

    PRU-ICSS Getting Started Guide. For PRU APIs calling and other details please check section 1.1: PRUSS Driver discusses PRU 

    thank you,

    Paula

  • Hello Paula,  

    Thank you for the info but it was not what I was looking for. 

    Poking around in the CCS tools, I found the file AM43xx_ICSSconfig.gel that contained what I needed:

    *((unsigned int*) 0x44DF0810)      |= 0x2;  //RM_PER_RSTCTRL. Assert Reset
    *((unsigned int*) 0x44DF0810)      &= 0xFFFFFFFD; //RM_PER_RSTCTRL. Clear Reset
    *((unsigned int*) 0x44DF8B20)      |= 0x2; //CM_PER_PRU_ICSS_CLKCTRL

    I converted that to use Starterware symbols to get

    /* Reset the PER PRU-ICSS */
    HW_WR_FIELD32(SOC_PRM_PER_REG+PRCM_RM_PER_RSTCTRL,
          PRCM_RM_PER_RSTCTRL_ICSS_LRST,
          PRCM_RM_PER_RSTCTRL_ICSS_LRST_ASSERT); /* Assert reset */

    HW_WR_FIELD32(SOC_PRM_PER_REG+PRCM_RM_PER_RSTCTRL,
          PRCM_RM_PER_RSTCTRL_ICSS_LRST,
          PRCM_RM_PER_RSTCTRL_ICSS_LRST_CLEAR); /* Clear reset */

    /* Enable the ICSS module */
    HW_WR_FIELD32(SOC_CM_PER_REG+PRCM_CM_PER_ICSS_CLKCTRL,
          PRCM_CM_PER_ICSS_CLKCTRL_MODULEMODE,
          PRCM_CM_PER_ICSS_CLKCTRL_MODULEMODE_ENABLE);

    Once I execute these instructions, all the PRUs become accessible from CCS.  I can connect to them, load a program, single-step etc.

    It seems like this procedure should be more visible to developers.

    Cliff

  • Hi Cliff, thanks for the info. I will reach our PRU and PSDK experts for their inputs. In my head, if there is something init/done in GEL, then this should be also done in SBL. At least that is the idea.. 

    I am glad is working now OK to you.

    Paula