{"id":653,"date":"2020-03-05T08:45:56","date_gmt":"2020-03-05T14:45:56","guid":{"rendered":"https:\/\/jacobncalvert.com\/?p=653"},"modified":"2020-03-05T08:45:58","modified_gmt":"2020-03-05T14:45:58","slug":"better-jtag-on-the-cheap-with-the-ft232h","status":"publish","type":"post","link":"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/","title":{"rendered":"Better JTAG on the Cheap with the FT232H"},"content":{"rendered":"\n<p>A couple of weeks ago I wrote a<a href=\"https:\/\/jacobncalvert.com\/2020\/02\/04\/jtag-on-the-cheap-with-the-ftdi-ft232r\/\"> post about using the FTDI FT232R<\/a> as a cheap JTAG debugger. I&#8217;ve been using it for a bit now to play with my Raspberry Pi 3B, and now that my code size has grown, the FT232R is just too slow to cut it. <\/p>\n\n\n\n<p>Here&#8217;s a breakdown: on the FT232R, the max speed I can set the adapter to is 3MHz. This has given me a transfer speed (loading via GDB) of around 3KB\/s. Not too bad for small projects of only a few hundred KiB. But now my code size is approaching a ~5 MiB, the debug cycle was way too long&#8230; 5MiB @ 3KB\/s = ~28mins to load&#8230; not good!<\/p>\n\n\n\n<p>Still in my pursuit of a cheap JTAG debugger (I mean come on! It&#8217;s just a serial protocol!), I did buy something. The <a href=\"https:\/\/www.amazon.com\/Adafruit-FT232H-Breakout-General-Purpose\/dp\/B00XW2MD30\/ref=sr_1_3?hvadid=78615133988938&amp;hvbmt=be&amp;hvdev=c&amp;hvqmt=e&amp;keywords=adafruit+ft232h&amp;qid=1583367646&amp;sr=8-3\">Adafruit FT232H breakout<\/a> is exactly what I was looking for. At only $15 with Amazon Prime shipping, I was back to debugging at a reasonable speed in two days. <\/p>\n\n\n\n<p>The FT232H breakout is about as barebones as it gets. The board breaks out untouched ACBUS0-ACBUS7 and ADBUS0-ADBUS7 to 0.10&#8243; pitch headers. Since the FT232H has a single MPSSE channel, I can use this breakout to get faster JTAG speeds. <\/p>\n\n\n\n<p>My configuration files from the previous post had to change a little to accommodate. I&#8217;ll break it down below in comments in the file because it&#8217;s a little bit cryptic. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#\n# FTDI USB Hi-Speed to MPSSE Breakout from Adafruit\n#\n# This should work for any bare FT232H\n#\n\n# Setup driver type\nadapter driver ftdi\n\n# 30000 kHZ -&gt; 30MHz\nadapter speed 30000\n\n# Using JTAG (also could be SWD)\ntransport select jtag\n\n# Common PID for FT232H\nftdi_vid_pid 0x0403 0x6014\n\n# Set sampling to allow higher clock speed\nftdi_tdo_sample_edge falling\n\n\n# Layout\n# On this breakout, the LEDs are on ACBUS8 and ACBUS9, can't assign them\n# registers are &lt;ACVALUE&gt;&lt;ADVALUE&gt; &lt;ACCONFIG&gt;&lt;ADCONFIG&gt;\n# so we set 0x0308 to mean only ACBUS nTRST and nSRST, ADBUS3 (TMS) asserted high\n# and we set 0x000B to mean only AC3,AC2,AC0 outputs -&gt; (TMS,TD0, TCK)\nftdi_layout_init 0x0308 0x000b\n\n# Pins\n# pin name      | func. |\n# --------------|-------|\n# ADBUS0        | TCK   |\n# ADBUS1        | TDI   |\n# ADBUS2        | TDO   |\n# ADBUS3        | TMS   |\n# ACBUS0        | nTRST |\n# ACBUS1        | nSRST |\n#---------------|-------|\n\n# When data == oe -&gt; pins are switched from output to input to give\n# the tri state (L, H, Hi-Z) effect \nftdi_layout_signal nTRST -data 0x0100 -oe 0x0100\nftdi_layout_signal nSRST -data 0x0200 -oe 0x0200\n\n<\/pre><\/div>\n\n\n<p>So now it is as simple as connecting the corresponding pins on this breakout to the RPi3, and running OpenOCD again. <\/p>\n\n\n\n<p>With the increased throughput of this MPSSE-supported interface, I now get ~587KB\/s. Much better! It only takes ~8s to load my image now. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of weeks ago I wrote a post about using the FTDI FT232R as a cheap JTAG debugger. I&#8217;ve been using it for a bit now to play with my Raspberry Pi 3B, and now that my code size has grown, the FT232R is just too slow to cut it. Here&#8217;s a breakdown: on the FT232R, the max speed I can set the adapter to is 3MHz. This has given me a transfer speed (loading via GDB) of around&hellip;<\/p>\n","protected":false},"author":1,"featured_media":654,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[85,72,5,81,73],"tags":[116,115,111,112],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Better JTAG on the Cheap with the FT232H - Jacob N Calvert<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Better JTAG on the Cheap with the FT232H - Jacob N Calvert\" \/>\n<meta property=\"og:description\" content=\"A couple of weeks ago I wrote a post about using the FTDI FT232R as a cheap JTAG debugger. I&#8217;ve been using it for a bit now to play with my Raspberry Pi 3B, and now that my code size has grown, the FT232R is just too slow to cut it. Here&#8217;s a breakdown: on the FT232R, the max speed I can set the adapter to is 3MHz. This has given me a transfer speed (loading via GDB) of around&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/\" \/>\n<meta property=\"og:site_name\" content=\"Jacob N Calvert\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-05T14:45:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-05T14:45:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jacobncalvert.com\/wp-content\/uploads\/2020\/03\/board-911636_640.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"201\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#website\",\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/\",\"name\":\"Jacob N Calvert\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/jacobncalvert.com\/blog-archive\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/wp-content\/uploads\/2020\/03\/board-911636_640.jpg\",\"contentUrl\":\"https:\/\/jacobncalvert.com\/blog-archive\/wp-content\/uploads\/2020\/03\/board-911636_640.jpg\",\"width\":640,\"height\":201},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/#webpage\",\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/\",\"name\":\"Better JTAG on the Cheap with the FT232H - Jacob N Calvert\",\"isPartOf\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/#primaryimage\"},\"datePublished\":\"2020-03-05T14:45:56+00:00\",\"dateModified\":\"2020-03-05T14:45:58+00:00\",\"author\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#\/schema\/person\/f4b22a996d41bf09ed2bbe22912a8c8a\"},\"breadcrumb\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/\",\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/05\/better-jtag-on-the-cheap-with-the-ft232h\/#webpage\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#\/schema\/person\/f4b22a996d41bf09ed2bbe22912a8c8a\",\"name\":\"Jacob\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/64a2dd1c00cb39dfc19bb1204c87efbc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/64a2dd1c00cb39dfc19bb1204c87efbc?s=96&d=mm&r=g\",\"caption\":\"Jacob\"},\"sameAs\":[\"https:\/\/jacobncalvert.com\"],\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/author\/jcalvert\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/posts\/653"}],"collection":[{"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/comments?post=653"}],"version-history":[{"count":3,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/posts\/653\/revisions"}],"predecessor-version":[{"id":657,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/posts\/653\/revisions\/657"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/media\/654"}],"wp:attachment":[{"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/media?parent=653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/categories?post=653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/tags?post=653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}