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.

Segmentation Fault

Other Parts Discussed in Thread: AM1707

Hi,

I have adapted y used the source code of "sw_am17x" (See the Post in http://e2e.ti.com/support/embedded/starterware/f/790/p/151682/569258.aspx#569258)  to control the HCUSB 1.1 Interrupts. I can compile my aplication with no errors, but when I run it, a "Segmentation Fault" message is printed  in the console. I have debugged it using gdb, and this fault occurs in the next call to HWREG macro:

HWREG(SOC_AINTC_0_REGS + AINTC_ECR(cnt)) = AINTC_ECR_DISABLE;

The application runs over a Linux 3.3 embedded in a OMAP L 137, which ARM core is identical to the AM1707 and the register addesses are the same.

My questions are, can not I use that macro from user space? Must I use a module for accessing to registers?

How could I solve this problem? Any idea?

  • Hi,

    If you want to access the register then you have to use kernel module driver for that task.

    We have to do "ioremap" to that MMR register before access.

    Ex:

    unsigned int *usb_reg;

    usb_reg = ioremap(AINTC_BASE+OFFSET,size);

  • Not sure if I can help. I am curious why you don't use the OHCI driver in linux. Porting bare metal StarterWare code to linux seems like a lot of needless work.

  • I already use the OHCI driver in Linux. The problem is this driver doesn't manage the USB Interrupts, I mean, it seems only manages data transfers. In the "menuconfig", you only can enable/disable the OHCI driver, but there isn't any option to enable/disable the Interrupts management.

    On the other hand, the OHCI driver neither provides any API to manage the USB Interrupts from user space. So it seems necessary to implement a module (.ko) which accesses to the necessary registers and some API which allows us configuring, enabling and managing the USB Host interrupts from user space  

  • Hi Enrique,

    I'm curious about your USB interrupt programming in user space and one more thing that it was worked earlier kernel right ?

    If you enabled OHCI support for USB1.1 then that driver would take care of everything including interrupt stuff.

    I have adapted y used the source code of "sw_am17x" (See the Post in http://e2e.ti.com/support/embedded/starterware/f/790/p/151682/569258.aspx#569258)

    Actually the attached code in that project is, bare-metal code ie it is non-OS code which is called as Starterware.

    What is your intention from user space, doing USB stuff ?

  • Please clarify what you mean by interrupt management. Please give an example usage.