| <!-- |
| Documentation/_templates/layout.html |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. The |
| ASF licenses this file to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance with the |
| License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| License for the specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| |
| |
| <!DOCTYPE html> |
| <html class="writer-html5" lang="en"> |
| <head> |
| <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> |
| |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <title>pysimCoder integration with NuttX — NuttX latest documentation</title> |
| <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> |
| <link rel="stylesheet" type="text/css" href="../_static/css/theme.css" /> |
| <link rel="stylesheet" type="text/css" href="../_static/copybutton.css" /> |
| <link rel="stylesheet" type="text/css" href="../_static/custom.css" /> |
| |
| |
| <link rel="shortcut icon" href="../_static/favicon.ico"/> |
| <script src="../_static/jquery.js"></script> |
| <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script> |
| <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> |
| <script src="../_static/doctools.js"></script> |
| <script src="../_static/sphinx_highlight.js"></script> |
| <script src="../_static/clipboard.min.js"></script> |
| <script src="../_static/copybutton.js"></script> |
| <script src="../_static/js/theme.js"></script> |
| <link rel="index" title="Index" href="../genindex.html" /> |
| <link rel="search" title="Search" href="../search.html" /> |
| <link rel="next" title="Custom Boards How-To" href="customboards.html" /> |
| <link rel="prev" title="C++ Example using CMake" href="cpp_cmake.html" /> |
| </head> |
| |
| <body class="wy-body-for-nav"> |
| <div class="wy-grid-for-nav"> |
| <nav data-toggle="wy-nav-shift" class="wy-nav-side"> |
| <div class="wy-side-scroll"> |
| <div class="wy-side-nav-search" > |
| |
| <a href="../index.html" class="icon icon-home"> NuttX |
| |
| |
| |
| </a> |
| |
| <!-- this version selector is quite ugly, should be probably replaced by something |
| more modern --> |
| |
| <div class="version-selector"> |
| <select onchange="javascript:location.href = this.value;"> |
| |
| <option value="../../latest" selected="selected">latest</option> |
| |
| <option value="../../10.0.0" >10.0.0</option> |
| |
| <option value="../../10.0.1" >10.0.1</option> |
| |
| <option value="../../10.1.0" >10.1.0</option> |
| |
| <option value="../../10.2.0" >10.2.0</option> |
| |
| <option value="../../10.3.0" >10.3.0</option> |
| |
| <option value="../../11.0.0" >11.0.0</option> |
| |
| <option value="../../12.0.0" >12.0.0</option> |
| |
| <option value="../../12.1.0" >12.1.0</option> |
| |
| <option value="../../12.2.0" >12.2.0</option> |
| |
| <option value="../../12.2.1" >12.2.1</option> |
| |
| <option value="../../12.3.0" >12.3.0</option> |
| |
| <option value="../../12.4.0" >12.4.0</option> |
| |
| <option value="../../12.5.0" >12.5.0</option> |
| |
| <option value="../../12.5.1" >12.5.1</option> |
| |
| <option value="../../12.6.0" >12.6.0</option> |
| |
| <option value="../../12.7.0" >12.7.0</option> |
| |
| <option value="../../12.8.0" >12.8.0</option> |
| |
| <option value="../../12.9.0" >12.9.0</option> |
| |
| <option value="../../12.10.0" >12.10.0</option> |
| |
| <option value="../../12.11.0" >12.11.0</option> |
| |
| </select> |
| </div> |
| |
| |
| <div role="search"> |
| <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> |
| <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" /> |
| <input type="hidden" name="check_keywords" value="yes" /> |
| <input type="hidden" name="area" value="default" /> |
| </form> |
| </div> |
| |
| </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> |
| <p class="caption" role="heading"><span class="caption-text">Table of Contents</span></p> |
| <ul class="current"> |
| <li class="toctree-l1"><a class="reference internal" href="../index.html">Home</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../introduction/index.html">Introduction</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../quickstart/index.html">Getting Started</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../introduction/inviolables.html">The Inviolable Principles of NuttX</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../platforms/index.html">Supported Platforms</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../components/index.html">OS Components</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../applications/index.html">Applications</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../implementation/index.html">Implementation Details</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../reference/index.html">API Reference</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">FAQ</a></li> |
| <li class="toctree-l1 current"><a class="reference internal" href="index.html">Guides</a><ul class="current"> |
| <li class="toctree-l2"><a class="reference internal" href="nfs.html">NFS Client How-To</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="usbtrace.html">USB Device Trace</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="simulator.html">Simulator</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="qemugdb.html">How to debug NuttX using QEMU and GDB</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="rndis.html">How to use RNDIS</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="drivers.html">Drivers</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="tasktrace.html">Task Trace</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="cpp_cmake.html">C++ Example using CMake</a></li> |
| <li class="toctree-l2 current"><a class="current reference internal" href="#">pysimCoder integration with NuttX</a><ul> |
| <li class="toctree-l3"><a class="reference internal" href="#peripheral-support">Peripheral Support</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#nuttx-configuration">NuttX Configuration</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#using-pysimcoder-to-design-nuttx-application">Using pysimCoder to design NuttX application</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l2"><a class="reference internal" href="customboards.html">Custom Boards How-To</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="customapps.html">Custom Apps How-to</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="citests.html">Running CI Test Locally</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="zerolatencyinterrupts.html">High Performance: Zero Latency Interrupts, Maskable nested interrupts</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="kasan.html">The Kernel Address Sanitizer (KASAN)</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="nestedinterrupts.html">Nested Interrupts</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="cortexmhardfaults.html">Analyzing Cortex-M Hardfaults</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="coredump.html">Core Dump</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="coresight.html">Coresight - HW Assisted Tracing on ARM</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="gdbserver.html">gdbserver</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="gdbwithpython.html">GDB with Python</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="ofloader.html">Open Flash Loader</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="testingtcpip.html">Testing TCP/IP Network Stacks</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="automounter.html">Auto-Mounter</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="stm32nullpointer.html">STM32 Null Pointer Detection</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="stm32ccm.html">STM32 CCM Allocator</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="stackrecord.html">Run time stack statistics</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="etcromfs.html">etc romfs</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="thread_local_storage.html">Thread Local Storage</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l1"><a class="reference internal" href="../glossary.html">Glossary</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../logos/index.html">NuttX Logos</a></li> |
| </ul> |
| |
| </div> |
| </div> |
| </nav> |
| |
| <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > |
| <i data-toggle="wy-nav-top" class="fa fa-bars"></i> |
| <a href="../index.html">NuttX</a> |
| </nav> |
| |
| <div class="wy-nav-content"> |
| <div class="rst-content"> |
| <div role="navigation" aria-label="Page navigation"> |
| <ul class="wy-breadcrumbs"> |
| <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li> |
| <li class="breadcrumb-item"><a href="index.html">Guides</a></li> |
| <li class="breadcrumb-item active">pysimCoder integration with NuttX</li> |
| <li class="wy-breadcrumbs-aside"> |
| <a href="../_sources/guides/pysimcoder.rst.txt" rel="nofollow"> View page source</a> |
| </li> |
| </ul> |
| <hr/> |
| </div> |
| <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> |
| <div itemprop="articleBody"> |
| |
| <section id="pysimcoder-integration-with-nuttx"> |
| <span id="pysimcoder"></span><h1>pysimCoder integration with NuttX<a class="headerlink" href="#pysimcoder-integration-with-nuttx" title="Permalink to this heading"></a></h1> |
| <p><a class="reference external" href="https://github.com/robertobucher/pysimCoder">PysimCoder</a> is as an open source |
| Rapid Control Application Development Tool which is able to transfer block diagrams into C code. |
| Combined with NuttX, it can be used in real time control application and as an alternative to |
| expensive licensed programs and prototyping platforms. Example of <a class="reference external" href="https://www.youtube.com/watch?v=6HlGk3ecPNQ">DC motor control application</a> with PID controller and blocks for encoder, |
| PWM, GPIO and sending data over TCP to real time plotter can be seen on <a class="reference external" href="https://www.youtube.com/channel/UC0QciIlcUnjJkL5yJJBmluw">NuttX Channel</a>.</p> |
| <p>This documentation describes the steps that are needed to run application generated by pysimCoder |
| on NuttX and also keeps the track of peripherals that are supported by pysimCoder for NuttX RTOS.</p> |
| <section id="peripheral-support"> |
| <h2>Peripheral Support<a class="headerlink" href="#peripheral-support" title="Permalink to this heading"></a></h2> |
| <p>The following list shows the peripherals and fuctionalities supported in pysimCoder for NuttX RTOS.</p> |
| <table class="docutils align-default"> |
| <thead> |
| <tr class="row-odd"><th class="head"><p>Peripheral</p></th> |
| <th class="head"><p>Notes</p></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr class="row-even"><td><p>ADC</p></td> |
| <td></td> |
| </tr> |
| <tr class="row-odd"><td><p>CAN</p></td> |
| <td><p>Including SocketCAN</p></td> |
| </tr> |
| <tr class="row-even"><td><p>DAC</p></td> |
| <td></td> |
| </tr> |
| <tr class="row-odd"><td><p>ENC</p></td> |
| <td></td> |
| </tr> |
| <tr class="row-even"><td><p>GPIO</p></td> |
| <td></td> |
| </tr> |
| <tr class="row-odd"><td><p>PWM</p></td> |
| <td><p>Multichannel support</p></td> |
| </tr> |
| <tr class="row-even"><td><p>UART</p></td> |
| <td><p>Serial output</p></td> |
| </tr> |
| <tr class="row-odd"><td><p>Sensors</p></td> |
| <td><p>Basic support for DHTXX</p></td> |
| </tr> |
| <tr class="row-even"><td><p>TCP</p></td> |
| <td></td> |
| </tr> |
| <tr class="row-odd"><td><p>UDP</p></td> |
| <td></td> |
| </tr> |
| </tbody> |
| </table> |
| <p>Please note that the actual support for NuttX peripherals can be wider that what is mentioned here |
| in case this documentation was not updated when new fuctionalities were added to pysimCoder.</p> |
| </section> |
| <section id="nuttx-configuration"> |
| <h2>NuttX Configuration<a class="headerlink" href="#nuttx-configuration" title="Permalink to this heading"></a></h2> |
| <p>Several configuration options are necessary to be set in order to successfully compile pysimCoder |
| with NuttX. The list is the following:</p> |
| <table class="docutils align-default"> |
| <tbody> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_ARCH_RAMVECTORS=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NSH_FILE_APPS=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_BOARDCTL_APP_SYMTAB=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NSH_LINELEN=64</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_BOARDCTL_OS_SYMTAB=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NSH_READLINE=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_BUILTIN=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_ETC_ROMFS=y</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_ELF=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_PSEUDOTERM=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_FS_BINFS=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_TLS_NCLEANUP=1</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_FS_PROCFS=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_PTHREAD_MUTEX_TYPES=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_FS_PROCFS_REGISTER=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_PTHREAD_STACK_MIN=1024</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_FS_ROMFS=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_LIBM=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_FS_TMPFS=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_RR_INTERVAL=10</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_IDLETHREAD_STACKSIZE=2048</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SCHED_WAITPID=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_LIBC_EXECFUNCS=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SERIAL_TERMIOS=y</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_LIBC_STRERROR=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SYMTAB_ORDEREDBYNAME=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_MAX_TASKS=16</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SYSTEM_NSH=y</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NSH_BUILTIN_APPS=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SYSTEM_NSH_STACKSIZE=4096</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NSH_FILEIOSIZE=512</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_INIT_ENTRYPOINT="nsh_main"</span></code></p></td> |
| </tr> |
| </tbody> |
| </table> |
| <p>Note that <code class="docutils literal notranslate"><span class="pre">CONFIG_LIBM=y</span></code> might not be required for toolchains that already include |
| standard math library. However it is recommended to add <code class="docutils literal notranslate"><span class="pre">CONFIG_LIBM=y</span></code> to ensure |
| math library is included. Subsequently <code class="docutils literal notranslate"><span class="pre">CONFIG_LIBC_FLOATINGPOINT=y</span></code> is needed if double values |
| are to be printed on terminal.</p> |
| <p>In case you want to use Network and blocks like TCP or UDP, following configuration |
| options are required:</p> |
| <table class="docutils align-default"> |
| <tbody> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_ROUTE=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NETDB_DNSCLIENT=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_SOLINGER=y</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NETDEV_LATEINIT=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_STATISTICS=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NETDEV_STATISTICS=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_TCP=y</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NETINIT_DHCPC=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_TCPBACKLOG=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NETINIT_NOMAC=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_TCP_KEEPALIVE=y</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NETUTILS_FTPC=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_TCP_WRITE_BUFFERS=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NETUTILS_TELNETD=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_UDP=y</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NETUTILS_TFTPC=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SYSTEM_DHCPC_RENEW=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_ARP_SEND=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SYSTEM_NTPC=y</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_BROADCAST=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SYSTEM_PING6=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_IPv6=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SYSTEM_PING=y</span></code></p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_LOOPBACK=y</span></code></p></td> |
| <td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_SYSTEM_TEE=y</span></code></p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CONFIG_NET_PKT=y</span></code></p></td> |
| <td></td> |
| </tr> |
| </tbody> |
| </table> |
| <p>Board and application specific configuration like setting up peripherals or boot options might also be required, |
| please refer to board and platform documentation for those information. Once NuttX is configured it can be build |
| by simply running:</p> |
| <blockquote> |
| <div><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>make |
| </pre></div> |
| </div> |
| </div></blockquote> |
| <p>Then we need to export build NuttX which can be done by executing command</p> |
| <blockquote> |
| <div><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>make<span class="w"> </span><span class="nb">export</span> |
| </pre></div> |
| </div> |
| </div></blockquote> |
| <p>This creates a zip file nuttx-export-xx.x.x.zip where xx.x.x is the version of NuttX. This file then have to be |
| moved to pysimCoder directory pysimCoder/CodeGen/nuttx, unzip there and then renamed just to nuttx-export. Then |
| enter the pysimCoder/CodeGen/nuttx/device directory and execute</p> |
| <blockquote> |
| <div><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>make |
| </pre></div> |
| </div> |
| </div></blockquote> |
| <p>This compiles pysimCoder files that controls functions of separate blocks. PysimCoder can be either installed |
| on the system (please refer to the <a class="reference external" href="https://github.com/robertobucher/pysimCoder/blob/master/README.md">pysimCoder manual</a>) |
| or script pysim-run.sh can be used to run pysimCoder without the installation. This script can be found in pysimCoder |
| root directory and is run by executing command</p> |
| <blockquote> |
| <div><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./pysim-run.sh |
| </pre></div> |
| </div> |
| </div></blockquote> |
| <p>Please note that PYSUPSICTRL variable has to be set/exported in order to successfully compile NuttX application |
| designed with pysimCoder.</p> |
| </section> |
| <section id="using-pysimcoder-to-design-nuttx-application"> |
| <h2>Using pysimCoder to design NuttX application<a class="headerlink" href="#using-pysimcoder-to-design-nuttx-application" title="Permalink to this heading"></a></h2> |
| <p>After running pysimCoder, separate blocks can be selected from the library menu on the left hand side. The menu contains |
| several libraries, NuttX specific blocks can be found in library “NuttX”. It is also possible to use blocks from other |
| libraries like “input”, “output”, “math” and so on. Several blocks can have specific parameter options and various number |
| of inputs/outputs. Double left click on the block openes parameter settings while single right click on the block leads |
| to number of inputs/outputs setup. The pysimCoder interface can be seen in the picture below.</p> |
| <figure class="align-center" id="id1"> |
| <a class="reference internal image-reference" href="../_images/interface.png"><img alt="../_images/interface.png" src="../_images/interface.png" style="width: 100%;" /></a> |
| <figcaption> |
| <p><span class="caption-text">pysimCoder interface: library menu can be seen on the left hand side</span><a class="headerlink" href="#id1" title="Permalink to this image"></a></p> |
| </figcaption> |
| </figure> |
| <p>The NuttX template Makefile nuttx.tmf has to be selected in order to generate code for NuttX target. |
| This can be done in the top menu by clicking on Block settings icon which is highlighted in the red circle.</p> |
| <figure class="align-center" id="id2"> |
| <a class="reference internal image-reference" href="../_images/menu.png"><img alt="../_images/menu.png" src="../_images/menu.png" style="width: 100%;" /></a> |
| <figcaption> |
| <p><span class="caption-text">pysimCoder menu: red block settings, green generate C-code</span><a class="headerlink" href="#id2" title="Permalink to this image"></a></p> |
| </figcaption> |
| </figure> |
| <p>Block settings option open the following window (showed in the picture below) where you can set template Makefile and |
| also Python skript with parameters for the controllers.</p> |
| <figure class="align-center" id="id3"> |
| <a class="reference internal image-reference" href="../_images/template.png"><img alt="../_images/template.png" src="../_images/template.png" style="width: 100%;" /></a> |
| <figcaption> |
| <p><span class="caption-text">pysimCoder Block settings menu</span><a class="headerlink" href="#id3" title="Permalink to this image"></a></p> |
| </figcaption> |
| </figure> |
| <p>C code can be generated by selecting Generate C-code icon (highlighted in the green circle). Executable files are then |
| generated and can be flashed into the target. The flashing procedure can be target specific, please refer to platform´s |
| documentation. The generated application can be then run from NuttX command line by executing:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>nsh> main |
| </pre></div> |
| </div> |
| </section> |
| </section> |
| |
| |
| </div> |
| </div> |
| <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> |
| <a href="cpp_cmake.html" class="btn btn-neutral float-left" title="C++ Example using CMake" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> |
| <a href="customboards.html" class="btn btn-neutral float-right" title="Custom Boards How-To" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> |
| </div> |
| |
| <hr/> |
| |
| <div role="contentinfo"> |
| <p>© Copyright 2023, The Apache Software Foundation.</p> |
| </div> |
| |
| |
| |
| </footer> |
| </div> |
| </div> |
| </section> |
| </div> |
| <script> |
| jQuery(function () { |
| SphinxRtdTheme.Navigation.enable(true); |
| }); |
| </script> |
| |
| </body> |
| </html> |