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/LINUXEZSDK-SITARA: PRU memory access ends with Bus Error

Part Number: LINUXEZSDK-SITARA
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Linux

Hello together,

I’m running in an issue trying to access the pruss memory after a Linux kernel update from 3.12.31 to 4.9.98.

Memory access failed with a following bus error message from the OS.

I’ve read that this could be a clock issue, but the clocks are enabled. Further the CAN Intarfeces work fine.

Can anyone please help me?

Many Thanks in advance!

 

Here is the output:

 

#cat /sys/class/uio/uio0/maps/map0/addr

0x4a300000

# devmem2 0x4a300000

/dev/mem opened.

Memory mapped at address 0xb6f4a[84070.399007] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6f4a000

[84070.410656] pgd = eefac000

[84070.413509] [b6f4a000] *pgd=be922831

000.

[84070.422431] audit: type=1701 audit(1533278418.620:8): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=262 comm="devmem2" exe="/usr/bin/devmem2" sig=7

Bus error (core dumped)

 

  • Hello Dimitar,

    LinuxEZ SDK has not been supported for years.

    * Could you clarify what version of Linux you have upgraded to?
    * is the issue only with using devmem2, or are you running into other issues?

    Regards,
    Nick
  • Hello Nick,

    thank you for your reply.

    We devellopped 3 years ago our custom board based on SITARA.  The former Linux kernel version was 3.12.31, the BSP based on yocto, and our application uses EtherCAT.

    The issue occurs not only with devmem, but also with our application.

    I have downloaded the TI Linux SDK yesterday and saw that, there is a difference in the pruss-driver.

    The old one states:

    ------------------------------

    #ifdef CONFIG_ARCH_DAVINCI_DA850
        /* Power on PRU in case its not done as part of boot-loader */
        gdev->pruss_clk = clk_get(&dev->dev, "pruss");
        if (IS_ERR(gdev->pruss_clk)) {
            dev_err(&dev->dev, "Failed to get clock\n");
            ret = PTR_ERR(gdev->pruss_clk);
            kfree(gdev->info);
            kfree(gdev);
            return ret;
        } else {
            clk_enable(gdev->pruss_clk);
        }
    #endif

    and the currtent:

    ------------------------------

        /* Enable clock for the module */
        uio_module_drv->clk = clk_get(dev, NULL);
        if (IS_ERR(uio_module_drv->clk))
            uio_module_drv->clk = NULL;

    Could this be the reason? I mean the davinchi option is not enabled on the old kernel.

     

    Regards

    Dimitar

  • Hello Dimitar,

    The devmem2 error "Unhandled fault: external abort on non-linefetch" usually means that the clock for whatever address you were trying to read has not been enabled (e.g., trying to read/write ADC values before you turn on the clock that powers the ADC). It might also mean you haven't mapped the memory space correctly, but I have not seen that yet myself.

    0x4a300000 is the address of the start of the PRU-ICSS registers, so I would suspect your PRU clocks are not actually getting turned on.

    Regards,
    Nick
  • Hi Nick,

    I think also that the clocks are turned on. But I cannot find the place in source where they can be enabled explicitly. As I mentioned with Kernel 3.12 I don't have the problem.

    How can be the clock enabled? In dts file, or in the PRUs driver, or the kernel config?

    Regards

    Dimitar

     

     

     

  • Hello Dimitar,

    I am sorry for the delay. It does not look like I can help further. We still include a version of UIO in the SDK, but we do not currently support UIO on these forums. Perhaps the beaglebone forums would be useful in figuring out how to properly initialize PRU-ICSS with UIO.

    Regards,
    Nick

  • Hello Nick,
    it’s ok.

    If we switch to the TI-SDK “PROCESSOR-SDK-LINUX-RT-AM335X 05_01_00_11” and avoid using the UIO interface, could we get support from this forum?
    Meanwhile I had a look in the SDK und would like to ask, if the SDK provided support and firmware for the EtherCAT? I was not able to find the EtharCAT firmware in the SDK package.
    Are there any examples as a start point for an EtherCAT- Application based on the new driver concept (RemoteProc and RPMsg)? I can remember that in the past there were some very good in the SYSBIOS Package.

    Regards,
    Dimitar
  • Hello Dimitar,

    Are you looking for EtherCAT master or slave?

    * The Industrial Communication Protocols Supported on Sitara™ Processors app note says EtherCAT master is supported, but I am still looking for resources on running EtherCAT master in Linux.

    * The Processor SDK Jailhouse Hypervisor wiki page shows a way to run EtherCAT slave using jailhouse hypervisor. I do not think we have a way to directly run EtherCAT slave on Linux, but if I hear differently I will let you know.

    Regards,

    Nick

  • Hello Dimitar,

    Would the ICSS EMAC_LLD driver fit your needs for getting your EtherCAT stack to work with the PRU? Take a look at Processor SDK Linux ICSS-EMAC User Space and the ICSS_EMAC_LLD Developers guide.

    Regards,

    Nick

  • Hello Dimitar,

    I hope things got resolved. I am going to close the ticket for now unless additional questions pop up on your side.

    Regards,
    Nick