Connect with us

OpenOCD JTAG

Discussion in 'Microcontrollers, Programming and IoT' started by saripitu, Aug 2, 2011.

  1. saripitu

    saripitu

    26
    0
    Jul 12, 2011
    Hello, I am trying to install the new Olimex ARM-USB-OCD that I have bought but for some reason its giving me errors. I got the FTDI drivers and installed them:

    cd libftd2xx0.4.16
    ./configure
    make
    sudo make install

    Then I installed OpenOCD:

    cd openocd-0.1.0/
    ./configure --enable-rlink --enable-ft2232_ftd2xx --with-ftd2xx-linux-tardir=../libftd2xx0.4.16/
    make
    sudo make install

    Then I made a udev file since it was what one of the webpages suggested:

    sudo nano /etc/udev/rules.d/45-ft2232.rules

    With the content:

    BUS!=“usb”, ACTION!=“add”, SUBSYSTEM!==“usb_device”, GOTO=“kcontrol_rules_end”

    SYSFS{idProduct}="0003", SYSFS{idVendor}=“15ba”, MODE=“664”, GROUP=“plugdev”
    LABEL=“kcontrol_rules_end”

    /etc/init.d/udev reload

    Then I tried to run it:

    sudo openocd -f /usr/local/lib/openocd/interface/olimex-arm-usb-ocd.cfg -f /usr/local/lib/openocd/board/stm32f10x_128k_eval.cfg

    And I am getting :

    Open On-Chip Debugger 0.1.0 (2011-08-02-12:30) Release


    BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS


    $URL: https://[email protected]/svnroot/repos/openocd/tags/openocd-0.1.0/src/openocd.c $
    500 kHz
    Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)
    Info : JTAG Tap/device matched
    Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (Manufacturer: 0x020, Part: 0x6410, Version: 0x1)
    Info : JTAG Tap/device matched
    Warn : no telnet port specified, using default port 4444
    Error: couldn't bind to socket: Address already in use

    How do I solve this? Have I done something wrong? I am quite new with this so any help is welcome! Thanks!
     
  2. saripitu

    saripitu

    26
    0
    Jul 12, 2011
    Hehe, I just found the solution, I had to change in stm32.cfg the flash bank to flash bank stm32x 0×08000000 0×20000 0 0 0

    :$
     
  3. saripitu

    saripitu

    26
    0
    Jul 12, 2011
    Hi again! I manage to get the same error as before and now I cant solve it...any ideas?

    [email protected]:~$ sudo openocd -f interface/arm-usb-ocd.cfg -f target/stm32f1x.cfg
    Open On-Chip Debugger 0.5.0-dev-00973-g0d7a948 (2011-08-05-11:08)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.berlios.de/doc/doxygen/bugs.html
    Info : only one transport option; autoselect 'jtag'
    1000 kHz
    adapter_nsrst_delay: 100
    jtag_ntrst_delay: 100
    cortex_m3 reset_config sysresetreq
    Error: couldn't bind to socket: Address already in use

    Thanks
     
  4. ikansw

    ikansw

    4
    0
    Aug 8, 2011
    The error is "Error: couldn't bind to socket: Address already in use" and it is complaining of TCP port 4444 being occupied by some other program. Your solution is to find that program, stop it, wait for the port to quieten down and be free again, or alternatively change the configuration (the cfg file, by specifying a "telnet_port" directive within) to use another port which may be free.

    A useful command to diagnose further is:

    netstat -antp | grep 4444

    If port 4444 is being grabbed by another instance of openocd you will come to know.

    Good luck :)

     
  5. saripitu

    saripitu

    26
    0
    Jul 12, 2011
    Thanks Ikansw! i tried the netstat -antp | grep 4444 and all I get is

    [email protected]:~$ sudo netstat -antp|grep 4444
    tcp 0 0 0.0.0.0:4444 0.0.0.0:* LISTEN 1635/openocd 7

    is that bad??
    If i turn the laptop off for more than 10 seconds it allows me to run it once and I get:

    [email protected]:~$ sudo openocd -f interface/arm-usb-ocd.cfg -f target/stm32f1x.cfg
    Open On-Chip Debugger 0.5.0-dev-00973-g0d7a948 (2011-08-05-11:08)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.berlios.de/doc/doxygen/bugs.html
    Info : only one transport option; autoselect 'jtag'
    1000 kHz
    adapter_nsrst_delay: 100
    jtag_ntrst_delay: 100
    cortex_m3 reset_config sysresetreq
    Info : clock speed 1000 kHz
    Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
    Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
    Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints
    and it stops there...any ideas what that could mean??
    Sorry i am very new to openocd and olimex!!

    Thanks again!
     
  6. saripitu

    saripitu

    26
    0
    Jul 12, 2011
    Now, when i try to compile to program into the board i get this:

    Open On-Chip Debugger 0.5.0-dev-00973-g0d7a948 (2011-08-05-11:08)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.berlios.de/doc/doxygen/bugs.html
    Info : only one transport option; autoselect 'jtag'
    1000 kHz
    adapter_nsrst_delay: 100
    jtag_ntrst_delay: 100
    cortex_m3 reset_config sysresetreq
    Info : clock speed 1000 kHz
    Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
    Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
    Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints
    Info : accepting 'telnet' connection from 4444
    Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
    Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
    target state: halted
    target halted due to debug-request, current mode: Thread
    xPSR: 0x61000000 pc: 0x08005534 msp: 0x200013d8
    invalid command name "quit"
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
    Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Info : accepting 'telnet' connection from 4444
    Info : dropped 'telnet' connection
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 100ms
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 300ms
    Polling succeeded again
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 100ms
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 300ms
    Polling succeeded again
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 100ms
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 300ms
    Polling succeeded again
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 100ms
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 300ms
    Polling succeeded again
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 100ms
    Error: ftdi_write_data: usb bulk write failed
    Error: couldn't write MPSSE commands to FT2232
    Polling target failed, GDB will be halted. Polling again in 300ms
    Polling succeeded again

    Any ideas what can I do now?? What kind of info would you need to solve this?? Thanks again!
     
  7. kld_555

    kld_555

    1
    0
    Nov 16, 2011
    Hi,

    How did you get it to pass the "Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints" stopping problem?! mine stops there as well!
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-