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.

USB Device not recognized

Other Parts Discussed in Thread: SYSBIOS

  I am using F28M35H52C1 controller, ccs  v5.5.0.00077, TI-RTOS 1.21.0.09. My main goal is to add communication with PC via USB and TCP/IP to the TI-RTOS project developed by another programmer.

  First I found tcp_echo (uses NDK) and usbserial TI-RTOS examples and they both worked fine. Then I created test project, that uses both USB-COM and NDK and it also worked.  After that I added USB-COM transmission to the target project (the project, that was handed to me from another programmer) - also successfully.

  But when after adding USB-COM I try to add TCP/IP and EMAC modules I encountered the following problem: the project compiles, loads and starts but in about 5-10 seconds after that there is a following message on PC: "USB Device not recognized: One of the devices attached to this computer has malfunctioned and windows does not recognize it."

  How can it be that just adding TCP/IP and EMAC modules causes the error?

  The project uses the following modules besides those already mentioned: UART Monitor, SYS/BIOS,  FATFS, GPIO, I2C, SDSPI, UART. The complete configuration file is in the attachment.

empty.cfg
  • Did you get any memory allocation errors (look in Tools->ROV->SysMin or the CCS console).

    Can you export the entire project and post it?

    Todd

  •         Good day, Todd.

      There were no errors in the console after the project had been started. However I guess my error is indeed a memory issue.

      I've set in TMDXDOCKH52C1.cmd file:

        C03SRAM (RWX)   : origin = 0x20000000, length = 0x16000
    //  S07SHRAM (RWX)  : origin = 0x20008000, length = 0x10000
         ...
        .bss        : > C03SRAM

      In the successfully functioning project that was different:
     
        C03SRAM (RWX)   : origin = 0x20000000, length = 0x8000
        S07SHRAM (RWX)  : origin = 0x20008000, length = 0x10000
        ...
        .bss        : >> C03SRAM | S07SHRAM

      And when I adjusted memory as it was in that successful project I really got an error at run time, yet without the appropriate message in the console. From error log tab:

    An exception stack trace is not available.

    NLS missing message: DisassemblyPreferencePage_showCodeBytes in:     org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyMessages

      Here is assembly, that was outlined:

    00222686:   B94A     CBNZ            R2, $C$L2
    00222688:   682A     LDR             R2, [R5]
    0022268a:   B152     CBZ             R2, $C$L4
    0022268c:   780A     LDRB            R2, [R1]
    0022268e:   F8553022 LDR.W           R3, [R5, R2, LSL #2]
    00222692:   1C4A     ADDS            R2, R1, #1
    00222694:   4601     MOV             R1, R0
    00222696:   4610     MOV             R0, R2
    00222698:   4798     BLX             R3
    0022269a:   E001     B               $C$L3
              $C$L2:
    0022269c:   F7F9FE2E BL              memcpy
              $C$L3:
    002226a0:   8873     LDRH            R3, [R6, #2]
              $C$L4:
    002226a2:   1C64     ADDS            R4, R4, #1
    002226a4:   B2A4     UXTH            R4, R4
              $C$L5:
    002226a6:   42A3     CMP             R3, R4
    002226a8:   DCE6     BGT             $C$L1
    002226aa:   BD70     POP             {R4, R5, R6, PC}
              $C$CON1:
    002226ac:   8F54     LDRH            R4, [R2, #58]
    002226ae:   0022     LSLS            R2, R4, #0
              C$$EXIT, loader_exit:
    002226b0:   BF00     NOP
    002226b2:   4770     BX              R14
              abort:
    002226b4:   B508     PUSH            {R3, LR}
    002226b6:   F7FFFFFB BL              loader_exit

      I've attached two projects in the archive :

      MyProj1_M3_prev - the project I want to make functioning correctly.

      MyTcpEcho - my reference project that perfoms desirable actions.

    ws_complex.zip
  • Unfortunately I could not get your project to build. On the one that is failing, is there any output on the Tools->ROV for the "Scan for errors..." when you select BIOS?

    Todd

  •   Unfortunately I've got no errors when I selected Tools->ROV->BIOS, "Scan for errors..." tab. The only message is just like "target is running".

      Here is how you can hopefully build my project from scratch.

      * Choose "New project".

      * Select F28M35H52C1 controller and ARM processor (screen1 from the attachment)..

      * Choose "TI-RTOS typical project" (screen1). Click Next.

      * In the next window choose TI-RTOS product (v.1.21.0.09 in my case), XDAIS (7.21.1.07) (screen2). Just to notice: I use XDCtools version: 3.25.4.88.

      * Replace empty.cfg in the project root with that from the project attached to this message.

      * Delete empty.c and three files TMDXDOCKH52C1.* from the project root.

      * Add to the project My_code folder from the attached project.

      After all these steps are done, the project, I hope, should be built succesfully. And when you start this project you should get the error specified in this thread title.

    proj&screens.zip
  • I'll try your steps.

    ROV only works when you halt the target.

    Todd

  • I was informed by my fellow developer, that I cannot exceed margin of 8000 in C03SRAM.

    C03SRAM (RWX)   : origin = 0x20000000, length = 0x8000

    It is also impossible to use S07SHRAM since it is used for C to M data transport.

    He also noted that the problem is NDK module that tries to use too much space - at about 60K. And to solve this problem we need to lower ndk TCP and UDP buffers and also to lower BIOS heap size.

    I've tried to lower a number of memory settings.

    number of frames 8 -> 4
    frame buffer size 1536 -> 1024
    number of pages 4 -> 2
    Page size 3072 -> 1024
    memory 4096 -> 1024
    program 4096 -> 1024
    tcp buffers sizes 2048 -> 1024
    udp receive buffer size 2048 -> 1024
    program stack size 4096 -> 1024

    Now the project compiles with C03SRAM (RWX)   : origin = 0x20000000, length = 0x8000 (previously it only did with length = 0x12000 which is not acceptable as it turned out). But when I loaded the project I've got the following message in the console.

    [Cortex_M3_0] 00000.000 NodeNew: OOM
    00000.000 NodeNew: OOM
    00000.000 NodeNew: OOM
    00000.000 NodeInit: OOM
    ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0x20006a68, size=2048
    xdc.runtime.Error.raise: terminating execution

  • The NDK is trying to allocate some memory during initialization. Can you attach your map file and new .cfg file?

  • I suppose that the problem is to lower the memory consumption of NDK framework. I tried to narrow the NDK memory settings (see screen in the attachment), but still without success.

    ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0x20006668, size=2048
    xdc.runtime.Error.raise: terminating execution

    map&cfg.zip
  • I returned to this problem after some time and solved it. The problem was indeed memory consumption and memory mapping.