{"id":8330,"date":"2018-09-17T12:14:55","date_gmt":"2018-09-17T12:14:55","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=8330"},"modified":"2019-01-27T09:47:57","modified_gmt":"2019-01-27T09:47:57","slug":"hifive-1","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=8330","title":{"rendered":"TSM_EmbReal &#8211; HiFive 1"},"content":{"rendered":"<p><a href=\"https:\/\/www.crowdsupply.com\/sifive\/hifive1\">HiFive1 | Crowd Supply<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/SiFive\">Wikipedia SiFive<\/a><\/p>\n<p><a href=\"https:\/\/www.sifive.com\/products\/hifive1\/\">HiFive1 | SiFive<\/a><br \/>\n<a href=\"https:\/\/www.sifive.com\/documentation\/\">Documentation | SiFive<\/a><br \/>\n<a href=\"https:\/\/www.sifive.com\/products\/tools\/\">RISC-V Tools | SiFive<\/a><\/p>\n<p><a href=\"https:\/\/www.segger.com\/news\/segger-adds-support-for-sifives-coreplex-ip-to-its-industry-leading-j-link-debug-probe\/\">SEGGER Adds Support for SiFive&#8217;s Coreplex IP to Its Industry Leading J-Link Debug Probe<\/a><br \/>\n<a href=\"https:\/\/mcuoneclipse.com\/2018\/08\/17\/open-source-risc-eclipse-with-risc-v-on-the-sifive-hifive1-board\/\">Open Source RISC \u2013 Eclipse with RISC-V on the SiFive HiFive1 Board<\/a><br \/>\n<a href=\"http:\/\/docs.platformio.org\/en\/latest\/platforms\/riscv.html\">PlatformIO RISC-V<\/a><br \/>\n<a href=\"https:\/\/riscv.org\/?utm_source=platformio&#038;utm_medium=docs\">RISC-V Foundation | Instruction Set Architecture (ISA)<\/a><\/p>\n<h3>Tutorials<\/h3>\n<p><a href=\"http:\/\/embeddedsystems.io\/fe310g-open-source-riscv-microcontroller-part1\/\">FE310G: an open source RISC-V microcontroller \u2013 Introduction<\/a><br \/>\n<a href=\"http:\/\/embeddedsystems.io\/fe310g-open-source-riscv-microcontroller-interrupt-system\/\">FE310G: an open source RISC-V microcontroller \u2013 Interrupt System<\/a><br \/>\n<a href=\"http:\/\/embeddedsystems.io\/fe310g-open-source-riscv-microcontroller-ide-getting-started\/\">FE310G: an open source RISC-V microcontroller \u2013 IDE<\/a><\/p>\n<h3>Core vs. Hart<\/h3>\n<p><a href=\"https:\/\/groups.google.com\/a\/groups.riscv.org\/forum\/#!topic\/sw-dev\/QKjUDjz_vKo\">Definition of &#8220;hart&#8221;<\/a><br \/>\n<a href=\"https:\/\/github.com\/riscv\/riscv-isa-manual\/issues\/114\">Add a definition for hart<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/42676827\/riscv-spec-references-the-word-hart-what-does-hart-mean\">RiscV spec references the word &#8216;hart&#8217; &#8211; what does &#8216;hart&#8217; mean?<\/a><\/p>\n<h3>Platform<\/h3>\n<p><a href=\"https:\/\/greenwaves-technologies.com\/en\/gap8-the-internet-of-things-iot-application-processor\/\">GreenWaves Technologies GAP8: The IoT Application Processor<\/a><br \/>\n<a href=\"https:\/\/www.pulp-platform.org\/\">PULP Platform &#8211; Open hardware, the way it should be!<\/a><\/p>\n<h3>Abbrefiations and Dictionary<\/h3>\n<table>\n<tr>\n<td>ISR<\/td>\n<td>Interrupt Service Routine<\/td>\n<\/tr>\n<tr>\n<td>IST<\/td>\n<td>Interrupt Service Table<\/td>\n<\/tr>\n<tr>\n<td>CSR<\/td>\n<td>Control status register<\/td>\n<\/tr>\n<tr>\n<td>IER<\/td>\n<td>Interrupt enable register<\/td>\n<\/tr>\n<tr>\n<td>ISA<\/td>\n<td>Instruction Set Architecture<\/td>\n<\/tr>\n<tr>\n<td>PLIC<\/td>\n<td>Platform-Level Interrupt Controller<\/td>\n<\/tr>\n<tr>\n<td>CLINT<\/td>\n<td>Core Local Interruptor<\/td>\n<\/tr>\n<tr>\n<td>AON<\/td>\n<td>Always-On<\/td>\n<\/tr>\n<tr>\n<td>WDT<\/td>\n<td>Watchdog Timer<\/td>\n<\/tr>\n<tr>\n<td>RTC<\/td>\n<td>Real-Time Clock<\/td>\n<\/tr>\n<tr>\n<td>PMU<\/td>\n<td>Power-Management Unit<\/td>\n<\/tr>\n<tr>\n<td>OTP<\/td>\n<td>One-Time Programmable Memory<\/td>\n<\/tr>\n<tr>\n<td>GPIO<\/td>\n<td>General Purpose Input\/Output Controller<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<h3>git<\/h3>\n<p><a href=\"https:\/\/gitlab.fhnw.ch\/hans.buchmann\">GitLab: Hans Buchmann<\/a><br \/>\n<a href=\"https:\/\/gitlab.fhnw.ch\/edu\/tsm-embreal\">gitlab.fhnw.ch\/edu\/tsm-embreal<\/a><\/p>\n<h3>Wikipedia<\/h3>\n<p><a href=\"https:\/\/de.wikipedia.org\/wiki\/Befehlssatz\">Befehlssatz<\/a>, Instruction Set<br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Befehlssatzarchitektur\">Befehlssatzarchitektur<\/a>, Instruction Set Architecture (ISA)<\/p>\n<h2>Hardware I\/O Functions \/ Alternate Functions (UART, SPI, PWM)<\/h2>\n<p><a href=\"https:\/\/wiki.osdev.org\/HiFive-1_Bare_Bones\">HiFive-1 Bare Bones<\/a><br \/>\n<a href=\"https:\/\/forums.sifive.com\/t\/gpio-iof-sel-in-led-fade-demo\/838\">PIO_IOF_SEL in LED Fade Demo<\/a><br \/>\n<a href=\"https:\/\/github.com\/sifive\/freedom-e-sdk\/blob\/master\/bsp\/include\/sifive\/devices\/gpio.h\">github.com\/sifive\/freedom-e-sdk\/blob\/master\/bsp\/include\/sifive\/devices\/gpio.h<\/a><br \/>\n<a href=\"https:\/\/github.com\/sifive\/freedom-e-sdk\/blob\/master\/software\/led_fade\/led_fade.c\">https:\/\/github.com\/sifive\/freedom-e-sdk\/blob\/master\/software\/led_fade\/led_fade.c<\/a><br \/>\n<a href=\"https:\/\/github.com\/sifive\/freedom-e-sdk\/blob\/master\/bsp\/env\/freedom-e300-arty\/platform.h\">https:\/\/github.com\/sifive\/freedom-e-sdk\/blob\/master\/bsp\/env\/freedom-e300-arty\/platform.h<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/RIOT-OS\/RIOT\/blob\/master\/cpu\/fe310\/include\/vendor\/platform.h\">github.com\/RIOT-OS\/RIOT\/blob\/master\/cpu\/fe310\/include\/vendor\/platform.h<\/a><\/p>\n<p><a href=\"https:\/\/lists.rtems.org\/pipermail\/devel\/2017-August\/018752.html\">[PATCH 12\/15] HiFive1: add UART support<\/a><br \/>\n<a href=\"https:\/\/devel.rtems.org\/wiki\/GSoC\/2017\/RTEMS_for_HiFive1\">RTEMS BSP for HiFive1<\/a><br \/>\n<a href=\"https:\/\/embeddedden.blogspot.com\/2017\/05\/pregsoc-2017-make-port-of-rtems-for.html\">[PreGSoC 2017] Make a port of RTEMS for HiFive1<\/a><br \/>\n<a href=\"https:\/\/summerofcode.withgoogle.com\/archive\/2017\/projects\/4780624749527040\/\">Utilizing full power of RISC-V architecture via usage of RTEMS on top of SiFive FE310 processors<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nGPIO_IOF_EN\r\nGPIO_IOF_SEL\r\n\r\nvs.\r\n\r\nGPIO_OUTPUT_EN\r\nGPIO_OUTPUT_VAL\r\n<\/pre>\n<h2>C++<\/h2>\n<h3>C++ Standard<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/44734397\/which-c-standard-is-the-default-when-compiling-with-g\">Which C++ standard is the default when compiling with g++?<\/a><br \/>\n<a href=\"https:\/\/gcc.gnu.org\/onlinedocs\/cpp\/Standard-Predefined-Macros.html\">Standard Predefined Macros<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ g++ -dM -E -x c++  \/dev\/null | grep -F __cplusplus\r\n#define __cplusplus 201402L ==&gt; 2014 C++ standard\r\n<\/pre>\n<h3>C++ Syntax<\/h3>\n<h4>Private members<\/h4>\n<pre class=\"brush: cpp; title: PrivateClass.h; notranslate\" title=\"PrivateClass.h\">\r\nclass PrivateClass {\r\n\r\n    int a;\r\n    int b;\r\n\r\n    PrivateClass();\r\n};\r\n\r\nPrivateClass::PrivateClass() :\r\na(0),\r\nb(1)\r\n{\r\n    \/\/\r\n}\r\n<\/pre>\n<pre class=\"brush: cpp; title: main.cpp; notranslate\" title=\"main.cpp\">\r\n#include &quot;PrivateClass.h&quot;\r\n\r\nint main()\r\n{\r\n    PrivateClass k;\r\n}\r\n<\/pre>\n<pre class=\"brush: plain; title: Build; notranslate\" title=\"Build\">\r\nsrc\/main.cpp: In function \u2018int main()\u2019:\r\nsrc\/main.cpp: error: \u2018PrivateClass::PrivateClass()\u2019\r\n                     is private within this context\r\n     PrivateClass k;\r\n<\/pre>\n<h4>Private Static Instantiation<\/h4>\n<pre class=\"brush: cpp; title: StaticClass.h; notranslate\" title=\"StaticClass.h\">\r\n#include &quot;stdio.h&quot;\r\n\r\nclass StaticClass {\r\n\r\n    static StaticClass k;\r\n\r\n    int a;\r\n    int b;\r\n\r\n    StaticClass();\r\n};\r\n\r\nStaticClass StaticClass::k;\r\n\r\nStaticClass::StaticClass() :\r\na(0),\r\nb(1)\r\n{\r\n    printf(&quot;Hurra\\n&quot;);\r\n}\r\n<\/pre>\n<pre class=\"brush: cpp; title: main.cpp; notranslate\" title=\"main.cpp\">\r\nint main()\r\n{\r\n    \/\/\r\n}\r\n<\/pre>\n<pre class=\"brush: plain; title: Run; notranslate\" title=\"Run\">\r\n$ .\/main\r\nHurra\r\n<\/pre>\n<h4>final<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/8824587\/what-is-the-purpose-of-the-final-keyword-in-c11-for-functions\">What is the purpose of the \u201cfinal\u201d keyword in C++11 for functions?<\/a><br \/>\n<a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/final\">final specifier (since C++11)<\/a><br \/>\n<a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/override\">override specifier (since C++11)<\/a><\/p>\n<pre class=\"brush: cpp; title: final class; notranslate\" title=\"final class\">\r\nclass Person final {\r\n   &#x5B;...]\r\n}\r\n\r\nclass Andreas : Person {\r\n   &#x5B;...]\r\n};\r\n\r\n\/\/ error: cannot derive from \u2018final\u2019 base \u2018Person\u2019 in derived type \u2018Andreas\u2019\r\n<\/pre>\n<pre class=\"brush: cpp; title: final method; notranslate\" title=\"final method\">\r\nclass Person {\r\n   virtual void print() final;\r\n}\r\n\r\nclass Andreas : Person {\r\n   virtual void print() final;\r\n};\r\n\r\n\/\/ error: virtual function \u2018virtual void Andreas::print()\u2019\r\n\/\/ overriding final function \u2018virtual void Person::print()\u2019\r\n<\/pre>\n<h4>static vs. const<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/185844\/how-to-initialize-private-static-members-in-c\">How to initialize private static members in C++?<\/a><\/p>\n<pre class=\"brush: cpp; title: ConstClass.h; notranslate\" title=\"ConstClass.h\">\r\nclass ConstClass {\r\n\r\n    static int a       = 1;\r\n    static const int b = 2;\r\n\r\n    ConstClass();\r\n};\r\n\r\nConstClass::ConstClass()\r\n{\r\n    \/\/\r\n}\r\n<\/pre>\n<pre class=\"brush: cpp; title: main.cpp; notranslate\" title=\"main.cpp\">\r\nint main()\r\n{\r\n    \/\/\r\n}\r\n<\/pre>\n<pre class=\"brush: plain; title: Build; notranslate\" title=\"Build\">\r\nIn file included from src\/ConstClass.cpp:2:0:\r\ninclude\/ConstClass.h:6:16: error: ISO C++ forbids in-class\r\n                                  initialization of non-const\r\n                                  static member \u2018ConstClass::a\u2019\r\n     static int a       = 1;\r\n<\/pre>\n<pre class=\"brush: cpp; title: ConstClass.h (working); notranslate\" title=\"ConstClass.h (working)\">\r\nclass ConstClass {\r\n\r\n    static int a;\r\n    static const int b = 2;\r\n\r\n    ConstClass();\r\n};\r\n\r\nint ConstClass::a = 1;\r\n\r\nConstClass::ConstClass()\r\n{\r\n    \/\/\r\n}\r\n<\/pre>\n<h4>const<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/751681\/meaning-of-const-last-in-a-function-declaration-of-a-class\">Meaning of &#8216;const&#8217; last in a function declaration of a class?<\/a><br \/>\n<a href=\"https:\/\/de.wikibooks.org\/wiki\/C%2B%2B-Programmierung\/_Eigene_Datentypen_definieren\/_Methoden\">C++-Programmierung\/ Eigene Datentypen definieren\/ Methoden<\/a><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nclass Person {\r\n    void foo() const;   \/* this pointer is const =&gt;\r\n                           cannot change any member data *\/\r\n}\r\n\r\nclass A {\r\n    public:\r\n        int a, b, c, d;\r\n};\r\n\r\nclass B {\r\n    public:\r\n        \/* Das \u00fcbergebene A-Objekt ist innerhalb \r\n           der Methode konstant *\/\r\n        void methode(A const&amp; parameter_name);\r\n};\r\n<\/pre>\n<h4>Operator Overload<\/h4>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nclass Person {\r\n    operator unsigned() const;   \/* cast-operator *\/\r\n}\r\n<\/pre>\n<h4>template<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/499106\/what-does-template-unsigned-int-n-mean\">What does template <unsigned int N> mean?<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Template_(C%2B%2B)\">Template (C++)<\/a><\/p>\n<p>Type Parameters<\/p>\n<ul>\n<li>Types<\/li>\n<li>Templates<\/li>\n<\/ul>\n<p>Non-type Parameters<\/p>\n<ul>\n<li>Pointers<\/li>\n<li>References<\/li>\n<li>Integral constant expressions<\/li>\n<\/ul>\n<p>In fact, we can create algorithms which evaluate at compile time (from <a href=\"https:\/\/en.wikipedia.org\/wiki\/Template_metaprogramming\">Wikipedia<\/a>):<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\ntemplate &lt;int N&gt;\r\nstruct Factorial \r\n{\r\n     enum { value = N * Factorial&lt;N - 1&gt;::value };\r\n};\r\n\r\ntemplate &lt;&gt;\r\nstruct Factorial&lt;0&gt; \r\n{\r\n    enum { value = 1 };\r\n};\r\n\r\n\/\/ Factorial&lt;4&gt;::value == 24\r\n\/\/ Factorial&lt;0&gt;::value == 1\r\nvoid foo()\r\n{\r\n    int x = Factorial&lt;4&gt;::value; \/\/ == 24\r\n    int y = Factorial&lt;0&gt;::value; \/\/ == 1\r\n}\r\n<\/pre>\n<h4>constexpr<\/h4>\n<ul>\n<li>A constexpr variable&#8230;<\/li>\n<li>A constexpr function&#8230;<\/li>\n<li>A constexpr constructor&#8230;<\/li>\n<\/ul>\n<p><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/constexpr\">constexpr specifier (since C++11)<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/14116003\/difference-between-constexpr-and-const\">Difference between `constexpr` and `const`<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/4748083\/when-should-you-use-constexpr-capability-in-c11\">When should you use constexpr capability in C++11?<\/a><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nclass Person {\r\n    operator unsigned() const;   \/* cast-operator *\/\r\n}\r\n<\/pre>\n<h4>decltype<\/h4>\n<p><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/decltype\">decltype specifier<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Decltype\">decltype<\/a><br \/>\n<a href=\"https:\/\/arne-mertz.de\/2017\/01\/decltype-declval\/\">Modern C++ Features \u2013 decltype and std::declval<\/a><br \/>\n<a href=\"https:\/\/www.cprogramming.com\/c++11\/c++11-auto-decltype-return-value-after-function.html\">Improved Type Inference in C++11: auto, decltype, and the new function declaration syntax<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/48182676\/c-equivalent-to-c-decltype\">C equivalent to C++ decltype<\/a><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nnamespace sys::pa {\r\n    \/* Statt dem statischen Datentyp einfach der Datentyp,\r\n       der in CSR::mstatus benutzt wird.\r\n\r\n       decltype \u201creturns\u201d a type. *\/\r\n    \/* \r\n    decltype(CSR::mstatus) CSR::mstatus;\r\n}\r\n\r\nstruct A { double x; };\r\nconst A* a;\r\n\r\n\/* type of y is double (declared type) *\/\r\ndecltype(a-&gt;x) y;\r\n\r\n\/* type of z is const double&amp; (lvalue expression) *\/\r\ndecltype((a-&gt;x)) z = y;\r\n \r\n\/* return type depends on template parameters.\r\n   return type can be deduced since C++14 *\/\r\ntemplate&lt;typename T, typename U&gt;\r\nauto add(T t, U u) -&gt; decltype(t + u)\r\n{\r\n    return t+u;\r\n}\r\n<\/pre>\n<h3>RISC-V Assembly<\/h3>\n<p><a href=\"https:\/\/wiki.osdev.org\/C%2B%2B_to_ASM_linkage_in_GCC\">C++ to ASM linkage in GCC<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ cat hardware-register-extern-asm.S | \\\r\n  c++filt &gt; hardware-register-extern-asm2.S\r\n<\/pre>\n<pre class=\"brush: plain; title: Mangle\/Mangling; notranslate\" title=\"Mangle\/Mangling\">\r\nint getObjId(void);         =&gt; _ZN8getObjIdEv\r\nint getObjId(int);          =&gt; _ZN8getObjIdEi\r\nint getObjId(unsigned int); =&gt; _ZN8getObjIdEj\r\n\r\n'this is a mangled symbol' (_Z).\r\n'It has 8 characters of user-defined symbol relevance' (8),\r\n(v=void, i=int, j=unsigned int...). \r\n<\/pre>\n<pre class=\"brush: plain; title: g++; notranslate\" title=\"g++\">\r\n_GLOBAL__sub_I__ZN3App3appE:\r\n\tcall\t_Z41__static_initialization_and_destruction_0ii\r\n\tcall\t__static_initialization_and_destruction_0(int, int)  &#x5B;demangled]\r\n\r\n_Z41__static_initialization_and_destruction_0ii:\r\n__static_initialization_and_destruction_0(int, int):  &#x5B;demangled]\r\n\tcall\t_ZN3AppC1Ev\r\n\tcall\tApp::App()  &#x5B;demangled]\r\n\r\n_ZN3App3appE:\r\nApp::app: &#x5B;demangled]\r\n\r\n_ZN3AppC2Ev: (_ZN3AppC1Ev)\r\nApp::App():  &#x5B;demangled]\r\n\r\n<\/pre>\n<pre class=\"brush: plain; title: objdump; notranslate\" title=\"objdump\">\r\n20400480 &lt;_Z41__static_initialization_and_destruction_0ii&gt;:\r\n2040049e:\t374d                \tjal\t20400440 &lt;_ZN3sys5Msg_1C1Ev&gt;\r\n&#x5B;...]\r\n204004c0 &lt;_GLOBAL__sub_I__ZN3sys5Msg_13msgE&gt;:\r\n204004cc:\t3f55                \tjal\t20400480 &lt;_Z41__static_initialization_and_destruction_0ii&gt;\r\n\r\n\r\n20404160 &lt;_Z41__static_initialization_and_destruction_0ii&gt;:\r\n2040417e:\t370d                \tjal\t204040a0 &lt;_ZN3AppC1Ev&gt;\r\n&#x5B;...]\r\n20404000 &lt;_GLOBAL__sub_I__ZNK3sys3Mod5Entry4showEPFvvE&gt;:\r\n2040400c:\t3f55                \tjal\t20403fc0 &lt;_Z41__static_initialization_and_destruction_0ii&gt;\r\n\r\n\r\n20403fc0 &lt;_Z41__static_initialization_and_destruction_0ii&gt;:\r\n20403fde:\t2089                \tjal\t20404020 &lt;_ZN3sys7BuildIDC1Ev&gt;\r\n&#x5B;...]\r\n204041a0 &lt;_GLOBAL__sub_I__ZN3App3appE&gt;:\r\n204041ac:\t3f55                \tjal\t20404160 &lt;_Z41__static_initialization_and_destruction_0ii&gt;\r\n<\/pre>\n<h4>Extern vs. Pointer<\/h4>\n<pre class=\"brush: plain; title: hardware-register-extern.cc; notranslate\" title=\"hardware-register-extern.cc\">\r\n204040a0:       1101                    addi    sp,sp,-32\r\n204040a2:       ce06                    sw      ra,28(sp)\r\n204040a4:       c62a                    sw      a0,12(sp)\r\n204040a6:       100127b7                lui     a5,0x10012\r\n204040aa:       00078793                mv      a5,a5\r\n204040ae:       4798                    lw      a4,8(a5)\r\n204040b0:       004007b7                lui     a5,0x400\r\n204040b4:       8f5d                    or      a4,a4,a5\r\n204040b6:       100127b7                lui     a5,0x10012\r\n204040ba:       00078793                mv      a5,a5\r\n204040be:       c798                    sw      a4,8(a5)\r\n204040c0:       100127b7                lui     a5,0x10012\r\n204040c4:       00078793                mv      a5,a5\r\n204040c8:       47d8                    lw      a4,12(a5)\r\n204040ca:       004007b7                lui     a5,0x400\r\n204040ce:       8f5d                    or      a4,a4,a5\r\n204040d0:       100127b7                lui     a5,0x10012\r\n204040d4:       00078793                mv      a5,a5\r\n204040d8:       c7d8                    sw      a4,12(a5)\r\n204040da:       204047b7                lui     a5,0x20404\r\n\r\nApp::App():\r\n.LFB108:\r\n        addi    sp,sp,-32\r\n        sw      ra,28(sp)\r\n        sw      a0,12(sp)\r\n.LBB2:\r\n        \r\n        lui     a5,%hi(GPIO)\r\n        addi    a5,a5,%lo(GPIO)\r\n        lw      a4,8(a5)\r\n        \r\n        li      a5,4194304\r\n        or      a4,a4,a5\r\n        \r\n        lui     a5,%hi(GPIO)\r\n        addi    a5,a5,%lo(GPIO)\r\n        sw      a4,8(a5)\r\n        \r\n        lui     a5,%hi(GPIO)\r\n        addi    a5,a5,%lo(GPIO)\r\n        lw      a4,12(a5)\r\n        \r\n        li      a5,4194304\r\n        or      a4,a4,a5\r\n        \r\n        lui     a5,%hi(GPIO)\r\n        addi    a5,a5,%lo(GPIO)\r\n        sw      a4,12(a5)\r\n<\/pre>\n<pre class=\"brush: plain; title: hardware-register-pointer.cc; notranslate\" title=\"hardware-register-pointer.cc\">\r\n204040a0:       7179                    addi    sp,sp,-48\r\n204040a2:       d606                    sw      ra,44(sp)\r\n204040a4:       d422                    sw      s0,40(sp)\r\n204040a6:       c62a                    sw      a0,12(sp)\r\n204040a8:       100127b7                lui     a5,0x10012\r\n204040ac:       cc3e                    sw      a5,24(sp)\r\n204040ae:       47e2                    lw      a5,24(sp)\r\n204040b0:       4798                    lw      a4,8(a5)\r\n204040b2:       004007b7                lui     a5,0x400\r\n204040b6:       8f5d                    or      a4,a4,a5\r\n204040b8:       47e2                    lw      a5,24(sp)\r\n204040ba:       c798                    sw      a4,8(a5)\r\n204040bc:       47e2                    lw      a5,24(sp)\r\n204040be:       43d8                    lw      a4,4(a5)\r\n204040c0:       001007b7                lui     a5,0x100\r\n204040c4:       8f5d                    or      a4,a4,a5\r\n204040c6:       47e2                    lw      a5,24(sp)\r\n204040c8:       c3d8                    sw      a4,4(a5)\r\n204040ca:       47e2                    lw      a5,24(sp)\r\n204040cc:       47d8                    lw      a4,12(a5)\r\n204040ce:       004007b7                lui     a5,0x400\r\n204040d2:       8f5d                    or      a4,a4,a5\r\n204040d4:       47e2                    lw      a5,24(sp)\r\n204040d6:       c7d8                    sw      a4,12(a5)\r\n204040d8:       204057b7                lui     a5,0x20405\r\n\r\nApp::App():\r\n.LFB108:\r\n        addi    sp,sp,-48\r\n        sw      ra,44(sp)\r\n        sw      s0,40(sp)\r\n        sw      a0,12(sp)\r\n.LBB4:\r\n.LBB5:\r\n        \r\n        li      a5,268509184\r\n        sw      a5,24(sp)\r\n        \r\n        lw      a5,24(sp)\r\n        lw      a4,8(a5)\r\n        \r\n        li      a5,4194304\r\n        or      a4,a4,a5\r\n        \r\n        lw      a5,24(sp)\r\n        sw      a4,8(a5)\r\n        \r\n        lw      a5,24(sp)\r\n        lw      a4,4(a5)\r\n        \r\n        li      a5,1048576\r\n        or      a4,a4,a5\r\n        \r\n        lw      a5,24(sp)\r\n        sw      a4,4(a5)\r\n        \r\n        lw      a5,24(sp)\r\n        lw      a4,12(a5)\r\n        \r\n        li      a5,4194304\r\n        or      a4,a4,a5\r\n        \r\n        lw      a5,24(sp)\r\n        sw      a4,12(a5)\r\n<\/pre>\n<h3>C++ Optimizing<\/h3>\n<p><a href=\"https:\/\/www.agner.org\/optimize\/optimizing_cpp.pdf\">Optimizing software in C++ &#8211; An optimization guide for Windows, Linux and Mac platforms<\/a> (2018)<\/p>\n<h3>x86-64<\/h3>\n<p><a href=\"https:\/\/de.wikipedia.org\/wiki\/X86-Prozessor\">x86-Prozessor<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/X64\">x64<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/X86_calling_conventions\">x86 calling conventions<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/X86_assembly_language\">x86 assembly language<\/a><br \/>\n<a href=\"https:\/\/de.wikibooks.org\/wiki\/Assembler-Programmierung_f%C3%BCr_x86-Prozessoren\">Assembler-Programmierung f\u00fcr x86-Prozessoren<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/972602\/limitations-of-intel-assembly-syntax-compared-to-att\">Limitations of Intel Assembly Syntax Compared to AT&#038;T<\/a>, GNU tools and how to use AT&#038;T \/ Intel Syntax<br \/>\n<a href=\"https:\/\/en.wikibooks.org\/wiki\/X86_Assembly\/GAS_Syntax\">X86 Assembly\/GAS Syntax<\/a><br \/>\n<a href=\"http:\/\/flint.cs.yale.edu\/cs421\/papers\/x86-asm\/asm.html\">x86 Assembly Guide<\/a><br \/>\n<a href=\"https:\/\/www.engr.mun.ca\/~anderson\/teaching\/8894\/reference\/x86-assembly\/\">x86-64 Assembly Programming<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/1699748\/what-is-the-difference-between-mov-and-lea\">What is the difference between MOV and LEA?<\/a><br \/>\n<a href=\"https:\/\/idea.popcount.org\/2013-07-16-baby-steps-in-x86-assembly\/\">Baby steps in x86 assembly<\/a><\/p>\n<h4>Calling Convention<\/h4>\n<p><a href=\"https:\/\/www3.nd.edu\/~dthain\/courses\/cse40243\/fall2015\/intel-intro.html\">Introduction to X86-64 Assembly for Compiler Writers<\/a>, 2015<br \/>\n<a href=\"http:\/\/www.x86-64.org\/documentation\/abi.pdf\">System V ABI<\/a> (PDF)<br \/>\n<a href=\"https:\/\/wiki.osdev.org\/System_V_ABI\">System V ABI<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/X86_calling_conventions#x86-64_calling_conventions\">Wikipedia: x86 calling conventions<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/20637569\/assembly-registers-in-64-bit-architecture\/20637866\">Assembly registers in 64-bit architecture<\/a><br \/>\n<a href=\"https:\/\/reverseengineering.stackexchange.com\/questions\/14165\/passing-argument-through-registers-instead-of-the-stack\">Passing argument through registers instead of the stack<\/a><\/p>\n<h4>Books<\/h4>\n<p>Guide to Assembly Language Programming in Linux, Teil 1, Sivarama P. Dandamudi<\/p>\n<h4>0xax.github.io<\/h4>\n<p><a href=\"https:\/\/0xax.github.io\/\">Just a memo &#8211; My posts about Linux kernel and low-level stuff<\/a><br \/>\n<a href=\"https:\/\/0xax.github.io\/asm_1\/\">Say hello to x86_64 Assembly [part 1]<\/a><br \/>\n<a href=\"https:\/\/0xax.github.io\/asm_2\/\">Say hello to x86_64 Assembly [part 2]<\/a><br \/>\n<a href=\"https:\/\/0xax.github.io\/asm_3\/\">Say hello to x86_64 Assembly [part 3]<\/a><br \/>\n<a href=\"https:\/\/0xax.github.io\/asm_4\/\">Say hello to x86_64 Assembly [part 4]<\/a><br \/>\n<a href=\"https:\/\/0xax.github.io\/asm_5\/\">Say hello to x86_64 Assembly [part 5]<\/a><br \/>\n<a href=\"https:\/\/0xax.github.io\/asm_6\/\">Say hello to x86_64 Assembly [part 6]<\/a><br \/>\n<a href=\"https:\/\/0xax.github.io\/asm_7\/\">Say hello to x86_64 Assembly [part 7]<\/a><br \/>\n<a href=\"https:\/\/0xax.github.io\/asm_8\/\">Say hello to x86_64 Assembly [part 8]<\/a><\/p>\n<h4>gcc \/ g++<\/h4>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n-o file     Place output in file file. This applies to whatever sort of output\r\n            is being produced, whether it be an executable file, an object file,\r\n            an assembler file or preprocessed C code. \r\n-c          Compile or assemble the source files, but do not link. The linking\r\n            stage simply is not done. The ultimate output is in the form of an\r\n            object file for each source file. \r\n-S          Stop after the stage of compilation proper; do not assemble. The\r\n            output is in the form of an assembler code file for each non-assembler\r\n            input file specified.\r\n-E          Stop after the preprocessing stage; do not run the compiler proper.\r\n            The output is in the form of preprocessed source code, which is sent\r\n            to the standard output. \r\n-O0         Reduce compilation time and make debugging produce the expected results.\r\n            This is the default.\r\n-O1         Optimize. Optimizing compilation takes somewhat more time, and a lot\r\n            more memory for a large function. \r\n-O2         Optimize even more. GCC performs nearly all supported optimizations\r\n            that do not involve a space-speed tradeoff. \r\n<\/pre>\n<h4>gdb<\/h4>\n<p><a href=\"http:\/\/users.ece.utexas.edu\/~adnan\/gdb-refcard.pdf\">GDB QUICK REFERENCE<\/a> (PDF)<br \/>\n<a href=\"https:\/\/niranjanmr.wordpress.com\/2013\/04\/28\/using-gdb-layout-when-debugging-assembly-language-programs\/\">Using gdb layout when debugging Assembly Language Programs<\/a><\/p>\n<p><a href=\"http:\/\/visualgdb.com\/gdbreference\/commands\/set_disassembly-flavor\"><code>set disassembly-flavor<\/code> command<\/a><br \/>\n<a href=\"https:\/\/sourceware.org\/gdb\/onlinedocs\/gdb\/TUI-Commands.html\">TUI-specific Commands<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ gdb swap\r\n(gdb) b main\r\n(gdb) r\r\n\r\n(gdb) set print asm-demangle on\r\n\r\n### Disassembly Format\r\n(gdb) set disassembly-flavor att\r\n(gdb) set disassembly-flavor intel\r\n(gdb) show disassembly-flavor\r\n\r\n### TUI Commands\r\n(gdb) tui enable\r\n(gdb) tui disable\r\n(gdb) layout asm\r\n(gdb) layout src\r\n(gdb) layout split\r\n(gdb) layout regs\r\n(gdb) focus asm\r\n(gdb) focus src\r\n(gdb) focus regs\r\n(gdb) refresh\r\n(gdb) update\r\n\r\n### Assembly\r\n(gdb) ni   (next ASM)\r\n(gdb) si   (step into ASM)\r\n\r\n### Sow Registers\r\n(gdb) info reg rdi\r\nrdi            0x7fffffffddb0   140737488346544\r\n(gdb) info reg rdi\r\nrsi            0x7fffffffddb4   140737488346548\r\n\r\n### Examine\r\n(gdb) x 0x7fffffffddb0\r\n0x7fffffffddb0: 0x00000001\r\n(gdb) x 0x7fffffffddb4\r\n0x7fffffffddb4: 0x00000002\r\n(gdb) x $rdi\r\n0x7fffffffddb0: 0x00000001\r\n(gdb) x\/i $pc  &lt;== Program Counter\r\n=&gt; 0x5555555546ab &lt;swap+1&gt;:     mov    %rsp,%rbp\r\n(gdb) x\/i $rip &lt;== Instruction Pointer\r\n=&gt; 0x5555555546ab &lt;swap+1&gt;:     mov    %rsp,%rbp\r\n<\/pre>\n<p><a href=\"http:\/\/visualgdb.com\/gdbreference\/commands\/x\"><code>x<\/code> command<\/a>, Displays the memory contents at a given address<br \/>\n<a href=\"http:\/\/visualgdb.com\/gdbreference\/commands\/print\"><code>print<\/code> command<\/a>, Prints the value of a given expression<br \/>\n<a href=\"https:\/\/sourceware.org\/gdb\/onlinedocs\/gdb\/Memory.html\">10.6 Examining Memory<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/21058681\/difference-between-x-and-p-in-gdb\">Difference between x and p in gdb?<\/a><br \/>\n<a href=\"https:\/\/sourceware.org\/gdb\/onlinedocs\/gdb\/Variables.html\">Program Variables<\/a><br \/>\n<a href=\"https:\/\/sourceware.org\/gdb\/onlinedocs\/gdb\/Symbols.html\">Examining the Symbol Table<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Symbol_table\">Wikipedia: Symbol Table<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/.bss\">Wikipedia: .bss<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Datensegment\">Wikipedia: Datensegment<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nx &lt;address&gt;       shows the contents of a memory address\r\n\r\np &lt;symbol&gt;        shows the value stored in a named variable\r\nprint &lt;symbol&gt;\r\n\r\ninfo registers    shows registers and what they're doing\r\ninfo frame\r\n\r\n### For example:\r\nint x;\r\nint&amp; f(int&amp; variable) { return variable; }\r\nint  g(int wert)      { return wert; }\r\n\r\n(gdb) p x\r\n$3 = 3\r\n\r\n(gdb) x x\r\n0x3:    Cannot access memory at address 0x3\r\n\r\n(gdb) x &amp;x\r\n0x555555756134 &lt;x&gt;:     0x0000000000000003\r\n\r\n(gdb) p r\r\nNo symbol &quot;r&quot; in current context.\r\n\r\n(gdb) info address x\r\nSymbol &quot;x&quot; is static storage at address 0x555555756134.\r\n\r\n(gdb) info symbol 0x555555756134 \r\nx in section .bss of \/home\/andreas\/src\/cpp-test\/obj\/lvalue\/lvalue\r\n              --&gt; Symbol Table\r\n\r\n(gdb) whatis x\r\ntype = int\r\n\r\n Address               Data\r\n _____________________ ______________________\r\n|          x          |                      |\r\n|    0x555555756134   |               0x3    |\r\n|_____________________|______________________|\r\n|                     |                      |\r\n|        0x3          | Cannot access memory |\r\n|_____________________|______________________|\r\n\r\n(gdb) whatis f\r\ntype = int &amp;(int &amp;)\r\n\r\n(gdb) whatis g\r\ntype = int (int)\r\n<\/pre>\n<p>Stack<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/7848771\/how-can-one-see-content-of-stack-with-gdb\">how can one see content of stack with gdb<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\np $sp           shows the stack-pointer address\r\nx $sp           shows the stack-pointer content\r\n0x7fffffffdcd0: 0x0000007900000000\r\n\r\ninfo frame      show the stack frame info\r\nx\/4xg $sp       \r\n\r\n(gdb) p $sp\r\n$6 = (void *) 0x7fffffffdcd0\r\n\r\n(gdb) x $sp\r\n0x7fffffffdcd0: 0x0000007900000000\r\n\r\n Address \/ Register    Data\r\n _____________________ _____________________\r\n|                     |                     |\r\n|  Stack Pointer (SP) |    0x7fffffffdcd0   |\r\n|_____________________|_____________________|\r\n|                     |                     |\r\n|        ...          |        ...          |\r\n|_____________________|_____________________|\r\n|                     |                     |\r\n|    0x7fffffffdcd0   |    0x007900000000   |\r\n|_____________________|_____________________|\r\n\r\n<\/pre>\n<p>Attach Source<br \/>\n<a href=\"https:\/\/alex.dzyoba.com\/blog\/gdb-source-path\/\">How to point GDB to your sources<\/a><br \/>\n<a href=\"http:\/\/visualgdb.com\/gdbreference\/commands\/info_source\"><code>info source<\/code> command<\/a>, Dislays information about the current source file<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nReading symbols from hardware-register-extern...(no debugging symbols found)...done.\r\n==&gt; no debugging symbols!\r\n\r\n(gdb) info sources\r\nNo symbol table is loaded.  Use the &quot;file&quot; command.\r\n<\/pre>\n<pre class=\"brush: plain; title: HiFive1\/config\/Makefile.pre; notranslate\" title=\"HiFive1\/config\/Makefile.pre\">\r\nBefore:\r\nCFLAGS=  -O2 -std=c++14 \\\r\nAfter:\r\nCFLAGS=  -O0 -ggdb -std=c++14 \\\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n(gdb) show dir\r\nSource directories searched: $cdir:$cwd\r\n\r\n(gdb) dir ..\/namespace\r\nSource directories searched: \/home\/andreas\/src\/tsm-embreal\/HiFive1\/work\/..\/namespace:$cdir:$cwd\r\n\r\n(gdb) info source\r\nCurrent source file is &lt;unknown&gt;\r\nCompilation directory is \/home\/andreas\/src\/tsm-embreal\/HiFive1\/work\r\nSource language is c++.\r\nProducer is GNU C++14 8.2.0 -march=rv32imac -mabi=ilp32 -ggdb -O0 -std=c++14 -fomit-frame-pointer -fpermissive -fcheck-new -fsized-deallocation -fno-exceptions -fno-use-cxa-atexit -fno-builtin -falign-functions=32 -fno-rtti -fno-unwind-tables.\r\nCompiled with DWARF 2 debugging format.\r\nDoes not include preprocessor macro info.\r\n\r\n(gdb) list\r\n1\t&lt;unknown&gt;: No such file or directory.\r\n\r\n(gdb) file ..\/namespace\/hardware-register-extern.cc\r\n&quot;\/home\/andreas\/src\/tsm-embreal\/HiFive1\/work\/..\/namespace\/hardware-register-extern.cc&quot;: not in executable format: File format not recognized\r\n\r\n(gdb) source ..\/namespace\/hardware-register-extern.cc \r\n..\/namespace\/hardware-register-extern.cc:1: Error in sourced command file:\r\nUndefined command: &quot;&quot;.  Try &quot;help&quot;.\r\n\r\n(gdb) help source\r\nRead commands from a file named FILE.\r\n<\/pre>\n<h3>Eclipse<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/51803829\/eclipse-tm-terminal-esp32-serial-terminal\/51804012\">Eclipse TM Terminal: ESP32 serial terminal<\/a><br \/>\n<a href=\"https:\/\/bugs.eclipse.org\/bugs\/show_bug.cgi?id=168893\">Terminal view not processing \\n, \\r correctly for serial connection<\/a><\/p>\n<h3>OpenOCD<\/h3>\n<p><a href=\"https:\/\/github.com\/RIOT-OS\/RIOT\/wiki\/OpenOCD#udev-rules\">OpenOCD &#8211; udev rules<\/a><br \/>\n<a href=\"https:\/\/gnu-mcu-eclipse.github.io\/openocd\/install\/\">GNU MCU Eclipse: How to install the OpenOCD binaries?<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nError: libusb_open() failed with LIBUSB_ERROR_ACCESS\r\nError: no device found\r\nError: unable to open ftdi device with vid 0403, pid 6010, description 'Dual RS232-HS', serial '*' at bus location '*'\r\n\r\n$ groups $USER\r\nandreas : andreas adm cdrom sudo dip lpadmin sambashare\r\n\r\n$ sudo usermod -aG plugdev $USER\r\n$ sudo usermod -aG dialout $USER\r\n\r\n$ groups $USER\r\nandreas : andreas adm dialout cdrom sudo dip plugdev lpadmin sambashare\r\n                      *******                *******\r\n$ sudo xed \/etc\/udev\/rules.d\/98-openocd.rules\r\nSUBSYSTEM==&quot;usb&quot;, ATTRS{idVendor}==&quot;0403&quot;, ATTRS{idProduct}==&quot;6010&quot;, MODE=&quot;664&quot;, GROUP=&quot;plugdev&quot;\r\nSUBSYSTEM==&quot;tty&quot;, ATTRS{idVendor}==&quot;0403&quot;, ATTRS{idProduct}==&quot;6010&quot;, MODE=&quot;664&quot;, GROUP=&quot;plugdev&quot;\r\n\r\n$ sudo udevadm control --reload-rules\r\n\r\n$ udevadm info -a -p $(udevadm info -q path -n \/dev\/ttyUSB1)\r\n\r\n  looking at device '\/devices\/pci0000:00\/0000:00:14.0\/usb1\/1-2\/1-2:1.1\/ttyUSB1\/tty\/ttyUSB1':\r\n    KERNEL==&quot;ttyUSB1&quot;\r\n    SUBSYSTEM==&quot;tty&quot;\r\n    DRIVER==&quot;&quot;\r\n\r\n  looking at parent device '\/devices\/pci0000:00\/0000:00:14.0\/usb1\/1-2\/1-2:1.1\/ttyUSB1':\r\n    KERNELS==&quot;ttyUSB1&quot;\r\n    SUBSYSTEMS==&quot;usb-serial&quot;\r\n    DRIVERS==&quot;ftdi_sio&quot;\r\n    &#x5B;...]\r\n\r\n  looking at parent device '\/devices\/pci0000:00\/0000:00:14.0\/usb1\/1-2\/1-2:1.1':\r\n    KERNELS==&quot;1-2:1.1&quot;\r\n    SUBSYSTEMS==&quot;usb&quot;\r\n    DRIVERS==&quot;ftdi_sio&quot;\r\n    &#x5B;...]\r\n    ATTRS{interface}==&quot;Dual RS232-HS&quot;\r\n    &#x5B;...]\r\n\r\n  looking at parent device '\/devices\/pci0000:00\/0000:00:14.0\/usb1\/1-2':\r\n    KERNELS==&quot;1-2&quot;\r\n    SUBSYSTEMS==&quot;usb&quot;\r\n    DRIVERS==&quot;usb&quot;\r\n    &#x5B;...]\r\n    ATTRS{idProduct}==&quot;6010&quot;\r\n    ATTRS{idVendor}==&quot;0403&quot;\r\n    &#x5B;...]\r\n<\/pre>\n<h3>RIOT<\/h3>\n<p><a href=\"http:\/\/www.riot-os.org\/\">RIOT &#8211; The friendly Operating System for the Internet of Things<\/a><br \/>\n<a href=\"http:\/\/doc.riot-os.org\/group__boards__hifive.html\">SiFive HiFive1 RISC-V board<\/a><br \/>\n<a href=\"https:\/\/github.com\/RIOT-OS\/RIOT\/wiki\/Board%3A-HiFive1\">RIOT Wiki: Board%3A-HiFive1<\/a> (deprecated)<br \/>\n<a href=\"https:\/\/github.com\/RIOT-OS\/RIOT\/wiki\/Creating-your-first-RIOT-project\">Creating your first RIOT project<\/a><br \/>\n<a href=\"https:\/\/github.com\/RIOT-OS\/RIOT\/wiki\/OpenOCD\">RIOT Wiki: OpenOCD<\/a><br \/>\n&#8220;Copy this file to your udev configuration directory make sure your vid and pid are covered and adjust the GROUP to some group you are part of.&#8221;<br \/>\n<a href=\"https:\/\/github.com\/RIOT-OS\/Tutorials\">RIOT Tutorials for RIOT<\/a><br \/>\n<a href=\"https:\/\/forums.sifive.com\/t\/riot-rtos-port-for-hifive1\/815\">RIOT RTOS Port for HiFive1<\/a><\/p>\n<pre class=\"brush: plain; collapse: true; light: false; title: dmesg; toolbar: true; notranslate\" title=\"dmesg\">\r\n&#x5B;  771.168432] usb 1-2: new high-speed USB device number 8 using xhci_hcd\r\n&#x5B;  771.316930] usb 1-2: New USB device found, idVendor=0403, idProduct=6010\r\n&#x5B;  771.316935] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0\r\n&#x5B;  771.316940] usb 1-2: Product: Dual RS232-HS\r\n&#x5B;  771.316944] usb 1-2: Manufacturer: FTDI\r\n&#x5B;  771.339667] usbcore: registered new interface driver usbserial_generic\r\n&#x5B;  771.339683] usbserial: USB Serial support registered for generic\r\n&#x5B;  771.342827] usbcore: registered new interface driver ftdi_sio\r\n&#x5B;  771.342844] usbserial: USB Serial support registered for FTDI USB Serial Device\r\n&#x5B;  771.342934] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected\r\n&#x5B;  771.342974] usb 1-2: Detected FT2232H\r\n&#x5B;  771.343481] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0\r\n&#x5B;  771.343628] ftdi_sio 1-2:1.1: FTDI USB Serial Device converter detected\r\n&#x5B;  771.343660] usb 1-2: Detected FT2232H\r\n&#x5B;  771.343801] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB1\r\n<\/pre>\n<pre class=\"brush: plain; collapse: true; light: false; title: libmpfr6; toolbar: true; notranslate\" title=\"libmpfr6\">\r\n$ sudo apt-get install libmpfr6\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nlibmpfr6 is already the newest version (4.0.1-1).\r\nThe following packages were automatically installed and are no longer required:\r\n  linux-headers-4.15.0-32 linux-headers-4.15.0-32-generic linux-image-4.15.0-32-generic linux-modules-4.15.0-32-generic linux-modules-extra-4.15.0-32-generic\r\nUse 'sudo apt autoremove' to remove them.\r\n0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.\r\n\r\n$ dpkg-query -L libmpfr6\r\n\/.\r\n\/usr\r\n\/usr\/lib\r\n\/usr\/lib\/x86_64-linux-gnu\r\n\/usr\/lib\/x86_64-linux-gnu\/libmpfr.so.6.0.1\r\n\/usr\/share\r\n\/usr\/share\/doc\r\n\/usr\/share\/doc\/libmpfr6\r\n\/usr\/share\/doc\/libmpfr6\/AUTHORS\r\n\/usr\/share\/doc\/libmpfr6\/BUGS\r\n\/usr\/share\/doc\/libmpfr6\/NEWS.gz\r\n\/usr\/share\/doc\/libmpfr6\/README\r\n\/usr\/share\/doc\/libmpfr6\/TODO.gz\r\n\/usr\/share\/doc\/libmpfr6\/changelog.Debian.gz\r\n\/usr\/share\/doc\/libmpfr6\/copyright\r\n\/usr\/lib\/x86_64-linux-gnu\/libmpfr.so.6\r\n\r\n$ locate libmpfr\r\n\/usr\/lib\/x86_64-linux-gnu\/libmpfr.so.6\r\n\/usr\/lib\/x86_64-linux-gnu\/libmpfr.so.6.0.1\r\n\/usr\/share\/doc\/libmpfr6\r\n\/usr\/share\/doc\/libmpfr6\/AUTHORS\r\n\/usr\/share\/doc\/libmpfr6\/BUGS\r\n\/usr\/share\/doc\/libmpfr6\/NEWS.gz\r\n\/usr\/share\/doc\/libmpfr6\/README\r\n\/usr\/share\/doc\/libmpfr6\/TODO.gz\r\n\/usr\/share\/doc\/libmpfr6\/changelog.Debian.gz\r\n\/usr\/share\/doc\/libmpfr6\/copyright\r\n\/var\/lib\/dpkg\/info\/libmpfr6:amd64.list\r\n\/var\/lib\/dpkg\/info\/libmpfr6:amd64.md5sums\r\n\/var\/lib\/dpkg\/info\/libmpfr6:amd64.shlibs\r\n\/var\/lib\/dpkg\/info\/libmpfr6:amd64.symbols\r\n\/var\/lib\/dpkg\/info\/libmpfr6:amd64.triggers\r\n<\/pre>\n<pre class=\"brush: plain; collapse: true; light: false; title: flash.sh; toolbar: true; notranslate\" title=\"flash.sh\">\r\n$ ..\/tools\/flash.sh startup-1\r\nmake: 'startup-1' is up to date.\r\nOpen On-Chip Debugger 0.10.0+dev-00062-g5d9f4864-dirty (2018-08-15-11:40)\r\nLicensed under GNU GPL v2\r\nFor bug reports, read\r\n\thttp:\/\/openocd.org\/doc\/doxygen\/bugs.html\r\nadapter speed: 10000 kHz\r\nInfo : auto-selecting first available session transport &quot;jtag&quot;. To override use 'transport select &lt;transport&gt;'.\r\nError: libusb_open() failed with LIBUSB_ERROR_ACCESS\r\nError: no device found\r\nError: unable to open ftdi device with vid 0403, pid 6010, description 'Dual RS232-HS', serial '*' at bus location '*'\r\n\r\nWarn : Flash driver of onboard_spi_flash does not support free_driver_priv()\r\n\r\n$ cat \/etc\/udev\/rules.d\/98-openocd.rules \r\nACTION!=&quot;add|change&quot;, GOTO=&quot;openocd_rules_end&quot;\r\nSUBSYSTEM!=&quot;usb|tty|hidraw&quot;, GOTO=&quot;openocd_rules_end&quot;\r\n\r\n#Please keep this list sorted by VID:PID\r\n\r\n#CMSIS-DAP compatible adapters\r\nATTRS{product}==&quot;*CMSIS-DAP*&quot;, MODE=&quot;666&quot;, GROUP=&quot;root&quot;\r\n\r\nLABEL=&quot;openocd_rules_end&quot;\r\n\r\n\r\n$ sudo ..\/tools\/flash.sh startup-1\r\n&#x5B;sudo] password for andreas: \r\n..\/tools\/flash.sh: 6: ..\/tools\/flash.sh: &#x5B;&#x5B;: not found\r\nmake: 'startup-1' is up to date.\r\nOpen On-Chip Debugger 0.10.0+dev-00062-g5d9f4864-dirty (2018-08-15-11:40)\r\nLicensed under GNU GPL v2\r\nFor bug reports, read\r\n\thttp:\/\/openocd.org\/doc\/doxygen\/bugs.html\r\nadapter speed: 10000 kHz\r\nInfo : auto-selecting first available session transport &quot;jtag&quot;. To override use 'transport select &lt;transport&gt;'.\r\nInfo : ftdi: if you experience problems at higher adapter clocks, try the command &quot;ftdi_tdo_sample_edge falling&quot;\r\nInfo : clock speed 10000 kHz\r\nInfo : JTAG tap: riscv.cpu tap\/device found: 0x10e31913 (mfg: 0x489 (SiFive, Inc.), part: 0x0e31, ver: 0x1)\r\nInfo : Examined RISCV core; XLEN=32, misa=0x40001105\r\nInfo : Listening on port 3333 for gdb connections\r\nInfo : &#x5B;0] Found 2 triggers\r\nhalted at 0x204003b4 due to debug interrupt\r\nInfo : Found flash device 'issi is25lp128' (ID 0x0018609d)\r\ncleared protection for sectors 64 through 255 on flash bank 0\r\nInfo : JTAG tap: riscv.cpu tap\/device found: 0x10e31913 (mfg: 0x489 (SiFive, Inc.), part: 0x0e31, ver: 0x1)\r\nhalted at 0x204003b4 due to debug interrupt\r\n** Programming Started **\r\nauto erase enabled\r\nInfo : Retrying memory read starting from 0x80000000 with more delays\r\nInfo : Retrying memory read starting from 0x80000000 with more delays\r\nhalted at 0x80000004 due to software breakpoint\r\nhalted at 0x80000004 due to software breakpoint\r\nhalted at 0x80000004 due to software breakpoint\r\nhalted at 0x80000004 due to software breakpoint\r\nhalted at 0x80000004 due to software breakpoint\r\nhalted at 0x80000004 due to software breakpoint\r\nhalted at 0x80000004 due to software breakpoint\r\nhalted at 0x80000004 due to software breakpoint\r\nhalted at 0x80000004 due to software breakpoint\r\nhalted at 0x80000004 due to software breakpoint\r\nwrote 65536 bytes from file startup-1.bin in 0.875611s (73.092 KiB\/s)\r\n** Programming Finished **\r\n** Verify Started **\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nInfo : Retrying memory read starting from 0x20400000 with more delays\r\nverified 13256 bytes in 0.372329s (34.768 KiB\/s)\r\n** Verified OK **\r\nhalted at 0x20400004 due to step\r\nWarn : Flash driver of onboard_spi_flash does not support free_driver_priv()\r\n\r\n<\/pre>\n<pre class=\"brush: plain; collapse: true; light: false; title: startup-1; toolbar: true; notranslate\" title=\"startup-1\">\r\nhello\r\n\r\n---------------------------------------- ctor\r\n0x20402d00\t1\tsys\/sys.o\r\n0x20400320\t0\tsys\/msg-1.o\r\n0x20402e40\t2\tstartup-1.o\r\n\r\ntest::Startup::Startup()\r\nGNU:c2b75a723e41aa655b4fbbceabe9df508d33e39d\r\npress key 's' ...\r\n\r\ngood bye\r\n---------------------------------------- dtor\r\n0x20402e60\t0\tstartup-1.o\r\ntest::Startup::~Startup()\r\n<\/pre>\n<pre class=\"brush: plain; collapse: true; light: false; title: app-anatomy-1; toolbar: true; notranslate\" title=\"app-anatomy-1\">\r\n$ make app-anatomy-1\r\n..\/tc\/bin\/riscv32-fhnw-elf-g++ -O2 -std=c++14 -march=rv32imac -mabi=ilp32 -fomit-frame-pointer -fpermissive -fcheck-new -fsized-deallocation -fno-exceptions -fno-use-cxa-atexit -fno-builtin -falign-functions=32 -Wreturn-type -fno-rtti -Wall -fno-unwind-tables  -include &quot;sys\/sys.h&quot; -I \/home\/andreas\/src\/tsm-embreal\/HiFive1\/namespace -I \/home\/andreas\/src\/tsm-embreal\/src -DEARLY_INIT -DNO_FLOATS -DNO_LONG_DIV -DSYS_SYS_SHOW_STARTUP -D'INTERFACE(name,info)=' -D'IMPLEMENTATION(name,info)=' -D'VERSION=&quot;heads\/master-0-g361662c &quot;'    \/home\/andreas\/src\/tsm-embreal\/HiFive1\/namespace\/app-anatomy-1.cc   -o app-anatomy-1\r\n\/home\/andreas\/src\/tsm-embreal\/resources\/gcc-riscv-8.2.0\/bin\/..\/lib\/gcc\/riscv32-fhnw-elf\/8.2.0\/..\/..\/..\/..\/riscv32-fhnw-elf\/bin\/ld: cannot find crt0.o: No such file or directory\r\n\/home\/andreas\/src\/tsm-embreal\/resources\/gcc-riscv-8.2.0\/bin\/..\/lib\/gcc\/riscv32-fhnw-elf\/8.2.0\/..\/..\/..\/..\/riscv32-fhnw-elf\/bin\/ld: cannot find -lstdc++\r\n\/home\/andreas\/src\/tsm-embreal\/resources\/gcc-riscv-8.2.0\/bin\/..\/lib\/gcc\/riscv32-fhnw-elf\/8.2.0\/..\/..\/..\/..\/riscv32-fhnw-elf\/bin\/ld: cannot find -lm\r\n\/home\/andreas\/src\/tsm-embreal\/resources\/gcc-riscv-8.2.0\/bin\/..\/lib\/gcc\/riscv32-fhnw-elf\/8.2.0\/..\/..\/..\/..\/riscv32-fhnw-elf\/bin\/ld: cannot find -lc\r\n\/home\/andreas\/src\/tsm-embreal\/resources\/gcc-riscv-8.2.0\/bin\/..\/lib\/gcc\/riscv32-fhnw-elf\/8.2.0\/..\/..\/..\/..\/riscv32-fhnw-elf\/bin\/ld: cannot find -lgloss\r\ncollect2: error: ld returned 1 exit status\r\n&lt;builtin&gt;: recipe for target 'app-anatomy-1' failed\r\nmake: *** &#x5B;app-anatomy-1] Error 1\r\n\r\n\r\n$ make clean\r\nrm -f sys\/deb\/deblow.o sys\/boot\/big-bang-continued.o sys\/msg-1.o sys\/board.o sys\/abi\/abi.o startup-1.o sys\/boot\/big-bang.o sys\/reg\/aon.o io\/ascii\/out.o sys\/msg.o math\/double.o sys\/reg\/uart.o sys\/reg\/gpio.o io\/ascii\/write.o sys\/sys.o sys\/deb\/deblow0.o util\/float-conv.o sys\/deb\/deb.o sys\/hwreg.o startup-1 \\\r\n        startup-1.map \\\r\n        startup-1.bin \\\r\n        tor.o\r\n\r\n$ make makefile\r\n\/home\/andreas\/src\/tsm-embreal\/tools\/makefile.sh ..\/config\/projects.xml &gt; Makefile\r\n\r\n$ make app-anatomy-1\r\n&#x5B;...]\r\n<\/pre>\n<pre class=\"brush: plain; collapse: true; light: false; title: posix\/cpu-demo; toolbar: true; notranslate\" title=\"posix\/cpu-demo\">\r\nk$ make cpu-demo\r\ng++ -O2 -std=c++14 -c -ocpu-demo.o \/home\/andreas\/src\/tsm-embreal\/posix\/src\/cpu-demo.S\r\ng++   cpu-demo.o  -lm -lpthread -lasound -o cpu-demo\r\n\/usr\/bin\/x86_64-linux-gnu-ld: cannot find -lasound\r\ncollect2: error: ld returned 1 exit status\r\n&lt;builtin&gt;: recipe for target 'cpu-demo' failed\r\nmake: *** &#x5B;cpu-demo] Error 1\r\n\r\n$ git pull\r\n$ make makefile\r\n..\/..\/tools\/makefile.sh ..\/config\/projects.xml &gt; Makefile\r\n\r\n$ make cpu-demo\r\ng++   cpu-demo.o  -lm -lpthread  -o cpu-demo\r\n\/usr\/lib\/gcc\/x86_64-linux-gnu\/7\/..\/..\/..\/x86_64-linux-gnu\/Scrt1.o: In function `_start':\r\n(.text+0x20): undefined reference to `main'\r\ncollect2: error: ld returned 1 exit status\r\n&lt;builtin&gt;: recipe for target 'cpu-demo' failed\r\nmake: *** &#x5B;cpu-demo] Error 1\r\n\r\n$ make cpu-demo-app\r\ng++ -O2 -std=c++14 -I \/home\/andreas\/src\/tsm-embreal\/posix\/src -I \/home\/andreas\/src\/tsm-embreal\/src  -c -o cpu-demo-app.o \/home\/andreas\/src\/tsm-embreal\/posix\/src\/cpu-demo-app.cc\r\ng++ -O2 -std=c++14 -c -ocpu-demo.o \/home\/andreas\/src\/tsm-embreal\/posix\/src\/cpu-demo.S\r\ng++  cpu-demo-app.o cpu-demo.o  -lm -lpthread  -ocpu-demo-app\r\n<\/pre>\n<pre class=\"brush: plain; collapse: true; light: false; title: make event-demo-1; toolbar: true; notranslate\" title=\"make event-demo-1\">\r\n$ make event-demo-1\r\n..\/tc\/bin\/riscv32-fhnw-elf-g++\r\n-O2\r\n-std=c++14\r\n-march=rv32imac\r\n-mabi=ilp32\r\n-fomit-frame-pointer\r\n-fpermissive\r\n-fcheck-new\r\n-fsized-deallocation\r\n-fno-exceptions\r\n-fno-use-cxa-atexit\r\n-fno-builtin\r\n-falign-functions=32\r\n-Wreturn-type\r\n-fno-rtti\r\n-Wall\r\n-fno-unwind-tables\r\n-include &quot;sys\/sys.h&quot;\r\n-I tsm-embreal\/HiFive1\/namespace\r\n-I tsm-embreal\/src\r\n-DEARLY_INIT\r\n-DNO_FLOATS\r\n-DNO_LONG_DIV\r\n-DSYS_SYS_SHOW_STARTUP\r\n-D'INTERFACE(name,info)='\r\n-D'IMPLEMENTATION(name,info)='\r\n-D'VERSION=&quot;heads\/master-0-g0f5b43b-dirty &quot;'\r\n-c\r\n-o sys\/deb\/deblow.o\r\ntsm-embreal\/HiFive1\/namespace\/sys\/deb\/deblow.cc\r\n\r\ntsm-embreal\/HiFive1\/namespace\/sys\/deb\/deblow0.S\r\ntsm-embreal\/HiFive1\/namespace\/sys\/boot\/big-bang.S\r\ntsm-embreal\/HiFive1\/namespace\/sys\/msg-1.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/msg.cc\r\ntsm-embreal\/HiFive1\/namespace\/io\/ascii\/out.cc\r\ntsm-embreal\/HiFive1\/namespace\/io\/ascii\/write.cc\r\ntsm-embreal\/HiFive1\/namespace\/util\/float-conv.cc\r\ntsm-embreal\/HiFive1\/namespace\/math\/double.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/deb\/deb.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/abi\/abi.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/board.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/reg\/gpio.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/boot\/big-bang-continued.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/reg\/uart.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/reg\/aon.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/hwreg.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/sys.cc\r\ntsm-embreal\/HiFive1\/namespace\/event-demo-1.cc\r\ntsm-embreal\/HiFive1\/namespace\/sys\/event.cc\r\n\r\n..\/tc\/bin\/riscv32-fhnw-elf-objdump\r\n-wt \r\nsys\/deb\/deblow.o\r\nsys\/deb\/deblow0.o\r\nsys\/boot\/big-bang.o\r\nsys\/msg-1.o\r\nsys\/msg.o\r\nio\/ascii\/out.o\r\nio\/ascii\/write.o\r\nutil\/float-conv.o\r\nmath\/double.o\r\nsys\/deb\/deb.o\r\nsys\/abi\/abi.o\r\nsys\/board.o\r\nsys\/reg\/gpio.o\r\nsys\/boot\/big-bang-continued.o\r\nsys\/reg\/uart.o\r\nsys\/reg\/aon.o\r\nsys\/hwreg.o\r\nsys\/sys.o\r\nevent-demo-1.o\r\nsys\/event.o\r\n|\r\ntsm-embreal\/tools\/mod-dep.py -c tor -\r\n|\r\n..\/tc\/bin\/riscv32-fhnw-elf-g++\r\n-include &quot;sys\/sys.h&quot;\r\n-I tsm-embreal\/HiFive1\/namespace\r\n-I tsm-embreal\/src\r\n-DEARLY_INIT\r\n-DNO_FLOATS\r\n-DNO_LONG_DIV\r\n-DSYS_SYS_SHOW_STARTUP\r\n-D'INTERFACE(name,info)='\r\n-D'IMPLEMENTATION(name,info)='\r\n-D'VERSION=&quot;heads\/master-0-g0f5b43b-dirty &quot;' \r\n-O2\r\n-std=c++14\r\n-march=rv32imac\r\n-mabi=ilp32\r\n-fomit-frame-pointer\r\n-fpermissive\r\n-fcheck-new\r\n-fsized-deallocation\r\n-fno-exceptions\r\n-fno-use-cxa-atexit\r\n-fno-builtin\r\n-falign-functions=32\r\n-Wreturn-type\r\n-fno-rtti\r\n-Wall\r\n-fno-unwind-tables \r\n-c\r\n-x c++\r\n-o tor.o -\r\n\r\n&amp;&amp;\r\n..\/tc\/bin\/riscv32-fhnw-elf-ld\r\n--relax\r\n-o event-demo-1\r\ntor.o\r\nsys\/deb\/deblow.o\r\nsys\/deb\/deblow0.o\r\nsys\/boot\/big-bang.o\r\nsys\/msg-1.o\r\nsys\/msg.o \r\nio\/ascii\/out.o\r\nio\/ascii\/write.o\r\nutil\/float-conv.o\r\nmath\/double.o\r\nsys\/deb\/deb.o\r\nsys\/abi\/abi.o\r\nsys\/board.o\r\nsys\/reg\/gpio.o\r\nsys\/boot\/big-bang-continued.o\r\nsys\/reg\/uart.o\r\nsys\/reg\/aon.o\r\nsys\/hwreg.o\r\nsys\/sys.o\r\nevent-demo-1.o\r\nsys\/event.o\r\n-Map=event-demo-1.map\r\n--build-id\r\n-Ltsm-embreal\/resources\/gcc-riscv-8.2.0\/bin\/..\/lib\/gcc\/riscv32-fhnw-elf\/8.2.0\/\r\n-lgcc\r\n--script=..\/config\/layout.ld\r\n&amp;&amp;\r\n..\/tc\/bin\/riscv32-fhnw-elf-objcopy\r\n--output-target=binary\r\nevent-demo-1 \r\nevent-demo-1.bin\r\n<\/pre>\n<pre class=\"brush: plain; collapse: true; light: false; title: readelf event-demo-1; toolbar: true; notranslate\" title=\"readelf event-demo-1\">\r\n$ ..\/tc\/bin\/riscv32-fhnw-elf-readelf -h event-demo-1\r\nELF Header:\r\n  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 \r\n  Class:                             ELF32\r\n  Data:                              2's complement, little endian\r\n  Version:                           1 (current)\r\n  OS\/ABI:                            UNIX - System V\r\n  ABI Version:                       0\r\n  Type:                              EXEC (Executable file)\r\n  Machine:                           RISC-V\r\n  Version:                           0x1\r\n  Entry point address:               0x20400000\r\n  Start of program headers:          52 (bytes into file)\r\n  Start of section headers:          30672 (bytes into file)\r\n  Flags:                             0x1, RVC, soft-float ABI\r\n  Size of this header:               52 (bytes)\r\n  Size of program headers:           32 (bytes)\r\n  Number of program headers:         2\r\n  Size of section headers:           40 (bytes)\r\n  Number of section headers:         9\r\n  Section header string table index: 8\r\n  \r\n$ ..\/tc\/bin\/riscv32-fhnw-elf-readelf -S event-demo-1\r\nThere are 9 section headers, starting at offset 0x77d0:\r\n\r\nSection Headers:\r\n  &#x5B;Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al\r\n  &#x5B; 0]                   NULL            00000000 000000 000000 00      0   0  0\r\n  &#x5B; 1] .text             PROGBITS        20400000 001000 00363c 00  AX  0   0 32\r\n  &#x5B; 2] .data             PROGBITS        80000000 005000 000000 00  WA  0   0  1\r\n  &#x5B; 3] .sdata            PROGBITS        80000000 005000 000004 00  WA  0   0  4\r\n  &#x5B; 4] .bss              NOBITS          80000004 005004 0000a8 00  WA  0   0  4\r\n  &#x5B; 5] .comment          PROGBITS        00000000 005004 000011 01  MS  0   0  1\r\n  &#x5B; 6] .symtab           SYMTAB          00000000 005018 000ff0 10      7  48  4\r\n  &#x5B; 7] .strtab           STRTAB          00000000 006008 00178c 00      0   0  1\r\n  &#x5B; 8] .shstrtab         STRTAB          00000000 007794 00003c 00      0   0  1\r\nKey to Flags:\r\n  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),\r\n  L (link order), O (extra OS processing required), G (group), T (TLS),\r\n  C (compressed), x (unknown), o (OS specific), E (exclude),\r\n  p (processor specific)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>HiFive1 | Crowd Supply Wikipedia SiFive HiFive1 | SiFive Documentation | SiFive RISC-V Tools | SiFive SEGGER Adds Support for SiFive&#8217;s Coreplex IP to Its Industry Leading J-Link Debug Probe Open Source RISC \u2013 Eclipse with RISC-V on the SiFive HiFive1 Board PlatformIO RISC-V RISC-V Foundation | Instruction Set Architecture (ISA) Tutorials FE310G: an open [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8330","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/8330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8330"}],"version-history":[{"count":72,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/8330\/revisions"}],"predecessor-version":[{"id":9139,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/8330\/revisions\/9139"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}