Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

AM5728: PRU Access to CMEM for unidirectional Transfers

$
0
0

Part Number:AM5728

I am experiencing some difficulty getting the PRU to copy (dummy) data into the CMEM memory peripheral.

My code right now is very simple, as shown below:

int main(void)
{
    uint8_t data[256];
    int x =0;
    //PinSetup();
    
    for (x = 0; x < 256; x++)
    {
        data[x] = x;//(uint8_t)(__R31 >> 5);
    }
    memcpy((uint32_t*)0x60400000,data,256*sizeof(uint8_t));

    return 0;
}

And my resource table is below (also very simple):

#include <stddef.h>
#include <rsc_types.h>

#define SZ_1M                      0x00100000
#define NumberOfEntries 2
#define IPU_CMEM_IOBUFS         0x40400000  //physical address of the CMEM (shared) memory section at OCMC2
#define CMEM_PHYS_IOBUFS        0x60400000  //IPU address of the CMEM
#define IPU_CMEM_IOBUFS_SIZE    SZ_4K

struct my_resource_table {
    struct resource_table base;

    uint32_t offset[NumberOfEntries];

    struct fw_rsc_devmem devmem1;

};

#pragma DATA_SECTION(pru_remoteproc_ResourceTable, ".resource_table")
#pragma RETAIN(pru_remoteproc_ResourceTable)
struct my_resource_table pru_remoteproc_ResourceTable = {

    1,    // we're the first version that implements this

    NumberOfEntries,    // number of entries in the table

    0, 0,    // reserved, must be zero

    0,    // offset[0]

    {
        offsetof(struct my_resource_table, devmem1),
    },

    //CMEM resources
    {
        TYPE_DEVMEM,
        CMEM_PHYS_IOBUFS, IPU_CMEM_IOBUFS,
        IPU_CMEM_IOBUFS_SIZE, 0, 0, "IPU_CMEM_IOBUFS",
    },

};

Normally I can devmem2 0x40400000 to see the results without any issues ( have been able to do this on the IPU subsystem) .  However, I am getting initialized memory after loading the PRU with the code. Does the PRU use a different addressing scheme into physical memory? Otherwise, how could I load data into CMEM via the PRU?


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>