text: (window.webpackJsonp=window.webpackJsonp||[]).push([[272],{2389:function(t,e,r){"use strict";r.r(e);var o=r(18),a=Object(o.a)({},(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("h1",{attrs:{id:"swd-jtag-hardware-debugging-interface"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#swd-jtag-hardware-debugging-interface"}},[t._v("#")]),t._v(" SWD (JTAG) Hardware Debugging Interface")]),t._v(" "),o("p",[t._v("PX4 usually runs on autopilot controller hardware that provides an ARM "),o("em",[t._v("Serial Wire Debug (SWD)")]),t._v(" interface. SWD is a low pin-count physical interface for JTAG debugging on ARM-processors. It can be used with an SWD-compatible debug probe (e.g. "),o("a",{attrs:{href:"#segger_jlink_edu_mini"}},[t._v("Segger J-Link EDU Mini")]),t._v(", "),o("a",{attrs:{href:"#dronecode_probe"}},[t._v("Dronecode Probe")]),t._v(", etc.) to set breakpoints in PX4 and step through the code running on a real device.")]),t._v(" "),o("p",[t._v("The SWD interface can also be used to add a new bootloader and/or firmware on a completely empty board (one that does not have the USB bootloader installed).")]),t._v(" "),o("p",[t._v("This topic explains how to connect the SWD interface on different boards (actually performing debugging is then covered in the associated "),o("a",{attrs:{href:"#debugging_topics"}},[t._v("debugging topics")]),t._v(").")]),t._v(" "),o("p",[o("a",{attrs:{id:"swd_interface"}})]),t._v(" "),o("h2",{attrs:{id:"swd-interface-definition"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#swd-interface-definition"}},[t._v("#")]),t._v(" SWD Interface Definition")]),t._v(" "),o("p",[t._v("The SWD interface consists of the following pins.")]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("针脚")]),t._v(" "),o("th",[t._v("Signal Type")]),t._v(" "),o("th",[t._v("参数描述")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[o("code",[t._v("参考压")])]),t._v(" "),o("td",[t._v("输出")]),t._v(" "),o("td",[t._v("Target reference voltage."),o("br"),t._v("Some JTAG adapters require the "),o("code",[t._v("Vref")]),t._v(" voltage to set the voltage on the SWD lines. For example, "),o("a",{attrs:{href:"#segger_jlink_edu_mini"}},[t._v("SEGGER J-Link Debug Probes")]),t._v(" require "),o("code",[t._v("Vref")]),t._v(".")])]),t._v(" "),o("tr",[o("td",[o("code",[t._v("SWDIO")])]),t._v(" "),o("td",[t._v("I/O")]),t._v(" "),o("td",[t._v("Single bi-directional data pin.")])]),t._v(" "),o("tr",[o("td",[o("code",[t._v("SWCLK")])]),t._v(" "),o("td",[t._v("输出")]),t._v(" "),o("td",[t._v("Clock signal.")])]),t._v(" "),o("tr",[o("td",[o("code",[t._v("GND")])]),t._v(" "),o("td",[t._v("-")]),t._v(" "),o("td",[t._v("Ground pin.")])])])]),t._v(" "),o("p",[t._v('While not "part" of SWD, an autopilot may also have an '),o("em",[t._v("Serial Wire Output (SWO)")]),t._v(" trace output pin. If present this should also be connected.")]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("针脚")]),t._v(" "),o("th",[t._v("Signal Type")]),t._v(" "),o("th",[t._v("参数描述")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[o("code",[t._v("SWO")])]),t._v(" "),o("td",[t._v("输出")]),t._v(" "),o("td",[t._v("Serial  Wire Output trace output pin. This may be used in combination with "),o("em",[t._v("SWD")]),t._v(" to emit real-time trace data.")])])])]),t._v(" "),o("h2",{attrs:{id:"connecting-swd-debuggers-to-px4-hardware"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#connecting-swd-debuggers-to-px4-hardware"}},[t._v("#")]),t._v(" Connecting SWD Debuggers to PX4 Hardware")]),t._v(" "),o("p",[t._v("Connect "),o("code",[t._v("SWDIO")]),t._v(", "),o("code",[t._v("SWCLK")]),t._v(" and "),o("code",[t._v("GND")]),t._v(" pins on the debug probe to the corresponding pins on the autopilot.")]),t._v(" "),o("p",[t._v("In addition:")]),t._v(" "),o("ul",[o("li",[t._v("Connect the "),o("code",[t._v("VRef")]),t._v(" pin, if required by the debug adapter that is being used.")]),t._v(" "),o("li",[t._v("Connect the "),o("code",[t._v("SWO")]),t._v(" pin, if present.")])]),t._v(" "),o("p",[t._v("Some SWD "),o("a",{attrs:{href:"#debug_probes"}},[t._v("debug probes")]),t._v(" come with adapters/cables for connecting to common Pixhawk "),o("a",{attrs:{href:"#debug_ports"}},[t._v("debug ports")]),t._v(". You can also create custom cables for connecting to different boards or probes.")]),t._v(" "),o("div",{staticClass:"custom-block note"},[o("p",{staticClass:"custom-block-title"},[t._v("注解")]),t._v(" "),o("p",[t._v("Some manufacturers provide cables to make it easy to connect the SWD interface and "),o("RouterLink",{attrs:{to:"/zh/debug/system_console.html"}},[t._v("System Console")]),t._v(". For example the "),o("RouterLink",{attrs:{to:"/zh/flight_controller/cuav_v5_nano.html#debug_port"}},[t._v("CUAV V5nano")]),t._v(" and "),o("RouterLink",{attrs:{to:"/zh/flight_controller/cuav_v5_plus.html#debug-port"}},[t._v("CUAV V5+")]),t._v(" include this debug cable:")],1),t._v(" "),o("p",[o("img",{attrs:{src:r(675),alt:"6-pin JST SH Cable"}})])]),t._v(" "),o("div",{staticClass:"custom-block tip"},[o("p",{staticClass:"custom-block-title"},[t._v("提示")]),t._v(" "),o("p",[t._v("Where possible, we highly recommend that you create or obtain an adapter board rather than custom cables for connecting to SWD/JTAG debuggers and computers. This reduces the risk or poor wiring contributing to debugging problems, and has the benefit that adapters usually provide a common interface for connecting to multiple popular flight controller boards.")])]),t._v(" "),o("p",[o("a",{attrs:{id:"debug_ports"}})]),t._v(" "),o("h2",{attrs:{id:"autopilot-debug-ports"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#autopilot-debug-ports"}},[t._v("#")]),t._v(" Autopilot Debug Ports")]),t._v(" "),o("p",[t._v("Flight controllers commonly provide a debug port that exposes both the "),o("a",{attrs:{href:"#swd_interface"}},[t._v("SWD Interface")]),t._v(" and "),o("RouterLink",{attrs:{to:"/zh/debug/system_console.html"}},[t._v("System Console")]),t._v(".")],1),t._v(" "),o("p",[t._v("The "),o("a",{attrs:{href:"#pixhawk_standard_debug_ports"}},[t._v("Pixhawk Connector Standards")]),t._v(" attempts to standardise this port. However since many boards use different pinouts or connectors, we recommend you check the documentation for your autopilot to confirm port location and pinout.")]),t._v(" "),o("p",[t._v("The debug port location and pinouts for a small subset of autopilots are linked below:")]),t._v(" "),o("p",[o("span",{attrs:{id:"port_information"}})]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("飞控")]),t._v(" "),o("th",[t._v("Connector")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[o("RouterLink",{attrs:{to:"/zh/flight_controller/pixhawk.html#swd-port"}},[t._v("3DR Pixhawk")])],1),t._v(" "),o("td",[t._v("ARM 10-pin JTAG Connector (also used for FMUv2 boards including: "),o("em",[t._v("mRo Pixhawk")]),t._v(", "),o("em",[t._v("HobbyKing HKPilot32")]),t._v(").")])]),t._v(" "),o("tr",[o("td",[o("RouterLink",{attrs:{to:"/zh/flight_controller/cuav_v5_nano.html#debug_port"}},[t._v("CUAV V5nano")])],1),t._v(" "),o("td",[t._v("6-pin JST GH"),o("br"),t._v("Digikey: "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=455-1582-1-ND",target:"_blank",rel:"noopener noreferrer"}},[t._v("BM06B-GHS-TBT(LF)(SN)(N)"),o("OutboundLink")],1),t._v(" (vertical mount), "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=455-1568-1-ND",target:"_blank",rel:"noopener noreferrer"}},[t._v("SM06B-GHS-TBT(LF)(SN)(N)"),o("OutboundLink")],1),t._v(" (side mount)")])]),t._v(" "),o("tr",[o("td",[o("RouterLink",{attrs:{to:"/zh/flight_controller/cuav_v5_plus.html#debug-port"}},[t._v("CUAV V5+")])],1),t._v(" "),o("td",[t._v("6-pin JST GH"),o("br"),t._v("Digikey: "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=455-1582-1-ND",target:"_blank",rel:"noopener noreferrer"}},[t._v("BM06B-GHS-TBT(LF)(SN)(N)"),o("OutboundLink")],1),t._v(" (vertical mount), "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=455-1568-1-ND",target:"_blank",rel:"noopener noreferrer"}},[t._v("SM06B-GHS-TBT(LF)(SN)(N)"),o("OutboundLink")],1),t._v(" (side mount)")])]),t._v(" "),o("tr",[o("td",[o("RouterLink",{attrs:{to:"/zh/flight_controller/pixhawk3_pro.html#debug-port"}},[t._v("Drotek Pixhawk 3 Pro")])],1),t._v(" "),o("td",[o("a",{attrs:{href:"#pixhawk_debug_port_6_pin_sh"}},[t._v("Pixhawk 6-pin SH Debug")])])]),t._v(" "),o("tr",[o("td",[o("RouterLink",{attrs:{to:"/zh/flight_controller/pixhawk4.html#debug_port"}},[t._v("Holybro Pixhawk 4")])],1),t._v(" "),o("td",[o("a",{attrs:{href:"#pixhawk_debug_port_6_pin_sh"}},[t._v("Pixhawk 6-pin SH Debug")])])]),t._v(" "),o("tr",[o("td",[o("RouterLink",{attrs:{to:"/zh/flight_controller/pixhawk4_mini.html#debug-port"}},[t._v("Holybro Pixhawk 4 Mini")])],1),t._v(" "),o("td",[o("a",{attrs:{href:"#pixhawk_debug_port_6_pin_sh"}},[t._v("Pixhawk 6-pin SH Debug")])])]),t._v(" "),o("tr",[o("td",[o("RouterLink",{attrs:{to:"/zh/flight_controller/kakutef7.html#debug-port"}},[t._v("Holybro Kakute F7")])],1),t._v(" "),o("td",[t._v("Solder pads")])]),t._v(" "),o("tr",[o("td",[o("RouterLink",{attrs:{to:"/zh/flight_controller/durandal.html#debug-port"}},[t._v("Holybro Durandal")])],1),t._v(" "),o("td",[o("a",{attrs:{href:"#pixhawk_debug_port_6_pin_sh"}},[t._v("Pixhawk 6-pin SH Debug")])])])])]),t._v(" "),o("div",{staticClass:"custom-block tip"},[o("p",{staticClass:"custom-block-title"},[t._v("提示")]),t._v(" "),o("p",[t._v("Check the "),o("RouterLink",{attrs:{to:"/zh/flight_controller/"}},[t._v("autopilot topics")]),t._v(" if your flight controller is not listed.")],1)]),t._v(" "),o("p",[o("a",{attrs:{id:"pixhawk_standard_debug_ports"}})]),t._v(" "),o("h2",{attrs:{id:"pixhawk-standard-debug-ports"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#pixhawk-standard-debug-ports"}},[t._v("#")]),t._v(" Pixhawk Standard Debug Ports")]),t._v(" "),o("p",[t._v("The Pixhawk project has defines a standard pinout and connector type for different Pixhawk FMU releases:")]),t._v(" "),o("div",{staticClass:"custom-block tip"},[o("p",{staticClass:"custom-block-title"},[t._v("提示")]),t._v(" "),o("p",[t._v("Check your "),o("a",{attrs:{href:"#port_information"}},[t._v("specific board")]),t._v(" to confirm the port used.")])]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("FMU Version")]),t._v(" "),o("th",[t._v("Pixhawk Ver.")]),t._v(" "),o("th",[t._v("Debug Interface")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[t._v("FMUv2")]),t._v(" "),o("td",[o("RouterLink",{attrs:{to:"/zh/flight_controller/pixhawk.html#swd-port"}},[t._v("Pixhawk / Pixhawk 1")])],1),t._v(" "),o("td",[t._v("10 pin ARM Debug")])]),t._v(" "),o("tr",[o("td",[t._v("FMUv3")]),t._v(" "),o("td",[t._v("Pixhawk 2")]),t._v(" "),o("td",[t._v("6 pin SUR Debug")])]),t._v(" "),o("tr",[o("td",[t._v("FMUv4")]),t._v(" "),o("td",[t._v("Pixhawk 1/2")]),t._v(" "),o("td",[o("a",{attrs:{href:"#pixhawk_debug_port_6_pin_sh"}},[t._v("6 pin SH Debug")])])]),t._v(" "),o("tr",[o("td",[t._v("FMUv5")]),t._v(" "),o("td",[t._v("Pixhawk 4 FMUv5")]),t._v(" "),o("td",[o("a",{attrs:{href:"#pixhawk_debug_port_6_pin_sh"}},[t._v("6 pin SH Debug")])])]),t._v(" "),o("tr",[o("td",[t._v("FMUv5X")]),t._v(" "),o("td",[t._v("Pixhawk 5X")]),t._v(" "),o("td",[o("a",{attrs:{href:"#pixhawk_debug_port_10_pin_sh"}},[t._v("10 pin SH Debug")])])]),t._v(" "),o("tr",[o("td",[t._v("FMUv6")]),t._v(" "),o("td",[t._v("Pixhawk 6")]),t._v(" "),o("td",[o("a",{attrs:{href:"#pixhawk_debug_port_10_pin_sh"}},[t._v("10 pin SH Debug")])])]),t._v(" "),o("tr",[o("td",[t._v("FMUv6X")]),t._v(" "),o("td",[t._v("Pixhawk 6")]),t._v(" "),o("td",[o("a",{attrs:{href:"#pixhawk_debug_port_10_pin_sh"}},[t._v("10 pin SH Debug")])])])])]),t._v(" "),o("div",{staticClass:"custom-block note"},[o("p",{staticClass:"custom-block-title"},[t._v("注解")]),t._v(" "),o("p",[t._v("There FMU and Pixhawk versions are (only) consistent after FMUv5X.")])]),t._v(" "),o("p",[o("a",{attrs:{id:"pixhawk_debug_port_6_pin_sh"}})]),t._v(" "),o("h3",{attrs:{id:"pixhawk-debug-mini-6-pin-sh-debug-port"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#pixhawk-debug-mini-6-pin-sh-debug-port"}},[t._v("#")]),t._v(" Pixhawk Debug Mini (6-Pin SH Debug Port)")]),t._v(" "),o("p",[t._v("The "),o("a",{attrs:{href:"https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-009%20Pixhawk%20Connector%20Standard.pdf",target:"_blank",rel:"noopener noreferrer"}},[t._v("Pixhawk Connector Standard"),o("OutboundLink")],1),t._v(" defines a "),o("em",[t._v("6-Pin SH Debug Port")]),t._v(" that provides access to both SWD pins and the "),o("RouterLink",{attrs:{to:"/zh/debug/system_console.html"}},[t._v("System Console")]),t._v(".")],1),t._v(" "),o("div",{staticClass:"custom-block note"},[o("p",{staticClass:"custom-block-title"},[t._v("注解")]),t._v(" "),o("p",[t._v("This debug port is used in FMUv4 and FMUv5.")])]),t._v(" "),o("p",[t._v("The pinout is as shown below (SWD pins highlighted):")]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("Debug调试端口")]),t._v(" "),o("th",[t._v("针脚")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[t._v("1")]),t._v(" "),o("td",[o("code",[t._v("Vtref")])])]),t._v(" "),o("tr",[o("td",[t._v("2")]),t._v(" "),o("td",[t._v("Console TX")])]),t._v(" "),o("tr",[o("td",[t._v("3")]),t._v(" "),o("td",[t._v("Console RX")])]),t._v(" "),o("tr",[o("td",[t._v("4")]),t._v(" "),o("td",[o("code",[t._v("SWDIO")])])]),t._v(" "),o("tr",[o("td",[t._v("5")]),t._v(" "),o("td",[o("code",[t._v("SWDCLK")])])]),t._v(" "),o("tr",[o("td",[t._v("6")]),t._v(" "),o("td",[o("code",[t._v("GND")])])])])]),t._v(" "),o("p",[t._v("The debug port definition includes the following solder pads (on board next to connector):")]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("Debug调试端口")]),t._v(" "),o("th",[t._v("针脚")]),t._v(" "),o("th",[t._v("Voltage")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[t._v("Pad")]),t._v(" "),o("td",[t._v("信号")]),t._v(" "),o("td",[t._v("电压")])]),t._v(" "),o("tr",[o("td",[t._v("1")]),t._v(" "),o("td",[t._v("NRST (reset)")]),t._v(" "),o("td",[t._v("+3.3V")])]),t._v(" "),o("tr",[o("td",[t._v("2")]),t._v(" "),o("td",[t._v("GPIO1 (free GPIO)")]),t._v(" "),o("td",[t._v("+3.3V")])]),t._v(" "),o("tr",[o("td",[t._v("3")]),t._v(" "),o("td",[t._v("GPIO2 (free GPIO)")]),t._v(" "),o("td",[t._v("+3.3V")])])])]),t._v(" "),o("p",[t._v("The socket is a "),o("em",[t._v("6-pin JST SH")]),t._v(" - Digikey number: "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=455-2875-1-ND",target:"_blank",rel:"noopener noreferrer"}},[t._v("BM06B-SRSS-TBT(LF)(SN)"),o("OutboundLink")],1),t._v(" (vertical mount), "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=455-1806-1-ND",target:"_blank",rel:"noopener noreferrer"}},[t._v("SM06B-SRSS-TBT(LF)(SN)"),o("OutboundLink")],1),t._v("(side mount).")]),t._v(" "),o("p",[t._v("You can connect to the debug port using a "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=A06SR06SR30K152A",target:"_blank",rel:"noopener noreferrer"}},[t._v("cable like this one"),o("OutboundLink")],1),t._v(".")]),t._v(" "),o("p",[o("img",{attrs:{src:r(676),alt:"6-pin JST SH Cable"}})]),t._v(" "),o("p",[o("a",{attrs:{id:"pixhawk_debug_port_10_pin_sh"}})]),t._v(" "),o("h3",{attrs:{id:"pixhawk-debug-full-10-pin-sh-debug-port"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#pixhawk-debug-full-10-pin-sh-debug-port"}},[t._v("#")]),t._v(" Pixhawk Debug Full (10-Pin SH Debug Port)")]),t._v(" "),o("p",[t._v("The "),o("a",{attrs:{href:"https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-009%20Pixhawk%20Connector%20Standard.pdf",target:"_blank",rel:"noopener noreferrer"}},[t._v("Pixhawk Connector Standard"),o("OutboundLink")],1),t._v("  defines a "),o("em",[t._v("10-Pin SH Debug Port")]),t._v(" that provides access to both SWD pins and the "),o("RouterLink",{attrs:{to:"/zh/debug/system_console.html"}},[t._v("System Console")]),t._v(". This essentially moves the solder pads from beside the "),o("a",{attrs:{href:"#pixhawk_debug_port_6_pin_sh"}},[t._v("Pixhawk 6-Pin SH Debug Port")]),t._v(" into the connector, and also adds an SWO pin.")],1),t._v(" "),o("div",{staticClass:"custom-block note"},[o("p",{staticClass:"custom-block-title"},[t._v("注解")]),t._v(" "),o("p",[t._v("This port is specified for use in FMUv5x, FMUv6, FMUv6x.")])]),t._v(" "),o("p",[t._v("The pinout is as shown below (SWD pins highlighted):")]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("Debug调试端口")]),t._v(" "),o("th",[t._v("针脚")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[t._v("1")]),t._v(" "),o("td",[o("code",[t._v("Vtref")])])]),t._v(" "),o("tr",[o("td",[t._v("2")]),t._v(" "),o("td",[t._v("Console TX")])]),t._v(" "),o("tr",[o("td",[t._v("3")]),t._v(" "),o("td",[t._v("Console RX")])]),t._v(" "),o("tr",[o("td",[t._v("4")]),t._v(" "),o("td",[o("code",[t._v("SWDIO")])])]),t._v(" "),o("tr",[o("td",[t._v("5")]),t._v(" "),o("td",[o("code",[t._v("SWDCLK")])])]),t._v(" "),o("tr",[o("td",[t._v("6")]),t._v(" "),o("td",[o("em",[t._v("SWO")])])]),t._v(" "),o("tr",[o("td",[t._v("7")]),t._v(" "),o("td",[t._v("NFC GPIO")])]),t._v(" "),o("tr",[o("td",[t._v("8")]),t._v(" "),o("td",[t._v("PH11")])]),t._v(" "),o("tr",[o("td",[t._v("9")]),t._v(" "),o("td",[t._v("nRST")])]),t._v(" "),o("tr",[o("td",[t._v("10")]),t._v(" "),o("td",[o("code",[t._v("GND")])])])])]),t._v(" "),o("p",[t._v("The socket is a "),o("em",[t._v("10-pin JST SH")]),t._v(" - Digikey number: "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=455-1796-2-ND",target:"_blank",rel:"noopener noreferrer"}},[t._v("BM10B-SRSS-TB(LF)(SN)"),o("OutboundLink")],1),t._v(" (vertical mount) or "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=455-1810-2-ND",target:"_blank",rel:"noopener noreferrer"}},[t._v("SM10B-SRSS-TB(LF)(SN)"),o("OutboundLink")],1),t._v(" (side mount).")]),t._v(" "),o("p",[t._v("You can connect to the debug port using a "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=A10SR10SR30K203A",target:"_blank",rel:"noopener noreferrer"}},[t._v("cable like this one"),o("OutboundLink")],1),t._v(".")]),t._v(" "),o("p",[o("img",{attrs:{src:r(677),alt:"10-pin JST SH Cable"}})]),t._v(" "),o("p",[o("a",{attrs:{id:"debug_probes"}})]),t._v(" "),o("h2",{attrs:{id:"debug-probes"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#debug-probes"}},[t._v("#")]),t._v(" Debug Probes")]),t._v(" "),o("p",[t._v("The following section outlines some popular debug probes and adaptors for connecting them to autopilots running PX4.")]),t._v(" "),o("p",[o("a",{attrs:{id:"segger_jlink_edu_mini"}})]),t._v(" "),o("h3",{attrs:{id:"segger-jlink-edu-mini-debug-probe"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#segger-jlink-edu-mini-debug-probe"}},[t._v("#")]),t._v(" Segger JLink EDU Mini Debug Probe")]),t._v(" "),o("p",[t._v("The "),o("a",{attrs:{href:"https://www.segger.com/products/debug-probes/j-link/models/j-link-edu-mini/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Segger JLink EDU Mini"),o("OutboundLink")],1),t._v(" is an inexpensive and popular SWD debug probe. The probe's connector pinout looks like the image below (connect to this using an ARM 10-pin mini connector like "),o("a",{attrs:{href:"https://www.digikey.com/products/en?keywords=SAM8796-ND",target:"_blank",rel:"noopener noreferrer"}},[t._v("FTSH-105-01-F-DV-K"),o("OutboundLink")],1),t._v(").")]),t._v(" "),o("p",[o("img",{attrs:{src:r(678),alt:"connector_jlink_mini.png"}})]),t._v(" "),o("p",[t._v("The pin mapping to connect the J-Link Edu Mini to "),o("a",{attrs:{href:"#pixhawk_debug_port_6_pin_sh"}},[t._v("Pixhawk 6-Pin SH Debug Port")]),t._v(" is shown below (note, the "),o("code",[t._v("-")]),t._v(" indicates a pin that is not required for SWD).")]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("Debug调试端口")]),t._v(" "),o("th",[t._v("J-Link Mini")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[t._v("1 (Vtref)")]),t._v(" "),o("td",[t._v("1")])]),t._v(" "),o("tr",[o("td",[t._v("2 (Console TX)")]),t._v(" "),o("td",[t._v("-")])]),t._v(" "),o("tr",[o("td",[t._v("3 (Console RX)")]),t._v(" "),o("td",[t._v("-")])]),t._v(" "),o("tr",[o("td",[t._v("4 (SWDIO)")]),t._v(" "),o("td",[t._v("2")])]),t._v(" "),o("tr",[o("td",[t._v("5 (SWDCLK)")]),t._v(" "),o("td",[t._v("4")])]),t._v(" "),o("tr",[o("td",[t._v("6 (GND)")]),t._v(" "),o("td",[t._v("3 or 5")])])])]),t._v(" "),o("div",{staticClass:"custom-block tip"},[o("p",{staticClass:"custom-block-title"},[t._v("提示")]),t._v(" "),o("p",[t._v("From the table above you can infer the connections for autopilots that do not use the standard port.")])]),t._v(" "),o("p",[o("a",{attrs:{id:"dronecode_probe"}})]),t._v(" "),o("h3",{attrs:{id:"dronecode-probe"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#dronecode-probe"}},[t._v("#")]),t._v(" Dronecode Probe")]),t._v(" "),o("p",[t._v("The "),o("a",{attrs:{href:"https://kb.zubax.com/display/MAINKB/Dronecode+Probe+documentation",target:"_blank",rel:"noopener noreferrer"}},[t._v("Dronecode Probe"),o("OutboundLink")],1),t._v(" is a generic JTAG/SWD + UART console adapter compatible with most ARM Cortex based designs, and in particular with Pixhawk series flight controllers (and other hardware that PX4 supports).")]),t._v(" "),o("p",[t._v("The probe's USB interface exposes two separate virtual serial port interfaces: one for connecting to the "),o("RouterLink",{attrs:{to:"/zh/debug/system_console.html"}},[t._v("System Console")]),t._v(" (UART) and the other for an embedded GDB server (SWD interface).")],1),t._v(" "),o("p",[t._v("The probe provides a DCD-M connector cable for attaching to the "),o("a",{attrs:{href:"#pixhawk_debug_port_6_pin_sh"}},[t._v("Pixhawk 6-Pin SH Debug Port")]),t._v(".")]),t._v(" "),o("div",{staticClass:"custom-block note"},[o("p",{staticClass:"custom-block-title"},[t._v("注解")]),t._v(" "),o("p",[t._v("The "),o("em",[t._v("6-pos DF13")]),t._v(" connector that comes with the probe cannot be used for SWD debugging (it is for using the System Console).")])]),t._v(" "),o("div",{staticClass:"custom-block note"},[o("p",{staticClass:"custom-block-title"},[t._v("注解")]),t._v(" "),o("p",[t._v("The "),o("em",[t._v("Dronecode Probe")]),t._v(" is based on the "),o("a",{attrs:{href:"#black_magic_probe"}},[t._v("Black Magic Probe")]),t._v(".")])]),t._v(" "),o("p",[o("a",{attrs:{id:"black_magic_probe"}})]),t._v(" "),o("h3",{attrs:{id:"black-magic-probe"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#black-magic-probe"}},[t._v("#")]),t._v(" Black Magic Probe")]),t._v(" "),o("p",[t._v("The "),o("a",{attrs:{href:"https://github.com/blacksphere/blackmagic/wiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("Black Magic Probe"),o("OutboundLink")],1),t._v(" is much like the "),o("a",{attrs:{href:"#dronecode_probe"}},[t._v("Dronecode probe")]),t._v(" but does not come with the same adapters for directly connecting to Pixhawk series flight controllers.")]),t._v(" "),o("p",[t._v("Adapters can be purchased separately:")]),t._v(" "),o("ul",[o("li",[o("a",{attrs:{href:"https://1bitsquared.com/products/drone-code-debug-adapter",target:"_blank",rel:"noopener noreferrer"}},[t._v("Drone Code Debug Adapter"),o("OutboundLink")],1),t._v(" (1 BIT SQUARED).")])]),t._v(" "),o("p",[o("a",{attrs:{id:"debugging_topics"}})]),t._v(" "),o("h2",{attrs:{id:"后续步骤"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#后续步骤"}},[t._v("#")]),t._v(" 后续步骤")]),t._v(" "),o("p",[t._v("You've now connected the flight controller to an SWD debug probe!")]),t._v(" "),o("p",[t._v("The following topics explain how to start on-target debugging:")]),t._v(" "),o("ul",[o("li",[o("RouterLink",{attrs:{to:"/zh/debug/eclipse_jlink.html"}},[t._v("MCU Eclipse/J-Link Debugging for PX4")])],1),t._v(" "),o("li",[o("RouterLink",{attrs:{to:"/zh/dev_setup/vscode.html"}},[t._v("Visual Studio Code IDE (VSCode)")])],1)])])}),[],!1,null,null,null);e.default=a.exports},675:function(t,e,r){t.exports=r.p+"assets/img/cuav_v5_debug_cable.c0455619.jpg"},676:function(t,e,r){t.exports=r.p+"assets/img/cable_6pin_jst_sh.3c8865a1.jpg"},677:function(t,e,r){t.exports=r.p+"assets/img/cable_10pin_jst_sh.0bc1341c.jpg"},678:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN0AAABnCAYAAACElUcJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAe8SURBVHhe7ZuBkiwnCEXf5v//OQmVdyuEgIqttN19T5WVWUW4oLyZnc7+/Pk3vwghZfzx+7+EkCLYdIQUw6YjpBg2HSHFsOkIKeZT317+/Pz8fkX4pfV9fK7peNlYh7vhx0tCimHTEVIMm46QYth0hBTDpiOkGDYdIcUc3XTy1TYGIW+h+ZwOl12b6LleM1x5FuTFvor4zPqb2bMbW/c35LSbHfdplktNp1md1I4iic9Rf4gvrNRwFS+HTF5Cz17nDrQ91rNznl/BarF2vXXB2li0lkgH0DaeX28to2n7x0sRA0H6tYCfvXlg16qQgkVFezOoNfLHWHkG2q9gfWNe0K8FT5/Q0qf34L96r+DNCdavF8fTJCPS1Gw6CMBm7TyLFWCFCp5/vf4UJA+METL2d9ViV1z4HckdNlZLxkclUc3KvkgRARhvxh587yJk7S1iv6OmLR2I17LB2pPP2+bZq3WrHprbv70UoaNiTyfKY9W8RmxkrL7U2h9i9PTo9Z5tNdCzs/mzNes2HRzuEi/+9CB95Cx21ss7j9YlEnbquRPkhJpHIH9tE9Xs9nc6Te9gSf/wVxPFwrx3Zpir1Olxl45evNuaTh8axt2HpIEm+7pFpH/VPIAePVYx40vr7Wm3IN7IPthYjRkfM4jflu9szfhHrBvQhzASL2t/lV4dvEvk2cPOrvXmLT27ET8ZfZqW1mift2dUk8Cm+yBfqIPXGKdw1O90hHwBNh15JfIOd+q7OZuOkGLYdIQUw6YjpBg2HSHFsOkIKYZNR0gxQw/He0/bWw8i9YNYz48wIGEJWksPq7VK4wyZvISs/ZPBOZ6Ub7fpItH64GAjjNhpm8j/DrSWFp7d6N5qZurXywU+Ndreizk6J1j/WI/s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