{"id":79,"date":"2013-10-15T12:25:10","date_gmt":"2013-10-15T10:25:10","guid":{"rendered":"http:\/\/www.anginf.de\/?p=79"},"modified":"2014-07-10T17:14:17","modified_gmt":"2014-07-10T15:14:17","slug":"rebuild-code-for-radioblocks","status":"publish","type":"post","link":"https:\/\/www.anginf.de\/?p=79","title":{"rendered":"Rebuild code for RadioBlocks"},"content":{"rendered":"<p>I aquired some <a title=\"RadioBlocks\" href=\"http:\/\/www.coloradomicrodevices.com\/the-radio-block\/\" target=\"_blank\">RadioBlocks<\/a>, which are little radio components which can be accessed via an <a title=\"Arduino Homepage\" href=\"http:\/\/arduino.cc\/\" target=\"_blank\">arduino<\/a> and build a Mesh-Network called &#8222;SimpleMesh&#8220; on their own.<\/p>\n<p>They can be customized quite a lot and even provide some security.<\/p>\n<p>As I thought it would be overkill to use an arduino with one of these devices just to trigger a relais, I tried to understand the making of the (open source) firmware.<\/p>\n<p>Here are the steps I did so far:<\/p>\n<ol>\n<li>Download and install the latest release of <a title=\"LPCXpresso Download\" href=\"http:\/\/lpcware.com\/lpcxpresso\/downloads\/windows\" target=\"_blank\">LPCXpresso<\/a>.<\/li>\n<li>Create an account \/ login at <a title=\"LPCWare Homepage\" href=\"http:\/\/lpcware.com\/\" target=\"_blank\">http:\/\/lpcware.com\/<\/a><\/li>\n<li>In LPCXpresso, go to Help -&gt; Activate LPCXpresso Free Edition -&gt; &#8222;Create serial number and register&#8220;\n<ul>\n<li>Enter the serial number on the <a title=\"LPCXpresso Activation Page\" href=\"http:\/\/lpcware.com\/lpcxpresso\/activate\" target=\"_blank\">LPCXpresso Activation Page<\/a><\/li>\n<li>Enter the resulting activation code in LPCXpresso and have a &#8222;FULL&#8220; licensed LPCXpresso.<\/li>\n<\/ul>\n<\/li>\n<li>With the help of <a title=\"GIT GUI Download\" href=\"http:\/\/git-scm.com\/download\/win\">GIT GUI<\/a> I replicated the source directory of <a title=\"SimpleMesh GIT\" href=\"https:\/\/www.assembla.com\/code\/SimpleMesh\/git\/nodes\">SimpleMesh<\/a>.<\/li>\n<li>In LPCXpresso, choose &#8222;Import project(s)&#8220; and choose the root dir of the cloned GIT files.<\/li>\n<li>As stated in the <a title=\"RadioBlocks Bootloading Guide\" href=\"http:\/\/www.coloradomicrodevices.com\/wp-content\/uploads\/2012\/12\/RadioBlocks-Bootloading-Guide.pdf\">RadioBlocks Bootloading Guide<\/a>, I right-clicked on the project &#8222;simplemesh_serial&#8220;, choose &#8222;Properties&#8220; and under &#8222;C\/C++ Build -&gt; Settings -&gt; Tab &#8218;Build Steps'&#8220; removed the indicated hash (#).<\/li>\n<li>Click on &#8222;Clean&#8220; and then on &#8222;Build&#8220;; the default will compile the &#8222;Debug&#8220; version of the files.<\/li>\n<li>The resulting files (.axf and .bin, the latter is for uploading into the RadioBlock) can be found at your &#8222;workspace&#8220;-location of your LPCXpresso, e.g.:\n<ul>\n<li>C:\\Users\\%USERNAME%\\Documents\\LPCXpresso_%VERSION%\\workspace\\simplemesh_serial\\Debug<\/li>\n<\/ul>\n<\/li>\n<li>The .bin file is 19K in size, which is too big for the used LPC1114, at least in the current configuration. The image must be further optimized (~10K) to be uploaded into the RadioBlock.<\/li>\n<li>Right-Click on the project, Properties -&gt; C\/C++ Build -&gt; Settings -&gt; &#8218;Tool Settings&#8216; Tab -&gt; Optimization -&gt; &#8222;Optimize for size (-Os)&#8220;<\/li>\n<li>Click on &#8222;Clean&#8220; and then on &#8222;Build&#8220;, the result is a ~10K size image.<\/li>\n<\/ol>\n<p>Having now a size optimized image, we can flash this onto the RadioBlock. You need the <a title=\"JTAG\/ISP Board\" href=\"http:\/\/www.coloradomicrodevices.com\/shop\/jtagisp-board\/\" target=\"_blank\">JTAG\/ISP Interface Board<\/a> and the <a title=\"USB2UART\" href=\"http:\/\/www.coloradomicrodevices.com\/shop\/usb2uart\/\" target=\"_blank\">USB2UART-Adapter<\/a> from Colorado Micro Devices. On the software side, you need Python 2.7 and the lpc111xisp.py-Script.<\/p>\n<ol>\n<li>Download and install <a title=\"Python 2.7.3\" href=\"http:\/\/python.org\/download\/releases\/2.7.3\/\" target=\"_blank\">Python 2.7<\/a> (I&#8217;m assuming an installation directory C:\\Python27)<\/li>\n<li>Download and <a title=\"Installation Instructions for pySerial\" href=\"http:\/\/pyserial.sourceforge.net\/pyserial.html#installation\" target=\"_blank\">install<\/a> <a title=\"pySerial\" href=\"http:\/\/pyserial.sourceforge.net\/\" target=\"_blank\">pySerial<\/a><\/li>\n<li>Download the <a title=\"LPC111xisp.py script in zipped format\" href=\"http:\/\/www.coloradomicrodevices.com\/wp-content\/uploads\/2013\/03\/lpc111xisp.py_.zip\" target=\"_blank\">lpc111xisp.py-script<\/a> and unzip into your Python installation directory.<\/li>\n<li>Connect the JTAG\/ISP Interface Board, the RadioBlock and the USB2UART-Interface together as it is shown in the <a title=\"RadioBlocks Bootloading Guide\" href=\"http:\/\/www.coloradomicrodevices.com\/wp-content\/uploads\/2012\/12\/RadioBlocks-Bootloading-Guide.pdf\" target=\"_blank\">Bootloading Guide<\/a>.<\/li>\n<li>NOW connect the USB2UART-Board to your computer<\/li>\n<li>Find out which COM-Port was created by your USB2UART-Device<\/li>\n<li>Open a command prompt (Start -&gt; &#8222;cmd&#8220;) and change into your python installation directory (cd C:\\Python27)<\/li>\n<li>Run the following command. Remember to change %USERNAME% and %VERSION% to your appropriate values.<\/li>\n<\/ol>\n<pre lang=\"DOS\">python.exe lpc111xisp.py C:\\Users\\%USERNAME%\\Documents\\LPCXpresso_%VERSION%\\workspace\\simplemesh_serial\\Debug\\simplemesh_serial.bin -p COM3 -b 115200 -e -d<\/pre>\n<p>That&#8217;s it. The new (so far unmodified) version of the firmware was uploaded. If you want to hard-program the information like PANID or Security Key, you can change the information in simplemesh_serial -&gt; apps -&gt; serial &#8211;&gt; include -&gt; config.h<\/p>\n<hr \/>\n<p>Although I have a different chip, the AT86RF230-files seem to work nicely. With these modifications I could NOT make LPCXpresso use only the AT86RF231-files, so I just left it at AT86RF230. I&#8217;m leaving this information here in case I ever have to start over again&#8230;<\/p>\n<ul>\n<li>On my RadioBlock boards, I can see that the AT86RF231 is placed there, but the project references the AT86RF230, we have to change this in a couple of locations:\n<ul>\n<li>The default Symbols in the simplemesh_serial point to AT86RF230. So I changed this in &#8222;C\/C++ Build -&gt; Settings -&gt; Tab &#8218;Tool Settings&#8216; -&gt; Symbols -&gt; PHY=AT86RF231<\/li>\n<li>In the Symbols, also changed the PHY_AT86RF230 to PHY_AT86RF231 (it has no other value).<\/li>\n<li>Change the at86rf230 to at86rf231 in &#8222;C\/C++ Build -&gt; Settings -&gt; Tab &#8218;Tool Settings&#8216; -&gt; Includes&#8220; as well.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I aquired some RadioBlocks, which are little radio components which can be accessed via an arduino and build a Mesh-Network called &#8222;SimpleMesh&#8220; on their own. They can be customized quite a lot and even provide some security. As I thought it would be overkill to use an arduino with one of these devices just to &hellip; <a href=\"https:\/\/www.anginf.de\/?p=79\" class=\"more-link\"><span class=\"screen-reader-text\">Rebuild code for RadioBlocks<\/span> weiterlesen <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-79","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"_links":{"self":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts\/79","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79"}],"version-history":[{"count":38,"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions"}],"predecessor-version":[{"id":118,"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions\/118"}],"wp:attachment":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}