{"id":12395,"date":"2015-03-01T19:04:52","date_gmt":"2015-03-02T02:04:52","guid":{"rendered":"http:\/\/ainslies.net\/?p=12395"},"modified":"2015-03-01T19:04:52","modified_gmt":"2015-03-02T02:04:52","slug":"swd-with-the-mdbt40-ble-module","status":"publish","type":"post","link":"https:\/\/ainslies.net\/?p=12395","title":{"rendered":"SWD with the MDBT40 BLE module"},"content":{"rendered":"<p><a href=\"http:\/\/ainslies.net\/wp-content\/uploads\/2015\/03\/IMG_20150301_173929.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ainslies.net\/wp-content\/uploads\/2015\/03\/IMG_20150301_173929-169x300.jpg\" alt=\"IMG_20150301_173929\" width=\"169\" height=\"300\" class=\"alignleft size-medium wp-image-12396\" srcset=\"https:\/\/ainslies.net\/wp-content\/uploads\/2015\/03\/IMG_20150301_173929-169x300.jpg 169w, https:\/\/ainslies.net\/wp-content\/uploads\/2015\/03\/IMG_20150301_173929-576x1024.jpg 576w, https:\/\/ainslies.net\/wp-content\/uploads\/2015\/03\/IMG_20150301_173929.jpg 1836w\" sizes=\"auto, (max-width: 169px) 100vw, 169px\" \/><\/a><\/p>\n<p>I was recently introduced to the MDBT40 module that is based on the <a href=\"https:\/\/www.nordicsemi.com\/eng\/Products\/Bluetooth-Smart-Bluetooth-low-energy\/nRF51822\">Nordic nRF51822<\/a>. The processor nicely solves a number problems I&#8217;ve been looking at and the fact that it&#8217;s Bluetooth Smart also solves how I&#8217;ll get the data from it.<\/p>\n<p>I designed some custom hardware ( the picture at left ) around the module and I needed some way to program it. My earlier post shows my investigations with SWD and OpenOCD.I put a SWD header on the board to re-program it.<\/p>\n<p><b>OpenOCD Configuration for the nRF51822<\/b><\/p>\n<p>bishop on the Nordic Developer Zone figured out how to get the nRF51822 part working with <a href=\"https:\/\/devzone.nordicsemi.com\/question\/23842\/st-link-nrf51822-and-openocd\/\">S-Link and OpenOCD<\/a>. I took his configuration and adjusted it to work with the bus blaster v3.<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"text codecolorer\">source [find &nbsp;interface\/ftdi\/dp_busblaster_kt-link.cfg]<br \/>\ntransport select swd<br \/>\nset WORKAREASIZE 0<br \/>\nsource [find target\/nrf51.cfg]<\/div><\/div>\n<p>Save it as nrf51822.cfg so then you can start openocd with it.<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"text codecolorer\">$ openocd -f target\/nrf51822.cfg<\/div><\/div>\n<p>OpenOCD defaults to a telnet interace on 4444.<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"text codecolorer\">$ telnet 127.0.0.1 4444<br \/>\nTrying 127.0.0.1...<br \/>\nConnected to 127.0.0.1.<br \/>\nEscape character is '^]'.<br \/>\nOpen On-Chip Debugger<br \/>\n&gt; halt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\ntarget state: halted<br \/>\ntarget halted due to debug-request, current mode: Thread <br \/>\nxPSR: 0x21000000 pc: 0x000163da msp: 0x20003fd8<br \/>\n&gt; nrf51 mass_erase &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n&gt; flash write_image _build\/akkea1_tfw.hex <br \/>\nPadding image section 0 with 2112 bytes<br \/>\nPadding image section 1 with 3572 bytes<br \/>\nPadding image section 2 with 1 bytes<br \/>\nnot enough working area available(requested 32)<br \/>\nno working area available, falling back to slow memory writes<br \/>\nwrote 95556 bytes from file _build\/akkea1_tfw.hex in 14.267832s (6.540 KiB\/s)<br \/>\n&gt; reset<\/div><\/div>\n<p>The board is now prgrammed with your custom firmware. This should work with any MDBT40 based board the has the 12K programming resistor per the Raytac application note. It should also work with other nRF51822 based board with a SWD interface<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was recently introduced to the MDBT40 module that is based on the Nordic nRF51822. The processor nicely solves a number problems I&#8217;ve been looking at and the fact that it&#8217;s Bluetooth Smart also solves how I&#8217;ll get the data &hellip; <a href=\"https:\/\/ainslies.net\/?p=12395\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12395","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ainslies.net\/index.php?rest_route=\/wp\/v2\/posts\/12395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ainslies.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ainslies.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ainslies.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ainslies.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12395"}],"version-history":[{"count":4,"href":"https:\/\/ainslies.net\/index.php?rest_route=\/wp\/v2\/posts\/12395\/revisions"}],"predecessor-version":[{"id":12400,"href":"https:\/\/ainslies.net\/index.php?rest_route=\/wp\/v2\/posts\/12395\/revisions\/12400"}],"wp:attachment":[{"href":"https:\/\/ainslies.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ainslies.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ainslies.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}