overview.rst 7.3 KB

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