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.

CCS/TMS320C6748: PRU compiler and linker

Part Number: TMS320C6748


Tool/software: Code Composer Studio

I am having trouble getting PRU to work consistently through shared memory.  In shared memory, I have a structure of structures that represent data shared between the c6748 host and the PRU.  The symtom exhibited by the problem (which is undefined at this point, since I'm asking the question) is that  starting the PRU without stepping or using breakpoints fails to start PRU execution properly.  If I single step or use breakpoints, I am able to start the PRU.  The sequence I am using is reset by writing a 0 to control register, followed by program load (array transfer to pru imem), followed by enable execution by writing 0x03 to control register.  Puzzlling!  Is there other initialization step I should take at the front of the PRU code to ensure proper and consistent startup of PRU?

  • Him

    Which CCS version are you using? Is this a custom application code or are you using Processor SDK RTOS (or other TI sw), which version?

    Best Regards,
    Yordan
  • replied to you on the other post I placed. ccs 8.2.0.00007, custom code. please see my reply to the other post.
  • Peter,

    We have many PRU examples on Sitara, but I could not find a code snippet to show the C6678 PRU init step. Have you checked the bit 2 (SLEEPING) of the control register before setting the ENABLE bit? You may need to write 0 to the SLEEPING bit, 'the PRU will be forced to power up from sleep mode'. Also instead of writing 0x03 to control register, you may try to write 0x01 then 0x02, i.e. reset then enable as shown in our PRUSS driver for Sitara:
    {
    PRUICSS_pruDisable(handle,(uint8_t)pruNum);
    PRUICSS_pruInitMemory(handle,PRU_ICSS_IRAM((uint32_t)pruNum));
    PRUICSS_pruInitMemory(handle,PRU_ICSS_DATARAM((uint32_t)pruNum));
    PRUICSS_pruWriteMemory(handle,PRU_ICSS_IRAM((uint32_t)pruNum),0U,(uint32_t *) object->pruBinBuff[pruNum],object->buffLen[pruNum]);
    PRUICSS_pruReset(handle,(uint8_t)pruNum);
    PRUICSS_pruEnable(handle,(uint8_t)pruNum);
    }

    Regards,
    Garrett
  • Thanks.

    I'm using a TI's c6748 eval board.  After repeated tries to correct the problem, I discovered that prior to starting the CCS debug session, hard resetting the eval board fixed the problem.  Resetting CPU or system within CCS didn't seem to work.  Also, the soft reset of PRU by writing 0 to the control register via CCS did not work either.  Now, my code runs as expected after hard reset of the eval board.

    That brings up a question, though.  If PRU gets stuck for whatever reason during normal operation,  how can the host execute a hard reset of the PRU only?

  • Hi Peter,

    Good to know that you can move forward. the SOFTRESET really should be just the option to reset the PRU core. We can discuss this further if you want to have this implemented later.

    Regards,
    Garrett
  • Can you please describe the SOFTRESET feature?  thanks

  • Peter,

    The PRU SOFTRESET feature is the sequence as outlined in the PRUSS driver for Sitara described above:

    PRUICSS_pruDisable() ->PRUICSS_pruInitMemory()->PRUICSS_pruWriteMemory()->PRUICSS_pruReset() -> PRUICSS_pruEnable()

    Regards,
    Garrett