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.

Linux/AM3352: mmap control module registers, but read random values back.

Part Number: AM3352


Tool/software: Linux

Hi, 

I mmap control module registers as following.

uint32_t fd;

fd=open("/dev/mem",O_RDWR|O_SYNC);

uint32_t * ctrlReg;

ctrlReg = (uint32_t *)mmap(NULL,0x1000,PROT_READ|PROT_WRITE, MAP_SHARED, fd,0x44E10000);

open and mmap work without error.

I read the first word from ctrlReg, it's same result as

>devmem2 0x44E10000

But besides the first 4 bytes, followings are wrong. I compared mac address at offset 0x630-0x63C, and some other random offset.

c= *(ctrlReg+0x630)

c is 0. 

>devmem2 0x44E10630  returns correct value. 

What's wrong in my code? Thanks.