{"id":228,"date":"2018-02-16T10:59:59","date_gmt":"2018-02-16T10:59:59","guid":{"rendered":"http:\/\/www.binarydevotion.com\/?p=228"},"modified":"2023-03-20T20:49:27","modified_gmt":"2023-03-20T20:49:27","slug":"howto-flash-a-gotek-with-no-programmer","status":"publish","type":"post","link":"https:\/\/www.binarydevotion.com\/?p=228","title":{"rendered":"Howto: flash a Gotek with no programmer"},"content":{"rendered":"<p>I wanted to mod my Gotek running the Cortex firmware to support a display, and the OLED 128&#215;32 displays seem neat, and cheap, and well supported.\u00a0 Whilst doing that, I thought I might as well move to open firmware, and wanted to try <a href=\"https:\/\/github.com\/keirf\/FlashFloppy\/\">FlashFloppy from KeirF<\/a>.\u00a0 On his instructions page there&#8217;s a howto\u00a0 for flashing using a programmer, and a <a href=\"http:\/\/www.youtube.com\/watch?v=yUOyZB9cro4\">link to a video<\/a> noting that due to the bootloader in the ST micro platform you don&#8217;t need a programmer.<\/p>\n<p>For those that prefer instructions, here&#8217;s some!<a href=\"http:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/cable-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-234 alignright\" src=\"http:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/cable-1-300x246.png\" alt=\"\" width=\"238\" height=\"195\" srcset=\"https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/cable-1-300x246.png 300w, https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/cable-1.png 625w\" sizes=\"auto, (max-width: 238px) 100vw, 238px\" \/><\/a><\/p>\n<p>You will need:<\/p>\n<ul>\n<li>A Gotek drive<\/li>\n<li>A USB A to USB A cable (make one if you don&#8217;t have one to hand)<\/li>\n<li>Software from ST Microelectronics<\/li>\n<li>2 jumper leads or appropriate way to connect pins on the Gotek.<\/li>\n<\/ul>\n<p>The USB A to A cable is not a common cable: it is literally every pin connected from a USB A plug to another USB A plug.\u00c2\u00a0 I didn&#8217;t have one, but I have accumulated hundreds* of USB A to mini B through the years.\u00c2\u00a0 Two gave their lives to become one.<\/p>\n<h3>Jumper the GoTek into bootloader mode, and USB mode:<\/h3>\n<pre>Standard (Nick's numbering!)\n1 2 3 4 5\n. . . . .     . . . . . . . \n    . . .     . . . . . . .\n    8 7 6\n\nPowerCon\n | | | |\n | | | |\n\n\n<\/pre>\n<p>You need to connect pin 1 to 2, and 3 to 7 (across the diagonal, yes, and a standard jumper won&#8217;t reach).<a href=\"http:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/Gotek.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-231 aligncenter\" src=\"http:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/Gotek.png\" alt=\"\" width=\"253\" height=\"108\" \/><\/a><\/p>\n<h3><\/h3>\n<h3>Download and install PC Software<\/h3>\n<p>Download the software from <a href=\"http:\/\/www.st.com\/content\/st_com\/en\/products\/development-tools\/software-development-tools\/stm32-software-development-tools\/stm32-programmers\/stsw-stm32080.html\">ST Microelectronics<\/a>.\u00c2\u00a0 You will need to provide an email address and you will be emailed a link.\u00c2\u00a0 Install the software.<\/p>\n<h3>Plug in and check DFU<\/h3>\n<p>You do not need power, or anything else connected other than your USB A to USB A cable.\u00c2\u00a0 Plug the Gotek into a USB port on your PC using the A-A cable.\u00c2\u00a0 You will hear a few connects\/disconnects as the PC tries to work out what&#8217;s going on, and you&#8217;ll have a USB device in Device Manager called &#8220;STM Device in DFU Mode&#8221;.\u00c2\u00a0 I didn&#8217;t have to update drivers, but if you are getting &#8220;unrecognised device&#8221; then click on the unrecognised device in Device Manager and update driver to the one located in \/program files(x86)\/STMicroelectronics\/Software\/DFusev3.05\/Bin\/Driver<\/p>\n<h3>Create DFU from HEX<\/h3>\n<p>Take <a href=\"http:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUfm.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-229 alignright\" src=\"http:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUfm-300x140.png\" alt=\"\" width=\"244\" height=\"114\" srcset=\"https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUfm-300x140.png 300w, https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUfm-768x360.png 768w, https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUfm.png 805w\" sizes=\"auto, (max-width: 244px) 100vw, 244px\" \/><\/a>the FlashFloppy .hex file from the <a href=\"https:\/\/github.com\/keirf\/FlashFloppy\/wiki\/Downloads\">distribution<\/a>, and run DFU File Manager (from the Start Menu).\u00c2\u00a0 You do not need to change any of the defaults, just click &#8220;S19 or Hex&#8221;, seelct your hex file and click OK to load it, then select the &#8220;Image&#8221; in the listbox.\u00c2\u00a0 Finally, click &#8220;Generate&#8221; and select a save location for your DFU file.<\/p>\n<h3>Upgrade the Firmware<\/h3>\n<p>Open DFuseDemo from the Start menu.\u00c2\u00a0 You will see &#8220;ST Electronics device in DFU mode&#8221; in the devices dropdown.\u00c2\u00a0 Select &#8220;Internal flash&#8221; from the Targets box.\u00c2\u00a0 In the <span style=\"text-decoration: underline;\">Upgrade or Verify<\/span> Action area, click &#8220;choose&#8221;, then select the DFU file you created.\u00c2\u00a0 Next, click &#8220;Upgrade&#8221;.\u00c2\u00a0 <a href=\"http:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUSE.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-230 aligncenter\" src=\"http:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUSE-300x300.png\" alt=\"\" width=\"188\" height=\"188\" srcset=\"https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUSE-300x300.png 300w, https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUSE-150x150.png 150w, https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUSE-768x772.png 768w, https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUSE-36x36.png 36w, https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUSE-115x115.png 115w, https:\/\/www.binarydevotion.com\/wp-content\/uploads\/2018\/02\/DFUSE.png 846w\" sizes=\"auto, (max-width: 188px) 100vw, 188px\" \/><\/a>You will see a warning that because you&#8217;re in DFU mode the image cannot be validated for the target, or something similar.\u00c2\u00a0 Accept this.<\/p>\n<p>If you see &#8220;save&#8221; rather than &#8220;ok&#8221; in a file requester, you&#8217;ve selected the wrong choose: use the one in the Upgrade area rather than the Upload area!<\/p>\n<p>Cross fingers and it should program fine.<\/p>\n<h3>Remove the Jumpers<\/h3>\n<p>Don&#8217;t forget to remove the programming jumpers you added&#8230;<\/p>\n<h3>Test!<\/h3>\n<p>Put in your host device and power up.\u00c2\u00a0 If you&#8217;ve still got the 7 segment LED connected you will see F-F as an indication FlashFloppy is present.<\/p>\n<p>Worked first time for me&#8230;<\/p>\n<h2>Troubleshooting<\/h2>\n<h3>Programming failed, device not recognised by Windows, not appearing as DFU device in DFuseDemo&#8230;<\/h3>\n<p>Issue &#8211; From Keir: The bootloader can get confused at power on and detect the wrong baud rate, so this is a way to reset it without reconnecting power and USB and upsetting the rest of the connection..,<\/p>\n<p>Solution &#8211; reset the drive by touching the reset pin to ground: with the power applied (via USB is fine) briefly connect pins I&#8217;ve labelled 5 and 6 in the diagram above.\u00c2\u00a0 These are the two pins on the right of the left hand block of pins, when looking from the top\/back of the Gotek.<\/p>\n<p>Thanks to Kier, Damien and Owen on Facebook for this!<\/p>\n<h3><strong>Device not recognised on USB3 \/ Hub \/ &#8230;<\/strong><\/h3>\n<p>Issue &#8211; from Squirrel in comments below: USB cable and hubs can cause issues with device recognition, perhaps due to power connection in USB cable.<\/p>\n<p>Solution: Add power connection in USB cable, as some OTG cables do not have this.\u00c2\u00a0 Problem solved.\u00c2\u00a0 Thanks to Squirrel for this one!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to mod my Gotek running the Cortex firmware to support a display, and the OLED 128&#215;32 displays seem neat, and cheap, and well supported.\u00a0 Whilst doing that, I thought I might as&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":234,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,4,1],"tags":[],"class_list":["post-228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-projects","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=\/wp\/v2\/posts\/228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=228"}],"version-history":[{"count":0,"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=\/wp\/v2\/posts\/228\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=\/wp\/v2\/media\/234"}],"wp:attachment":[{"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.binarydevotion.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}