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.

AM3358: Code protection and PRU development

Other Parts Discussed in Thread: AM3358
Part Number: AM3358
First the simple question.
How does one prevent a dedicated hobbyist or an IP ripoff site from copying our IP burned into an AM335x’s flash ROM? Please direct me to the documentation where I can find out how to protect our IP.
 
Now the more complex question.
My boss wants me to write a driver using the PRU-ICSS. I’ve seen enough PRU documentation to know writing that driver is well within my capabilities. But first I will have to learn the PRU instruction set. So far I have been unable to find the compiler/assembler that is said to run on Linux on your A8 products. What I need to get started learning PRU-ICSS code is a Windows version that can compile/assemble PRU code. And a Windows PRU simulator where I can practice. The documentation I have seen so far extols the speed and predictability of the PRU. But the documentation is unhelpful when it fails to mention little things like . . .
I think that the PRU has the ability to fetch one of its program memory words into a register. But can it store a register in its program memory? I read about 3 sets of r0-29. How is this managed? I see things like r5.b2 for byte 2 in register 5. This will be useful for my driver. But can I fetch a 3-bit field in one register and add it to a 5-bit field in another register? What are the limits of arbitrarily sized bit field operations? I’m confused about the carry flag. As I understand the PRU now, the only PRU assembly code I’ve seen has a nasty bug. (The code says it’s multiplying pairs of 32-bit integers and summing the 64-bit products. And it’s written as if the carry flag works like it does in regular ARM assembly.) Or my understanding is off? There is dedicated I/O space in the A8 for PRU memory access. I assume I could read 6 words from that region at 5 nSec per word. Is that assumption correct? I also assume that my PRU code can read or write anywhere in the A8’s 4-gigabyte address space. This, especially for flash ROM access, will require wait states. How is this managed?
 
The first cut on my driver will only write to I/O pins. However, the device I am driving is bidirectional on an 8-bit bus. Thus the input and output pins for each bit will have to be connected. That means that the output pins will have to be set to high impedance to allow my device to send data. Will A8 code have to do this for my driver, or can my driver reach into the GPIO pin setup and do this without assistance?
 
About me:
My experience extends back to the first generation of supercomputers, the CDC 6000 series. Most of my work was with the PPU I/O coprocessors. The PP’s, as they where known, were 4Kx12 bit at 1 MHz. PPs could read or write to any 60-bit main memory word in 5 clocks. On the 6000 series mainframes, PPs were the ONLY way ANY I/O could be performed. Most systems had 10 PPs. Some few systems had 20 PPs.
  • Hi,

    On your first question, there are AM335x High Security devices available, but you will need to contact TI directly for information about them. HS devices cannot be discussed on a public forum. You can also check www.ti.com/.../spry305

    On your second question, the PRU experts have been notified. They will respond here.
  • Hello Peter,

    I'll post some general PRU resources for you rather than responding line by line. Check out the resources, and feel free to come back with questions.

    General PRU-ICSS wiki is here - this includes the compiler and assembly documentation you asked for, as well as a discussion of read and write times, which are not necessarily 5ns.

    The PRU software support package can be found here or in the Linux Processor SDK under ti-processor-sdk.../examples/pru-.../

    The PRU compiler can be found in the Apps Center in Code Composer Studio 

    The easiest way to start PRU development is with a beaglebone black and a PRU cape as per the hands-on labs.

    One thing to note is that although the PRU can access most of the ARM's memory space, it does not have elevated privileges - so you cannot perform pinmuxing from PRU firmware, it must be done by the ARM.

    Regards, 

    Nick

  • Thank you Nick Saulnier. You helped me find found the windows PRU assembler. Do I need the linker for a simple one file assembly? What is the name of the windows PRU simulator? I see the CCS app center spinning forever in what appears to be a forlorn attempt to load the PRU compiler. (I’m using Windows 10.) Ideas welcome.

    ** The LBBO instruction “reads a block of data from memory into the register file”. For my driver I would like very much for that memory to be in the PRU instruction memory space. However, I assume that LBBO reads from the A8’s memory space.

    ** Is that memory space restricted or related to the 512 bytes of data RAM located (for PRU 0) at 0x01C30000?

    ** My driver needs an A8 defined table lookup. The A8 could split its table into LDI instructions followed by subroutine returns. Calculated JAL target addresses would fetch the values. I would define the format and likely write the necessary ARM code. I assume this is a not an uncommon action.

    ** I would like to perform r23 += rotateLeft(r22, 1) would this work?
    add r19,r22,r22 ;(r19 is a temp)
    adc r23,r23,r19

    ** I do not see any instructions that load PRU memory into PUR registers. What, if any is the use of the .int pseudo op?

    More newbie questions are sure to follow.
  • Hello Peter,

    1) If you are still having trouble with the CCS apps center, please submit an e2e question in the code composer studio group to get an expert's help.

    2) You will want to use the linker.

    3) There is not a PRU simulator that I know of. We suggest starting development using a beaglebone black, see detailed suggestions in the Hands-on labs.

    4) The PRU cannot read or modify IRAM while running - from the PRU's perspective, the IRAM and DRAM would have the same address, so it would be able to access DRAM.

    5) Your program size is limited to what can fit into IRAM. The PRU can read the whole ARM memory space after enabling OCP master port access.

    I can look at any outstanding assembly questions you have next week if they are not addressed here or here. Note that we do support C programming for the PRU if you wanted to write pseudocode using that language.

    Regards, 

    Nick

  • Hello Peter,

    I am marking this resolved. Feel free to reply on this thread if you have more basic PRU development questions. More in-depth questions will benefit from new, dedicated threads.

    Regards,
    Nick