Home | Projects | Notes > ARM Cortex-M3/M4 Processor > Open On-Chip Debugger (OpenOCD)

Open On-Chip Debugger (OpenOCD)

 

Downloading Executable to Target

 

downloading-executable-to-target

 

 

OpenOCD

 

Programming Adapters

 

Program Downloading Process

When Using External Programming Adapter

 

downloading-program-to-mcu-flash

 

 

downloading-program-to-mcu-flash-on-board-debugger

 

 

Steps to Download the Code Using OpenOCD

Consult the OpenOCD User's Guide for more information (e.g., commands).

  1. Download and install OpenOCD

  2. Install Telnet client (for windows you can use PuTTY software)

    If you cannot use Telnet application you can also use "GDB Client"

  3. Run OpenOCD with the board configuration file

    Full path to the board configuration file: /usr/share/openocd/scripts/board/stm32f4discovery.cfg

    Leave this terminal busy, and launch another terminal. Go to project directory and do Step 4.

  4. Connect to the OpenOCD via GDB Client or Telnet Client

    Using GDB Client:

    Keyword monitor allows you to issue OpenOCD command on GDB client. (This keyword is not necessary if you are issuing OpenOCD command on Telnet.)

    Using Telnet

    You are not bypassing GDB Client, so monitor keyword is not necessary. Just directly type in commands.

    c.f. To terminate Telnet session, Ctrl+] close.

  5. Issue commands over GDB Client or Telnet to OpenOCD to download and debug the code.

    Using GDB Client

    Using Telnet Client

Some Other Useful OpenOCD Commands

 

References

Nayak, K. (2022). Embedded Systems Programming on ARM Cortex-M3/M4 Processor [Video file]. Retrieved from https://www.udemy.com/course/embedded-system-programming-on-arm-cortex-m3m4/