{"id":1267,"date":"2014-04-02T01:14:54","date_gmt":"2014-04-01T23:14:54","guid":{"rendered":"http:\/\/lazlo.de\/?p=1267"},"modified":"2014-04-18T01:11:16","modified_gmt":"2014-04-17T23:11:16","slug":"nuttx-on-linux","status":"publish","type":"post","link":"http:\/\/lazlo.de\/blog\/2014\/04\/02\/nuttx-on-linux\/","title":{"rendered":"Nuttx on Linux"},"content":{"rendered":"<p>If you are also working with <a href=\"http:\/\/www.nuttx.org\/\">Nuttx<\/a>, you will love the &#8220;sim&#8221; configuration. It will allow running a minimal version of Nuttx as a regular program on a linux machine (assuming 86x_64).<\/p>\n<p>Before getting the sources and building anything you will need the 32-bit version of the GCC and the following libraries that can be installed like this:<\/p>\n<p style=\"padding-left: 30px;\"><code>sudo apt-get install -y gcc-multilib libc6-dev-i386 lib32z1-dev<\/code><\/p>\n<p>After installing there is a final thing you need to fix on your own (see this <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/zlib\/+bug\/1155307\">launchpad ticket<\/a>)<\/p>\n<p style=\"padding-left: 30px;\"><code>sudo ln -s \/usr\/include\/x86_64-linux-gnu\/zconf.h \/usr\/include<\/code><\/p>\n<p>Now get the Nuttx sources using git like this:<\/p>\n<p style=\"padding-left: 30px;\"><code>git clone http:\/\/git.code.sf.net\/p\/nuttx\/git nuttx.git<\/code><\/p>\n<p>First thing after getting the sources is to run the configure script (a bit different from the well known .\/configure) to setup the build directory for the target hardware. In our case the target will be the native machine for which the &#8220;sim&#8221; configuration has been created (see nuttx\/configs\/sim).<\/p>\n<p>To configure the build setup for target &#8220;sim&#8221; with &#8220;nsh&#8221; as the application to run on start, run:<\/p>\n<p style=\"padding-left: 30px;\"><code> cd nuttx.git\/nuttx\/tools<br \/>\n.\/configure.sh sim\/nsh<br \/>\ncd ..<br \/>\n<\/code><\/p>\n<p>Last step before building is the configure the image. This is done by calling<\/p>\n<p style=\"padding-left: 30px;\"><code>make menuconfig<\/code><\/p>\n<p>There is at least one setting that needs to be enabled:<\/p>\n<p>&#8211; System Type &#8212;&gt; [*] Build 32-bit simulation on 64-bit machine<\/p>\n<p>You are now ready to build the image<\/p>\n<p style=\"padding-left: 30px;\"><code>make<\/code><\/p>\n<p>If there was no problem during the build you will find a &#8220;nuttx&#8221; file in the same directory. Just run it and you will see the NSH prompt.<\/p>\n<p style=\"padding-left: 30px;\"><code>.\/nuttx<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are also working with Nuttx, you will love the &#8220;sim&#8221; configuration. It will allow running a minimal version of Nuttx as a regular program on a linux machine (assuming 86x_64). Before getting the sources &hellip; <a class=\"more-link\" href=\"http:\/\/lazlo.de\/blog\/2014\/04\/02\/nuttx-on-linux\/\">More<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":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[115,102],"tags":[6,12,188,61,57],"class_list":["post-1267","post","type-post","status-publish","format-standard","hentry","category-software-work","category-work","tag-embedded","tag-linux","tag-nuttx","tag-operatingsystem","tag-programming"],"_links":{"self":[{"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/posts\/1267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/comments?post=1267"}],"version-history":[{"count":10,"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/posts\/1267\/revisions"}],"predecessor-version":[{"id":1275,"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/posts\/1267\/revisions\/1275"}],"wp:attachment":[{"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/media?parent=1267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/categories?post=1267"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/lazlo.de\/blog\/wp-json\/wp\/v2\/tags?post=1267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}