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: Linux/OMAP3352: Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6f5c000

Tool/software: Linux

Hi,

I am using mmap() to map OMAP_I2C1_BASE (0x4802a000) which is the start of the I2C1 registers (OMAP3352 running Linux). mmap works fine if I don't access any of the registers. But when I try to print out the register values I got

 Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6f5c000

I have seen some posts which had the same issue but I haven't seen any reply or solutions to it. Any help and suggestion would be appreciated.

 

Here is the code:

    fd = open("/dev/mem", O_RDWR);
    if (fd == -1)
    {
        printf("open() failed!\n");
        return -1;
    }

    mmap_addr = mmap(NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd,mem_start);
    if (mmap_addr == MAP_FAILED) {
            printf("gpio mmap() failed!\n");
            exit(1);
    }

    ptr = (unsigned int *)(mmap_addr) ;
    printf(" 0x%08x mapped to %p (%p)\n", OMAP_I2C1_BASE, mmap_addr, ptr) ;
    
    ptr+=4 ; // start from SCR register print out the register values
    printf("%p 0x08x\n", ptr, *ptr) ; ptr ++ ;   
    printf("%p 0x08x\n", ptr, *ptr) ; ptr ++ ;  

    ...

 I tried similar code to map the GPIO registers, it works fine and I can do read/write with the registers.