]> granicus.if.org Git - esp-idf/commitdiff
docs: Flashing over JTAG was added
authorAlexey Gerenkov <alexey@espressif.com>
Sat, 15 Jul 2017 14:59:11 +0000 (17:59 +0300)
committerIvan Grokhotkov <ivan@espressif.com>
Wed, 26 Jul 2017 06:53:48 +0000 (14:53 +0800)
docs/api-guides/jtag-debugging/index.rst
docs/api-guides/jtag-debugging/using-debugger.rst

index dc664526c3dfc173f647ea31f7913235471a8e9d..3d9bf541dcc7ff7b872b888d09f377c69f6aa3db 100644 (file)
@@ -61,8 +61,6 @@ Debugging using JTAG and application loading / monitoring is integrated under th
 
 If the :doc:`ESP32 WROVER KIT <../../hw-reference/modules-and-boards>` is used, then connection from PC to ESP32 is done effectively with a single USB cable thanks to FT2232H chip installed on WROVER, which provides two USB channels, one for JTAG and the second for JTAG connection.
 
-Loading of application over JTAG connection is not yet implemented.
-
 Depending on user preferences, both `debugger` and `make` can be operated directly from terminal / command line, instead from Eclipse.
 
 
@@ -191,11 +189,25 @@ You should now see similar output (this log is for ESP32 WROVER KIT)::
 * If you see JTAG errors (...all ones/...all zeroes) please check your connections, whether no other signals are connected to JTAG besides ESP32's pins, and see if everything is powered on.
 
 
+.. _jtag-upload-app-debug:
+
 Upload application for debugging
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Build and upload your application to ESP32 as usual, see :ref:`get-started-build-flash`.
 
+Another option is to write application image to flash using OpenOCD via JTAG with commands like this::
+
+    cd ~/esp/openocd-esp32
+    bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "program_esp32 filename.bin 0x10000 verify exit"
+
+OpenOCD flashing command ``program_esp32`` has the following format ``program_esp32 <image_file> <offset> [verify] [reset] [exit]``.
+ - ``image_file`` - path to program image file
+ - ``offset`` - offset in flash bank to write image
+ - ``verify`` - Optional. Verify written flash contents after writing.
+ - ``reset`` - Optional. Reset target after programing.
+ - ``exit`` - Optional. Finally exit OpenOCD.
+
 You are now ready to start application debugging. Follow steps described in section below.
 
 
index effb82c57f78b3bebbdf21e61e5a5bb5ea5f9ea0..72151ae0842b969d03c2ed4e59c664ae43e084f0 100644 (file)
@@ -50,6 +50,15 @@ Once installation is complete, configure debugging session following steps below
 
 8.  The last tab to that requires changing of default configuration is "Startup". Under "Initialization Commands" uncheck "Reset and Delay (seconds)" and "Halt"". Then, in entry field below, type ``mon reset halt`` and ``x $a1=0`` (in two separate lines).
 
+    .. note::
+        If you want to update image in the flash automatically before starting new debug session add the following lines of commands at the beginning of "Initialization Commands" textbox::
+
+            mon reset halt
+            mon program_esp32 ${workspace_loc:blink/build/blink.bin} 0x10000 verify
+
+
+    For description of ``program_esp32`` command see :ref:`jtag-upload-app-debug`.
+
 9.  Under "Load Image and Symbols" uncheck "Load image" option. 
 
 10. Further down on the same tab, establish an initial breakpoint to halt CPUs after they are reset by debugger. The plugin will set this breakpoint at the beginning of the function entered under "Set break point at:". Checkout this option and enter ``app_main`` in provided field.