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.

Compiler/AM3356: PRU with mii support

Part Number: AM3356

Tool/software: TI C/C++ Compiler

Hello,

For our own purpose, we try to get a C program for PRU to handle the MII link of PRU from the AM3356 SoC.

By reading the documentation and after few tests, I have the following issue: 

- Issue a XFR command for getting L2 Bank data need to use de  __xin() function (just an info)

- R2->R9 are used to retrieve MII DATA but R2 is use by the compiler for Stack Pointer. Unless I can change the Stack Pointer register from compiler options, I guess that I must use the remapping flag ?

- Using the remapping flag of the __xin function seems to not work. Firstly, data is not retrieve in any CPU registers(R0->R29) and secondly, I didn't see in the assembly code generated by the C compiler an SBBO instruction to store the result in the provided buffer. 

-> without using the remapping flag,  data is correctly retrieve in R2 register

-> By using the remapping flag, No CPU registers are updated and the data stored in the provided buffer come from the stack ...

So, all of this to ask if the C compiler support the MII interface and if yes, what I missed ?

Thank you,

Guillaume

  • I apologize for the delay.

    You have experienced a known problem in the compiler.  The ID is CODEGEN-1718.  You are welcome to look it up with the SDOWP link below in my signature.  It will be fixed in the next release of the PRU compiler.  That release is not scheduled at this time.

    Thanks and regards,

    -George

  • Ok, 

    Is there any way to change the Stack Pointer register (R2) / link register (R14) to another GP Registers (R0->R29). I didn't see in the doc how to do that but maybe there is some kind of MacGyver trick to do it ?

    Another solution should be to get the compiler source code and try to change that. Source code is available somewhere ?

    Thank you for your response,

    Regards,

    Guillaume

  • Guillaume,

    No, unfortunately there is no way to change the SP register or the link register and we do not currently provide the source code of the PRU C compiler.

    It appears that your two options would be:

    1. use the RX MII Port -> RX L1 FIFO -> PRU (R31) data path described in section 4.4.6.2.3.1.2.1 of the TRM
    2. use assembly code for the portion of your program that interacts with the MII port and C code for everything else
      1. this option would be complicated by the fact that you would need to save any registers that the C compiler would need (SP, link register, etc) and then restore those registers before coming out of your assembly function call.

    Jason Reeder