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.

AM335x PRU Direct Connection.

Other Parts Discussed in Thread: AM3358

I wan to communicate PRU0 and PRU1.

I think to, we can use __xin() and __xout(), in PRU sdk example.

But, __xin() can not do this.

typedef struct{
unsigned int reg5;
unsigned int reg6;
unsigned int reg7;
unsigned int reg8;
unsigned int reg9;
unsigned int reg10;
} bufferData;



PRU0 process is :
bufferData   xout_buff;
__xout(14, 5, 0, xout_buff);


PRU1 process is:
bufferData xin_buff;
__xin(14, 5, 0, xin_buff);


PRU need register setting ? or other setting ?
Please help.

  • I will ask the PRU experts to comment.
  • I am not sure what you are asking.

    Do the provided examples not work for you?

    Jason Reeder

  • Shingo-san,

    The code snippets that you supplied work when I tried them with the AM3358 hardware.

    Which Processor SDK version are you using?

    What is the path to the example that you are running, please?

    Care must be taken that the two PRUs are running and not single-stepping when you come to these instructions. The XIN and XOUT instructions will timeout after 1024 cycles. So if you start one running and expect it to wait until you can start the next one running, you will have problems. It is very difficult and tricky to get this to happen correctly in a test or debug environment.

    There is not much value, in my opinion, for using the __xin and __xout instructions in C. Because of the way the C language works with complete separation from the internal architecture of the processor, there is no concept within C of the registers that the two PRU cores use. Instead, the __xin and __xout intrinsics do the best they can, which is to move data to and from a memory location through the selected registers. That is dangerous because the C compiler may also want to use those registers for optimizing your code and would have no information about the registers being used. And that transfer is not much better than just doing block copies of the variables from one PRU's memory to the other PRU's memory.

    In assembly, these can be useful. But in C, I am not sure they truly help you.

    Regards,
    RandyP
  • Dear RandyP,
    Thanks.

    I want to check xin/xout instructions in debug mode.
    But, I understood, it is too difficult.
    And, using share memory is easy way for data transfer.

    Best Regards,
    Shingo