overview.rst 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. .. _design_overview:
  2. Overview
  3. ========
  4. Nuclei SDK is developed based on **NMSIS**, all the SoCs supported in it
  5. are following the `NMSIS-Core Device Templates Guidance`_.
  6. So this Nuclei SDK can be treated as a software guide for how to use NMSIS.
  7. The build system we use in Nuclei SDK is ``Makefile``, it support both Windows
  8. and Linux, and when we develop Nuclei SDK build system, we keep it simple, so
  9. it make developer can easily port this Nuclei SDK software code to other IDEs.
  10. Click :ref:`overview` to learn more about the Nuclei SDK project overview.
  11. For example, we have ported Nuclei SDK to use Segger embedded Studio, IAR Workbench and PlatformIO.
  12. Directory Structure
  13. -------------------
  14. To learn deeper about Nuclei SDK project, the directory structure is a good start point.
  15. Below, we will describe our design about the Nuclei SDK directory structure:
  16. Here is the directory structure for this Nuclei SDK.
  17. .. code-block::
  18. $NUCLEI_SDK_ROOT
  19. ├── application
  20. │   ├── baremetal
  21. │   ├── freertos
  22. │   ├── ucosii
  23. │   └── rtthread
  24. ├── Build
  25. │   ├── gmsl
  26. │   ├── toolchain
  27. │   ├── Makefile.base
  28. │   ├── Makefile.conf
  29. │   ├── Makefile.core
  30. │   ├── Makefile.components
  31. │   ├── Makefile.files
  32. │   ├── Makefile.global
  33. │   ├── Makefile.misc
  34. │   ├── Makefile.rtos
  35. │   ├── Makefile.rules
  36. │   └── Makefile.soc
  37. ├── doc
  38. │   ├── build
  39. │   ├── source
  40. │   ├── Makefile
  41. │   └── requirements.txt
  42. ├── NMSIS
  43. │   ├── Core
  44. │   ├── DSP
  45. │   ├── NN
  46. │   └── Library
  47. ├── OS
  48. │   ├── FreeRTOS
  49. │   ├── UCOSII
  50. │   └── RTThread
  51. ├── SoC
  52. │   ├── gd32vf103
  53. │   └── evalsoc
  54. ├── test
  55. │   ├── core
  56. │   ├── ctest.h
  57. │   ├── LICENSE
  58. │   └── README.md
  59. ├── LICENSE
  60. ├── Makefile
  61. ├── NMSIS_VERSION
  62. ├── package.json
  63. ├── SConscript
  64. ├── README.md
  65. ├── setup.bat
  66. └── setup.sh
  67. * **application**
  68. This directory contains all the application softwares for this Nuclei SDK.
  69. The application code can be divided into mainly 4 parts, which are:
  70. - **Baremetal** applications, which will provide baremetal applications without any OS usage, these applications will be placed in *application/baremetal/* folder.
  71. - **FreeRTOS** applications, which will provide FreeRTOS applications using FreeRTOS RTOS, placed in *application/freertos/* folder.
  72. - **UCOSII** applications, which will provide UCOSII applications using UCOSII RTOS, placed in *application/ucosii/* folder.
  73. - **RTThread** applications, which will provide RT-Thread applications using RT-Thread RTOS, placed in *application/rtthread/* folder.
  74. * **SoC**
  75. This directory contains all the supported SoCs for this Nuclei SDK, the directory name for SoC and its boards should always in lower case.
  76. Here we mainly support Nuclei processor cores running in Nuclei FPGA evaluation board, the support package placed in *SoC/evalsoc/*.
  77. In each SoC's include directory, *nuclei_sdk_soc.h* must be provided, and include the soc header file, for example, *SoC/evalsoc/Common/Include/nuclei_sdk_soc.h*.
  78. In each SoC Board's include directory, *nuclei_sdk_hal.h* must be provided, and include the board header file, for example, *SoC/evalsoc/Board/nuclei_fpga_eval/Include/nuclei_sdk_hal.h*.
  79. * **Build**
  80. This directory contains the key part of the build system based on Makefile for Nuclei SDK.
  81. * **NMSIS**
  82. This directory contains the NMSIS header files, which is widely used in this Nuclei SDK,
  83. you can check the *NMSIS_VERSION* file to know the current *NMSIS* version used in **Nuclei-SDK**.
  84. We will also sync the changes in `NMSIS project`_ when it provided a new release.
  85. * **OS**
  86. This directory provided three RTOS package we suppported which are **FreeRTOS**, **UCOSII** and **RT-Thread**.
  87. * **LICENSE**
  88. Nuclei SDK license file.
  89. * **NMSIS_VERSION**
  90. NMSIS Version file. It will show current NMSIS version used in Nuclei SDK.
  91. * **package.json**
  92. PlatformIO package json file for Nuclei SDK, used in `Nuclei Platform for PlatformIO`_.
  93. * **SConscript**
  94. RT-Thread package scons build script, used in `RT-Thread package development`_.
  95. * **Makefile**
  96. An external Makefile just for build, run, debug application without cd to any corresponding application directory, such as *application/baremetal/helloworld/*.
  97. * **setup.sh**
  98. Nuclei SDK environment setup script for **Linux**. You need to create your own `setup_config.sh`.
  99. .. code-block:: shell
  100. # you can export this variable to Nuclei Studio's toolchain folder
  101. NUCLEI_TOOL_ROOT=/path/to/your_tool_root
  102. In the **$NUCLEI_TOOL_ROOT** for **Linux**, you need to have Nuclei RISC-V GNU GCC toolchain and OpenOCD installed as below.
  103. .. code-block:: console
  104. $NUCLEI_TOOL_ROOT
  105. ├── gcc
  106. │   ├── bin
  107. │   ├── include
  108. │   ├── lib
  109. │   ├── libexec
  110. │   ├── riscv64-unknown-elf
  111. │   └── share
  112. └── openocd
  113.    ├── bin
  114.    ├── contrib
  115.    ├── distro-info
  116.    ├── OpenULINK
  117.    ├── scripts
  118.    └── share
  119. * **setup.bat**
  120. Nuclei SDK environment setup bat script for **Windows**. You need to create your own `setup_config.bat`.
  121. .. code-block:: bat
  122. set NUCLEI_TOOL_ROOT=\path\to\your_tool_root
  123. In the **%NUCLEI_TOOL_ROOT%** for **Windows**, you need to have Nuclei RISC-V GNU GCC toolchain, necessary Windows build tools and OpenOCD installed as below.
  124. .. code-block:: console
  125. %NUCLEI_TOOL_ROOT%
  126. ├── build-tools
  127. │   ├── bin
  128. │   ├── gnu-mcu-eclipse
  129. │   └── licenses
  130. ├── gcc
  131. │   ├── bin
  132. │   ├── include
  133. │   ├── lib
  134. │   ├── libexec
  135. │   ├── riscv64-unknown-elf
  136. │   └── share
  137. └── openocd
  138.    ├── bin
  139.    ├── contrib
  140.    ├── distro-info
  141.    ├── OpenULINK
  142.    ├── scripts
  143.    └── share
  144. Project Components
  145. ------------------
  146. This Nuclei SDK project components is list as below:
  147. * :ref:`design_nuclei`: How Nuclei Processor Core is used in Nuclei SDK
  148. * :ref:`design_soc`: How Nuclei processor code based SoC device is supported in Nuclei SDK
  149. * :ref:`design_board`: How Nuclei based SoC's Board is supported in Nuclei SDK
  150. * :ref:`design_peripheral`: How to use the peripheral driver in Nuclei SDK
  151. * :ref:`design_rtos`: What RTOSes are supported in Nuclei SDK
  152. * :ref:`design_app`: How to use pre-built applications in Nuclei SDK
  153. .. _NMSIS-Core Device Templates Guidance: https://doc.nucleisys.com/nmsis/core/core_templates.html
  154. .. _Nuclei Platform for PlatformIO: https://platformio.org/platforms/nuclei/
  155. .. _NMSIS project: https://github.com/Nuclei-Software/NMSIS
  156. .. _RT-Thread package development: https://www.rt-thread.org/document/site/development-guide/package/package/