{"id":602,"date":"2022-03-31T20:28:26","date_gmt":"2022-04-01T01:28:26","guid":{"rendered":"https:\/\/www.jasonsblog.place\/?p=602"},"modified":"2022-09-10T21:58:45","modified_gmt":"2022-09-11T02:58:45","slug":"building-infinitime-for-the-pinetime","status":"publish","type":"post","link":"https:\/\/www.jasonsblog.place\/index.php\/2022\/03\/31\/building-infinitime-for-the-pinetime\/","title":{"rendered":"Building InfiniTime for the PineTime"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Note<\/strong>: This is current as of March 31, 2022. This tutorial was written for advanced users, i.e. users who have used &#8220;git&#8221;, have knowledge of programming, and have build programs before on Linux. Also, using the &#8220;develop&#8221; branch of InfiniTime can <strong>brick your smart watch<\/strong>. You have been warned.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s the <a href=\"https:\/\/github.com\/InfiniTimeOrg\/InfiniTime\/blob\/develop\/doc\/buildAndProgram.md\">official documentation<\/a> for building InfiniTime. As of the writing of this tutorial, the documentation is a little hard to follow, so that&#8217;s why I wrote this. These steps were carried out on Linux Mint 20.3.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Pull down the sources of &#8220;InfiniTime&#8221;.<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git clone https:\/\/github.com\/InfiniTimeOrg\/InfiniTime.git InfiniTime<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This branch is named &#8220;develop&#8221; because it is meant for, well, developing it. If you want a more stable branch, <code>checkout<\/code> a numbered branch (e.g. 1.7.1 or 1.8.0).<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Install the &#8220;ARM-GCC&#8221; cross-compiler to any location you like (preferably one that&#8217;s easy to access).<\/li><li>Install the &#8220;NRF52&#8221; SDK 15.3.0 to another place of your choosing.<\/li><li>Install the following Python 3 packages: <code>cbor<\/code>, <code>intelhex<\/code>, <code>click<\/code>, and <code>cryptography<\/code>. This can be achieved with <code>pip3<\/code> (or just <code>pip<\/code> if your distro only uses Python 3). The official documentation offers the alternative of installing them into a <a href=\"https:\/\/github.com\/InfiniTimeOrg\/InfiniTime\/blob\/develop\/doc\/buildAndProgram.md#dependencies\">virtual environment<\/a>. If you&#8217;re fine with installing them system-wide, you can use the following command: <\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$ python -m pip install -r &lt;Path to InfiniTime sources&gt;\/tools\/mcuboot\/requirements.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you didn&#8217;t know already, the &#8220;requirements.txt&#8221; file is in the directory with the InfiniTime sources.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>Install the &#8220;adafruit-nrfutil&#8221; utility. The documentation for &#8220;adafruit-nrfutil&#8221; suggests installing from pip: <code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\"><\/code><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$ pip3 install --user adafruit-nrfutil<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note that this requires the path to the user install to be added to the &#8220;$PATH&#8221; environment variable.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\"><li>Once all of that software is installed, use the following command to build the <code>Makefile<\/code>s, and build the InfiniTime image: <\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mkdir build\n$ cmake -B build -DARM_NONE_EABI_TOOLCHAIN_PATH=&lt;Path to ARM-GCC compiler&gt; -DNRF5_SDK_PATH=&lt;Path to NRF52 SDK&gt; -DBUILD_DFU=1\n$ cd build\n$ make -j&lt;number of cores&gt; pinetime-mcuboot-app<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The &#8220;-DBUILD_DFU&#8221; part is meant for flashing the device over the air (OTA) with programs like GadgetBridge and Siglo. The file generated has a name like &#8220;pinetime-mcuboot-app-dfu-&lt;version&gt;.zip&#8221;, where <code>&lt;version&gt;<\/code> is the current release version of InfiniTime. It is found in the <code>build\/src<\/code> directory of the InfiniTime sources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the file is generated, you should be able to flash it on to your PineTime.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to build an image of InfiniTime, but don&#8217;t know how? This article will probably help you with that.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104,7,76],"tags":[180,130,228,54,79],"class_list":["post-602","post","type-post","status-publish","format-standard","hentry","category-equipment","category-information-technology","category-programming","tag-bash","tag-digital-coupons","tag-pinetime","tag-programming-languages","tag-python"],"_links":{"self":[{"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/posts\/602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/comments?post=602"}],"version-history":[{"count":7,"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/posts\/602\/revisions"}],"predecessor-version":[{"id":637,"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/posts\/602\/revisions\/637"}],"wp:attachment":[{"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/media?parent=602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/categories?post=602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jasonsblog.place\/index.php\/wp-json\/wp\/v2\/tags?post=602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}