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.

AM3359: USB Endpoint configuration

Part Number: AM3359

hello

every experter

This is tomiyama from tokyo.

thanks a lot for your help.

I don't know How to set a endpoint of usb_dev_serial driver to usb_core?

I try a "startware" sample to usb_dev_serial without sys.lib and usb.lib,

but I find that I could not to set endpoint adress to usb register.

I find the " Technical Reference Manual", there are only the Index of "140Eh" to be written,

I don't the base adress of the usb driver to set endoint0 buffer.

hope your help soon.

best regard

tomiyama

  • The software team have been notified. They will respond here.
  • Tomiyama,

    The USB0 EP0 base address would be in the USB0 core which is at 0x47401400.
    The USB1 core base address would be at 0x47401C00.

    Checkout the file C:\ti\pdk_am335x_1_0_9\packages\ti\drv\usb\src\musb\musb.c in the USB LLD for more information where these EP registers are at.

    USB0 and USB1 would be corresponding to USB port 0 and USB port 1, respectively.

    Lali
  • Dear Lali

    This is tomiyama from tokyo.
    Thanks your answers.
    I try to do that, but before I recive data, I have a problem to connect to PC as a device.
    I find the active RQ is UART2, not USB0 in the firmware.
    which Register should I set to Active IRQ of USB0?
    I need your help please. wait your answer.
    best regards.
    These the setup Routine of Setting:

    /* Usb Contral Module Enable */
    IOREG32(SYS_BASE,SYS_CTRL_USB_WKUP_CTRL) =0x0001;
    /* USB Control Module Enable */
    IOREG32(PRCM0_BASE,PRC_CM_WKUP_REGS(0x4)) = 0x0002;
    /* USB Control Module Soft Reset,reset in USBDCDCInit() */
    //IOREG32(USBSS_BASE,0x1014) = 0xC0000009; /* USB0CTRL */

    //
    // Not configured initially.
    //
    g_bUSBConfigured = false;

    //
    //configures arm interrupt controller to generate raster interrupt
    //
    USBInterruptEnable();

    //
    //Initialize the Rx and TX Buffers
    //
    USBBufferInit((tUSBBuffer *)&g_sTxBuffer);
    USBBufferInit((tUSBBuffer *)&g_sRxBuffer);
    /* usb_ctrl0 */
    IOREG32(SYS_BASE,SYS_CTRL_USB_CTRL(0)) = 0x3C06404;/*usb_ctrl0*/
    IOREG32(SYS_BASE,SYS_CTRL_USB_CTRL(1)) = 0x3C05007;/*usb_ctrl1*/

    IOREG32(PRCM0_BASE,0x1C) = 0x02; /* CM_PER_USB0_CLKCTRL */
    IOREG32(PRCM0_BASE,0x70) = 0x02; /* CM_PER_UART2_CLKCTRL */
    IOREG32(PRCM0_BASE,0xDC) = 0x02; /* CM_PER_L3_INSTR_CLKCTRL */
    IOREG32(PRCM0_BASE,0xE0) = 0x02; /* CM_PER_L3_INSTR_CLKCTRL */

    //IOREG32(0x44E00700,0x04) = 0x02; /* CM_MPU_MPU_CLKCTRL */

    IOREG32(SYS_BASE,0x0A1C) = 0x0F; /* conf_<module>_<pin> */

    IOREG32(USB0_BASE,0x0240) = 0x80028002; /* IRQFRAMEENABLE0 */
    IOREG32(USB0_BASE,0x1074) = 0xC0000002; /* USB0CTRL */

    IOREG32(USB0_BASE,0x1038) = 0xFFFFFFFF; /* IRQSET0 */
    IOREG32(USB0_BASE,0x103C) = 0xFFFFFFFF; /* IRQSET1 */
    IOREG32(USB0_BASE,0x1044) = 0x000003CF; /* IRQ ENABLE */
    IOREG32(USB0_BASE,0x10E8) = 0x00000180; /* USB0 待ちモード */
  • Tomiyama,

    Please refer to the other thread you have going on the same topic e2e.ti.com/.../2436995

    Lali
  • Lali
    This is tomiyama.
    thank you very much, I will try it.

    best regards
    Tomiyama
  • Lali

    This is Tomiyama From Tokyo.

    Thanks a lot of helps.

    I have connect to PC sucssesfuly. but I just use a Startware without modify.

    When I try to modify the source code, there are errors bellow.

    I could not know who use the 0x8000,0000 memory.

    could you help me ?

    I need your help.

    best regards

    Tomiyama.

    usb_dev_serial.cmd:

    MEMORY
    {
    DDR_MEM : org = 0x80000000 len = 0x7FFFFFF /* RAM */
    }

    error log:

    **** Clean-only build of configuration Debug for project usb_dev_serial ****

    "C:\\ti\\ccsv7\\utils\\bin\\gmake" -k -j 4 -s clean -O
    'Finished clean'
    ' '

    **** Build Finished ****

    **** Build of configuration Debug for project usb_dev_serial ****

    "C:\\ti\\ccsv7\\utils\\bin\\gmake" -k -j 4 -s all -O
    'Building file: C:/New Folder/examples/evmskAM335x/usb_dev_serial/usb_serial_structs.c'
    'Invoking: ARM Compiler'
    'Finished building: C:/New Folder/examples/evmskAM335x/usb_dev_serial/usb_serial_structs.c'
    ' '
    'Building file: C:/New Folder/examples/evmskAM335x/usb_dev_serial/ustdlib.c'
    'Invoking: ARM Compiler'
    'Finished building: C:/New Folder/examples/evmskAM335x/usb_dev_serial/ustdlib.c'
    ' '
    'Building file: C:/New Folder/examples/evmskAM335x/usb_dev_serial/Usb_dev_serial.c'
    'Invoking: ARM Compiler'
    "../../../../../../../include/hw/hw_lcdc.h", line 107: warning #1557-D: white space between backslash and newline in line splice ignored
    'Finished building: C:/New Folder/examples/evmskAM335x/usb_dev_serial/Usb_dev_serial.c'
    ' '
    'Building target: ../../../../../../../binary/armv7a/cgt_ccs/am335x/evmskAM335x/usb_dev_serial/usb_dev_serial.out'
    'Invoking: ARM Linker'
    <Linking>
    "../usb_dev_serial.cmd", line 78: error #10263: DDR_MEM memory range has
    already been specified
    "../usb_dev_serial.cmd", line 78: error #10264: DDR_MEM memory range overlaps
    existing memory range DDR_MEM
    "../usb_dev_serial.cmd", line 92: warning #10190-D: absolute symbol "bss_start"
    being redefined
    "../usb_dev_serial.cmd", line 93: warning #10190-D: absolute symbol "bss_end"
    being redefined
    "../usb_dev_serial.cmd", line 92: warning #10190-D: absolute symbol "bss_start"
    being redefined
    "../usb_dev_serial.cmd", line 93: warning #10190-D: absolute symbol "bss_end"
    being redefined
    "../usb_dev_serial.cmd", line 86: warning #10261-D: section specifier matches
    no sections; potential matches are consumed by section specifier at
    "../usb_dev_serial.cmd", line 86
    "../usb_dev_serial.cmd", line 91: warning #10423-D: No placement specified for
    ".bss"; a default placement will be applied.
    "../usb_dev_serial.cmd", line 92: warning #10190-D: absolute symbol "bss_start"
    being redefined
    "../usb_dev_serial.cmd", line 93: warning #10190-D: absolute symbol "bss_end"
    being redefined
    "../usb_dev_serial.cmd", line 92: warning #10272-D: section relative symbols
    from different output sections cannot be mixed; "bss_start" is in section
    ".bss", "DOT operator" is in section ".bss"
    "../usb_dev_serial.cmd", line 93: warning #10272-D: section relative symbols
    from different output sections cannot be mixed; "bss_end" is in section
    ".bss", "DOT operator" is in section ".bss"
    error #10010: errors encountered during linking;
    "../../../../../../../binary/armv7a/cgt_ccs/am335x/evmskAM335x/usb_dev_seria
    l/usb_dev_serial.out" not built
    gmake: *** [../../../../../../../binary/armv7a/cgt_ccs/am335x/evmskAM335x/usb_dev_serial/usb_dev_serial.out] Error 1

    >> Compilation failure
    makefile:143: recipe for target '../../../../../../../binary/armv7a/cgt_ccs/am335x/evmskAM335x/usb_dev_serial/usb_dev_serial.out' failed
    gmake: Target 'all' not remade because of errors.

    **** Build Finished ****
  • Tomiyama,

    Please see your .map file on where the memory region that's causing the error, is being used.
    Could you also try with the .cmd file from C:\ti\pdk_am335x_1_0_9\packages\ti\starterware\examples\gcc\am335x.lds

    Lali
  • Lali

    Thanks your answer.

    It seems OK for map file.

    Best Regards

    tomiyama.