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.

Unhandled fault: external abort on non-linefetch (0x1018) at 0x4002100c Bus error

Other Parts Discussed in Thread: OMAP3530

Hi,

I am using mmap() to map OMAP_MCSPI1_BASE (0x48098000) which is the start of the McSPI1 registers (OMAP3530 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 0x4002100c Bus error

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_MCSPI1_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.

 

Many thanks.

  • Max,

    A few questions:

    1. So this code is running on the CortexA8 of OMAP35xx?
    2. I believe you are running LInux so this is with the gcc compiler?
    3. Where do you see the "Unhandled fault: external abort on non-linefetch (0x1018) at 0x4002100c Bus error" error message?

    I don't think this is a CCS issue so I am just trying to figure out where to move the post to help you get an answer.

    Regards,

    John

  • John,

     

    This is not a CCS issue.

    1) Yes, the code is running on the Cortex A8 of OMAP 3530

    2) I am running Linux with CodeSoucery c/c++ compiler

    3) When I run the code in user space.

     

    The development board I am using is LogicPD LV SOM (Zoom).

     

    Thanks,

    Max

  • You need to make sure that the appropriate McSPI functional (CM_FCLKEN1_CORE)  and interface (CM_ICLKEN1_CORE) clocks are enabled before reading the McSPI registers.

  • Hi,

    I have also got such problems recently, such info is posted below,

    Unhandled fault: Precise External Abort on non-linefetch (0x1008) at 0x9087c070
    Internal error: : 1008 [#1]
    last sysfs file: /sys/devices/platform/omap/omap_i2c.1/i2c-1/1-0048/temp1_input
    Modules linked in: cmemk syslink
    CPU: 0    Not tainted  (2.6.37-gbb507e4 #2053)

    ......

    the pc register is among the function when I am trying to read the GPR register thru PCIe, is there any body who can give some advices? the CPU is TI81xx.

  • Hi,

    Sorry to reopen an old thread.
    I have just get the same bug with kernel 3.19.

    Did you find a solution?

    Thanks
  • Hi,

    This error:
    "Unhandled fault: external abort on non-linefetch (0x1018) at 0x4002100c Bus error"

    Points to one of two things:

    1. You don't have the module's functional clocks enabled, so you cannot read/write its configuration registers. What does devmem2 say for the same address?

    or

    2. You haven't mapped the memory space correctly. What is the value of mem_start ? see the implementation of devmem2 for reference: www.lartmaker.nl/.../devmem2.c

    Best Regards,
    Yordan
  • Hi Yordan,

    Thank you for response.

    I checked registers with devmem2. I can read/write consistent values.
    What did you mean by mem_start?
    I checked registers addres and they are ok.

    I have this error,
    "Unhandled fault: external abort on non-linefetch (0x1008) at 0xf0060510
    Internal error: Oops - BUG: 1008 [#1] ARM".

    Error appears when i clear the "reset for the active domain DSP".
    All registers, clock and memory are configured before this operation.

    Thanks and regards,
  • Hello,

    I have the same issue.

    Does anyone have any idea how to resolve it ?

    Thanks,

    Ran

  • issue been resolved.
    clks were enabled in u-boot, but not in kernel.

    val = *(volatile U32 *)CM_FCLKEN1_CORE;
    val |=(OMAP35XX_EN_MCSPI1 | OMAP35XX_EN_MCSPI2 | OMAP35XX_EN_MCSPI3 | OMAP35XX_EN_MCSPI4);
    *(volatile U32 *)CM_FCLKEN1_CORE = val;

    val = *(volatile U32 *)CM_ICLKEN1_CORE;
    val |=(OMAP35XX_EN_MCSPI1 | OMAP35XX_EN_MCSPI2 | OMAP35XX_EN_MCSPI3 | OMAP35XX_EN_MCSPI4);
    *(volatile U32 *)CM_ICLKEN1_CORE = val;


    thank you,
    Ran
  • Hi Ran,

    Recently I ran into the same issue with the IPC registers in my ARM in C6614 board. Can you provide the details of the procedure you followed on how you achieved it? can I enable the same in a sample code written in ARM or I have to do the kernel modifications?

    Thanks in advance

    Regards,

    Christopher

  • Hi Chris,

    I would advise to check first which register you try to access. Is it the same register as I tried (spi), or something else ?
    Say, it's some X register in device.
    I would try to look in datasheet which module is responsible for that device.
    And then I will try to check how to enable the device (search for clocks/or power register).
    When you got the (power) registers address, then it will be just a matter of writing the enable value into these registers.

    Thanks,
    Ran