|  | :orphan: | 
|  |  | 
|  | .. espressif-openocd-debugging | 
|  |  | 
|  | OpenOCD | 
|  | ======= | 
|  |  | 
|  | As with much custom hardware, the ESP32 modules require patches to | 
|  | OpenOCD that are not upstreamed yet. Espressif maintains their own fork of | 
|  | the project. The custom OpenOCD can be obtained at `OpenOCD for ESP32 <https://github.com/espressif/openocd-esp32/releases>`_. | 
|  |  | 
|  | The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the | 
|  | ``-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>`` | 
|  | parameter when building. | 
|  |  | 
|  | Here is an example for building the :zephyr:code-sample:`hello_world` application. | 
|  |  | 
|  | .. zephyr-app-commands:: | 
|  | :zephyr-app: samples/hello_world | 
|  | :board: <board> | 
|  | :goals: build flash | 
|  | :gen-args: -DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts> | 
|  |  | 
|  | You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application. | 
|  |  | 
|  | .. zephyr-app-commands:: | 
|  | :zephyr-app: samples/hello_world | 
|  | :board: <board> | 
|  | :goals: debug |