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.

OMAP-L138: Exchange data between ARM(Linux) - DSP (bare-metal) (cont.)

Hi,
I've leveraged the quickStartOMAPL1x_rCSL project and implemented the DSP side code sharing memory at SHARED_CPU_VARS_MEM 0x8001FC00 (sharedCpuVars.h).
At the ARM side I run Linux user space utility that mmaps this shared memory, reads and writes data. 
The issue is that this utility successfully reads data, but cannot write. My guess is that there is no coherency between the sides. I don't see any section defined for SHARED_CPU_VARS_MEM in quickStartOMAPL1x_rCSL examples. 
What are the solutions for this issue? Is there a way to flush/invalidate cache from user space?
Below is the user space code I run.
Thanks,
Aviv

typedef struct {
Uint32 cnt;
Uint32 rxpshptr; //Rx Fifo psh ptr
Uint32 rxpopptr; //Rx Fifo pop ptr
Uint32 rxfifo16; //Rx Fifo
Uint32 overflow;
} SHARED_DSP_ARM_DATA;

SHARED_DSP_ARM_DATA *sd_ptr;

int main(int argc, char *argv[]) {
if (argc < 2) {
printf("Usage: %s <phys_addr> \n", argv0);
return 0;
}

off_t offset = strtoul(argv[1], NULL, 16);
//size_t len = strtoul(argv[2], NULL, 16);
size_t len = sizeof(SHARED_DSP_ARM_DATA);
// Truncate offset to a multiple of the page size, or mmap will fail.
size_t pagesize = sysconf(_SC_PAGE_SIZE);
off_t page_base = (offset / pagesize) * pagesize;
off_t page_offset = offset - page_base;
int fd = open("/dev/mem", O_RDWR | O_SYNC);
unsigned char *mem = (unsigned char *)mmap(NULL, page_offset + len, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, page_base);
if (mem == MAP_FAILED) {
perror("Can't map memory");
return -1;
}
sd_ptr = (SHARED_DSP_ARM_DATA *)&(mem[page_offset]);
printf("1:cnt 0x%08x rxpshptr 0x%08x rxpopptr 0x%08x overflow 0x%08x\n", sd_ptr->cnt , sd_ptr->rxpshptr, sd_ptr->rxpopptr, sd_ptr->overflow);
sd_ptr->rxpopptr += 1;
sd_ptr->overflow = 0;
printf("2:cnt 0x%08x rxpshptr 0x%08x rxpopptr 0x%08x overflow 0x%08x", sd_ptr->cnt , sd_ptr->rxpshptr, sd_ptr->rxpopptr, sd_ptr->overflow);
printf("\n\n");
return 0;
}