the AM335x TRM specifies a constants table for PRU which can be used for easier access of memory addresses. As an example: for I2C1 registers which originally use base-address 0x4802A000 a constant 2 is defined.
What I do not understand: how can one use these constants? How does the mapping from a constant to a base-address work where I have to add an offset in order to access desired registers?
Or is this an assembler-thingy only which can’t be used out of PRU-C-Software?
The support package is just examples of how to use RemoteProc/RPMSG. Remember to use V4.02 for the V4.1 Linux Kernel and V5 for the V4.4 Linux kernel. The V4.02 uses mailbox events and the V5 uses interrupt events. If you want ARM sample code which interacts with the PRU firmware, look in the Linux source code /samples/rpmsg.
These constants allow the C compiler to produce more efficient code. Of course you can also use them in assembly programs by explicitly using lbco/sbco instructions.
Let me give you an example how pru-gcc uses the constant table. Consider this C code snippet:
What is the declaration syntax for TI’s clpru C/C++ compiler for declaring constant entries? I tried to find where it might be documented in the PRU Optimizing C/C++ Compiler doc (spruhv7c.pdf). But it didn’t seem to make any reference to the PRU constant table. But I’m assuming it needs to know what memory addresses are in there so it can know when it can optimize.
And what include-file would those declarations be supplied in that need to make sure to include on order to ensure the compiler uses the more efficient syntax?