I ordered the Olimex USB-OCD-H and it will arrive tomorrow, so I am preparing myself for some challenges. My goal is to jtag / debug one of the early ChibiOS multipilot examples, something simple. 

 

Does anyone have the OpenOCD-GDB startup/debug/flash scripts and external tools configuration data (Initialization commands for Eclipse for isntance) appropriate for the STM32 that is being used on Multipilot32? I am going to use Yagarto at least for now, because all the tutorials I printed/read do so, and that is what I currently have working. 

 

Is there any anomilies with installing the FTDI Olimex drivers for OpenOCD 0.4, that any of you have encountered? I came a crossed some forum threads that said not to install the FTD2xxx driver.  

 

Thanks,

 

JimT

 

You need to be a member of FOXTEAM UAV CLAN to add comments!

Join FOXTEAM UAV CLAN

Email me when people reply –

Replies

  • Hi Jim,

     

    I have bought an OLIMEX ARM-USB-OCD.

    Drivers Installation seem OK

    Could you provide the pin-to-pin between the MP32 connector and the OLIMEX 20 pin cable (I don't want to destroy both) ?

    Thanks

    Cyrille

    • Cyrille, I have this information in detail. I hope I can attach them here!

      Credit goes to Jim for figuring this out! Thanks

      2772932903?profile=original2772933518?profile=RESIZE_1024x10242772933546?profile=RESIZE_1024x1024

      • Thanks Jan, this confirms the pin-to-pin description that I find in the web.

         

        Use OpenOCD with ECLIPSE is not a trivial task, and I spent time despite the great work of Jim (thanks Jim).

        I succeeded 1) to program MP32 with OLIMEX ARM-USB-OCD, and 2) to debug. Below some details, screenshots (purist don't be afraid...)

         

        Config :

        • ECLIPSE
        • YAGARTO GNU ARM Toolchain (GCC 4.6.2, GDB 7.3.1)
        • ChibiOS

         

        How to Program with OLIMEX ARM-USB-OCD

         

        2772932782?profile=RESIZE_1024x1024

        MP32_prog.cfg

        2772932907?profile=RESIZE_1024x1024

         

        Build your code, a .elf is generated. Run OPENOCD_Programmer. The Program will be download the MP32.

         

        How to debug with OLIMEX ARM-USB-OCD

        When I use the "Jim debug config", I obtain the message below :

        "Remote 'g' packet reply is too long : ...",  I have asked google to have some tips... So I have lokked for other config : see below

         

        1) Create an external tool for GDB

        2772932996?profile=RESIZE_1024x1024

        MP32_GDB.cfg

        2772933146?profile=original

         

         2) Debug configuration

        2772933241?profile=RESIZE_1024x1024

         2772933376?profile=RESIZE_1024x1024

         2772933561?profile=RESIZE_1024x1024

         In the Init Commands paste:

        set complaints 1
        set output-radix 16
        set input-radix 16
        set prompt (arm-gdb)
        target remote localhost:3333
        set remote memory-write-packet-size 1024
        set remote memory-write-packet-size fixed
        set remote memory-read-packet-size 1024
        set remote memory-read-packet-size fixed
        set remote hardware-watchpoint-limit 4
        set remote hardware-breakpoint-limit 6
        monitor reset
        monitor sleep 200
        monitor poll
        monitor soft_reset_halt
        monitor stm32x unlock 0
        monitor stm32x mass_erase 0
        monitor flash write_image E:\Projet\UAV\Programmes\Sources\chibios\MP32-OPENOCD\MP32-OPENOCD\MP32_OPENOCD.elf
        monitor reset
        monitor poll
        break main
        continue 

         

         

        3) Debug your program

        Run as External toolk OPENOCD_GDB

        Then run the debug (here MP32-OPENOCD Default(1))

        2772933612?profile=RESIZE_1024x1024

        This tab with "no source available for ..." will appear, you must to click Resume (F8), then the debbuger will stop a the start of the main prog. Click again on Resume and the debugger will stop on your first breakpoint.

        2772933717?profile=RESIZE_1024x1024

         

        Cyrille

         

  • Great Work JIM :)

    Best

    Roberto

  • hi, Jim, I have installed the Olimex drivers, seems no problem. But right now I am stuck in the configuration for the OpenOCD + CS +eclipse.... , if you have any news please let me know.

    Thanks,

    Stefan

    • So far my progress is a follows:

      A) Made octopus for Olimex 20 pin ARM connector -> 10p Arm Connector (on MP32) - I didn't want to ruin anything, wanted to be 100%. Had a hard time figuring out the proper pin-to-pin for this. I wasn't sure if TDI and TDO pins were supposed to be crossed (like in usart connections) is one example.  I believe I got it right. 

      2772932350?profile=RESIZE_1024x1024

       

      B) Installed the drivers for Olimex. 

      Careful here: If you use the downloadable OpenOCD .4 (as opposed to compiling OpenOCD yourself), you have to use the "libusb-win32" driver that is in the OpenOCD installation folder for the jtag component of the Olimex ARM-USB-OCD. 

      DO NOT INSTALL the ftd2xx driver from the Olimex CD for the Jtag adapter.  

      For the usb-serial port component, you can use the driver supplied by Olimex. Note, After installing the driver for the serial port, the device came up as USB-Seriel Converter and Windows threw-up another "Found New Hardware" dialog, I pointed to the same driver folder on the Olimex CD as previously done, and then Windows listed the device (refreshed it) as a "USB Seriel port. This confused me at 1st.

      The following outlines what my devices look like for the Olimex:

      2772932698?profile=RESIZE_1024x1024Properties for the Jtag (Channel A). Notice the "libusb-win32":

      2772932792?profile=RESIZE_1024x1024Properties for the USB Seriel Converter (notice "ftd2xx" driver):

      2772932911?profile=RESIZE_1024x1024and finally, the USB Serial port driver:

      2772933089?profile=RESIZE_1024x1024

       

       

      I tested both the jtag and seriel port, and have not had any issues that I can see. More below.

       

      C) Tested OpenOCD and Jtag adapter installation by running the following command from a command prompt:

      "openocd -f interface/olimex-arm-usb-ocd-h.cfg -f board/stm32f10x_128k_eval.cfg"

      the board config file: "stm32f10x_128k_eval.cfg" simply makes a reference to the target configuration file named "target/stm32.cfg".

      In other words the board config file has in it: "source [find target/stm32.cfg]".

       

      Note: I later renamed the board config file "stm32f10x_128k_eval.cfg" to "MultiPilot32.cfg".

       

      So, I ran the command noted above and got this(I hit CTRL-C) to close it afterwards:

      2772933425?profile=RESIZE_1024x1024

       

       

      In Eclispse I added OpenOCD as an external tool:

      2772932064?profile=RESIZE_1024x1024

      When I run it, it connects to OpenOCD, and gives me this (make sure you shut down the previous one 1st, IE CTRL_C):

      2772932264?profile=RESIZE_1024x1024

      I am trying to figure out the following:

       

      1) Debug Configuration (in Eclipse)

       - Initialization and run commands for FLASH and RAM

       

      2) Flash Eraser (may not need if Debug above erases??)

       

      3) How to modify Make file for RAM or FLASH debugging.

       

      If you have any insight to any of these let me know. I have scoured the net looking for information on the above items, for the STM32F103VET6 (High Density), and have come up with very little. 

       

      JimT

       

This reply was deleted.