Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

RTOS/PROCESSOR-SDK-OMAPL138: Using SRAM to share data between the ARM and DSP cores

$
0
0

Part Number:PROCESSOR-SDK-OMAPL138

Tool/software: TI-RTOS

I'm trying to use the SRAM to share data that would go between a Linux App running on the ARM and an RTOS FW on the DSP.

For the ARM side I'm trying to just constantly read the memory of the SRAM

            // Open File Descriptor of device memory
            int sram_fd = open("/dev/mem",O_RDWR | O_SYNC);

            // Get PTR to SRAM via MMAP
            char* sram_ptr = mmap(NULL, 0x00020000, PROT_READ | PROT_WRITE, MAP_SHARED, sram_fd, 0x80000000);

            // Check if MMAP worked
            if(sram_ptr == MAP_FAILED)
            {
                exit_error_handler("mmap (SRAM)");
            }

            store_clear(&store_one);
            sram_get_store(sram_ptr,&store_one);
            store_print(main_while_counter+1,&store_one);

            munmap(sram_ptr, 0x00020000);

            // Close File Descriptor for device memory
            close(sram_fd);

On the DSP Side I have a task that should just write an incrementing struct data into the memory:

static void sram_set_store(STORE* store)
{
    char* sram_mem = (char*)(0x80000000);

    const char* store_ptr = (const char*)store;

    size_t ptr_len = sizeof(store);

    for(size_t i = 0; i < ptr_len; ++i)
    {
        sram_mem[i] = store_ptr[i];
    }
}

void bios_task(UArg a0, UArg a1)
{
    //Cache_inv((void*)(uint32_t*)(0x80000000),0x00020000,Cache_Type_ALL,TRUE);

    store_increase(&store_one);
    sram_set_store(&store_one);

    Cache_wb((void*)((uint32_t*)(0x80000000)),0x00020000,Cache_Type_ALL,TRUE);
}

// Testing struct / global member
typedef struct STORE_TAG
{
    uint32_t store_set;
    uint32_t store_num;
}STORE;

STORE store_one;

The Store_increase just increases the data in the field once each loop.

At the start I set the data to be 50 in store_set and 50 in store_num.

When I read the data in the dsp, only store_set is 50 and store_num is always 0, and the data never increments as I'm doing it in the DSP.

Not sure why it only does it once or I potentially lock out the memory somehow.

Would like help on this so I can pass data back and forth.


Viewing all articles
Browse latest Browse all 17527

Trending Articles



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