All Projects β†’ Nuclei-Software β†’ nuclei-sdk

Nuclei-Software / nuclei-sdk

Licence: Apache-2.0 license
Nuclei RISC-V Software Development Kit

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
assembly
5116 projects
C++
36643 projects - #6 most used programming language
HTML
75241 projects
Makefile
30231 projects

Projects that are alternatives of or similar to nuclei-sdk

NMSIS
Nuclei Microcontroller Software Interface Standard Development Repo
Stars: ✭ 24 (-63.08%)
Mutual labels:  iot-platform, riscv, nuclei, risc-v
Platformio Core
PlatformIO is a professional collaborative platform for embedded development πŸ‘½ A place where Developers and Teams have true Freedom! No more vendor lock-in!
Stars: ✭ 5,539 (+8421.54%)
Mutual labels:  platformio, freertos, risc-v
hero-sdk
β›” DEPRECATED β›” HERO Software Development Kit
Stars: ✭ 21 (-67.69%)
Mutual labels:  embedded-systems, riscv, risc-v
mdepx
MDEPX β€” A BSD-style RTOS
Stars: ✭ 17 (-73.85%)
Mutual labels:  riscv, rtos, risc-v
platform-shakti
Shakti: development platform for PlatformIO
Stars: ✭ 26 (-60%)
Mutual labels:  platformio, riscv, risc-v
Rt Thread
RT-Thread is an open source IoT operating system.
Stars: ✭ 6,466 (+9847.69%)
Mutual labels:  embedded-systems, rtos, risc-v
r3
R3-OS β€” Experimental static (ΞΌITRON-esque) RTOS for deeply embedded systems, testing the limit of Rust's const eval and generics
Stars: ✭ 87 (+33.85%)
Mutual labels:  embedded-systems, rtos, risc-v
riscv em
Simple risc-v emulator, able to run linux, written in C.
Stars: ✭ 51 (-21.54%)
Mutual labels:  embedded-systems, riscv, risc-v
Prettyos
A Preemptive Hard Real Time kernel for embedded devices.
Stars: ✭ 36 (-44.62%)
Mutual labels:  embedded-systems, rtos
Libmemory
Embedded systems memory management library. Implementations for malloc(), free(), and other useful memory management functions
Stars: ✭ 102 (+56.92%)
Mutual labels:  embedded-systems, rtos
Qpcpp
QP/C++ real-time embedded framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
Stars: ✭ 124 (+90.77%)
Mutual labels:  embedded-systems, rtos
platformio-libopencm3-freertos
Sample blinky project for PlatformIO using libopencm3 and FreeRTOS
Stars: ✭ 14 (-78.46%)
Mutual labels:  platformio, freertos
Lwesp
Lightweight Espressif AT parser library for ESP8266 and ESP32 devices.
Stars: ✭ 212 (+226.15%)
Mutual labels:  embedded-systems, rtos
Platform Kendryte210
Kendryte K210: development platform for PlatformIO
Stars: ✭ 60 (-7.69%)
Mutual labels:  platformio, risc-v
Renode
Renode - Antmicro's virtual development framework for complex embedded systems
Stars: ✭ 525 (+707.69%)
Mutual labels:  embedded-systems, risc-v
Qpn
QP-nano real-time embedded framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
Stars: ✭ 107 (+64.62%)
Mutual labels:  embedded-systems, rtos
MuditaOS
Mobile operating system based on FreeRTOSβ„’ optimized for E Ink displays - developed for Mudita Pure minimalist phone
Stars: ✭ 349 (+436.92%)
Mutual labels:  embedded-systems, freertos
CorePartition
Universal Cooperative Multithread Lib with real time Scheduler that was designed to work, virtually, into any modern micro controller or Microchip and, also, for user space applications for modern OS (Mac, Linux, Windows) or on FreeRTOS as well. Supports C and C++
Stars: ✭ 18 (-72.31%)
Mutual labels:  freertos, risc-v
FreeRTOS-RISCV
A port of FreeRTOS for the RISC-V ISA
Stars: ✭ 68 (+4.62%)
Mutual labels:  freertos, risc-v
riscv-meta
RISC-V Instruction Set Metadata
Stars: ✭ 33 (-49.23%)
Mutual labels:  riscv, risc-v

Nuclei Software Development Kit

Build Documentation Build SDK

Nuclei Software Development Kit(Nuclei SDK) is developed for developing and evaluating software using our FPGA evaluation board.

Nuclei SDK Diagram

This Nuclei SDK is built based on the NMSIS framework, user can access all the APIs provided by NMSIS and also the APIs that provided by Nuclei SDK which mainly for on-board peripherals access such as GPIO, UART, SPI and I2C etc.

We also intergated three RTOSes into Nuclei SDK, which are FreeRTOS, UCOSII and RTThread, you can easily find it in the OS folder.

Quick Startup

Wanner to a try with Nuclei SDK, click Quick Start with Nuclei SDK to start up.

Requirements

Directory Structure

Here is the directory structure for this Nuclei SDK.

$NUCLEI_SDK_ROOT
β”œβ”€β”€ application
β”‚   β”œβ”€β”€ baremetal
β”‚   β”œβ”€β”€ freertos
β”‚   β”œβ”€β”€ ucosii
β”‚   └── rtthread
β”œβ”€β”€ Build
β”‚   β”œβ”€β”€ gmsl
β”‚   β”œβ”€β”€ Makefile.base
β”‚   β”œβ”€β”€ Makefile.conf
β”‚   β”œβ”€β”€ Makefile.core
β”‚   β”œβ”€β”€ Makefile.components
β”‚   β”œβ”€β”€ Makefile.files
β”‚   β”œβ”€β”€ Makefile.global
β”‚   β”œβ”€β”€ Makefile.misc
β”‚   β”œβ”€β”€ Makefile.rtos
β”‚   β”œβ”€β”€ Makefile.rules
β”‚   └── Makefile.soc
β”œβ”€β”€ doc
β”‚   β”œβ”€β”€ build
β”‚   β”œβ”€β”€ source
β”‚   β”œβ”€β”€ Makefile
β”‚   └── requirements.txt
β”œβ”€β”€ NMSIS
β”‚   β”œβ”€β”€ Core
β”‚   β”œβ”€β”€ DSP
β”‚   β”œβ”€β”€ NN
β”‚   └── Library
β”œβ”€β”€ OS
β”‚   β”œβ”€β”€ FreeRTOS
β”‚   β”œβ”€β”€ UCOSII
β”‚   └── RTThread
β”œβ”€β”€ SoC
β”‚   β”œβ”€β”€ gd32vf103
β”‚   └── demosoc
β”œβ”€β”€ test
β”‚   β”œβ”€β”€ core
β”‚   β”œβ”€β”€ ctest.h
β”‚   β”œβ”€β”€ LICENSE
β”‚   └── README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ Makefile
β”œβ”€β”€ NMSIS_VERSION
β”œβ”€β”€ package.json
β”œβ”€β”€ SConscript
β”œβ”€β”€ README.md
β”œβ”€β”€ setup.bat
└── setup.sh
  • application

    This directory contains all the application softwares for this Nuclei SDK.

    The application code can be divided into mainly 4 parts, which are:

    • Baremetal applications, which will provide baremetal applications without any OS usage, these applications will be placed in application/baremetal/ folder.
    • FreeRTOS applications, which will provide FreeRTOS applications using FreeRTOS RTOS, placed in application/freertos/ folder.
    • UCOSII applications, which will provide UCOSII applications using UCOSII RTOS, placed in application/ucosii/ folder.
    • RTThread applications, which will provide RT-Thread applications using RT-Thread RTOS, placed in application/rtthread/ folder.
  • SoC

    This directory contains all the supported SoCs for this Nuclei SDK, the directory name for SoC and its boards should always in lower case.

    Here we mainly support Nuclei processor cores running on Nuclei FPGA evaluation board(MCU200T/DDR200T), the support package placed in SoC/demosoc/.

    In each SoC's include directory, nuclei_sdk_soc.h must be provided, and include the soc header file, for example, SoC/demosoc/Common/Include/nuclei_sdk_soc.h.

    In each SoC Board's include directory, nuclei_sdk_hal.h must be provided, and include the board header file, for example, SoC/demosoc/Board/nuclei_fpga_eval/Include/nuclei_sdk_hal.h.

  • Build

    This directory contains the key part of the build system based on Makefile for Nuclei SDK.

  • NMSIS

    This directory contains the NMSIS header files, which is widely used in this Nuclei SDK, you can check the NMSIS_VERSION file to know the current NMSIS version used in Nuclei-SDK.

    We will also sync the changes in NMSIS project when it provided a new release.

  • OS

    This directory provided three RTOS package we suppported which are FreeRTOS, UCOSII and RT-Thread.

  • LICENSE

    Nuclei SDK license file.

  • NMSIS_VERSION

    NMSIS Version file. It will show current NMSIS version used in Nuclei SDK.

  • package.json

    PlatformIO package json file for Nuclei SDK, used in Nuclei Plaform for PlatformIO

  • SConscript

    RT-Thread package scons build script, used in RT-Thread package development.

  • Makefile

    An external Makefile just for build, run, debug application without cd to any coresponding application directory, such as application/baremetal/helloworld/.

  • setup.sh

    Nuclei SDK environment setup script for Linux. You need to create your own setup_config.sh.

    NUCLEI_TOOL_ROOT=/path/to/your_tool_root

    In the $NUCLEI_TOOL_ROOT for Linux, you need to have Nuclei RISC-V GNU GCC toolchain and OpenOCD installed as below.

    $NUCLEI_TOOL_ROOT
    β”œβ”€β”€ gcc
    β”‚   β”œβ”€β”€ bin
    β”‚   β”œβ”€β”€ include
    β”‚   β”œβ”€β”€ lib
    β”‚   β”œβ”€β”€ libexec
    β”‚   β”œβ”€β”€ riscv-nuclei-elf
    β”‚   └── share
    └── openocd
        β”œβ”€β”€ bin
        β”œβ”€β”€ contrib
        β”œβ”€β”€ distro-info
        β”œβ”€β”€ OpenULINK
        β”œβ”€β”€ scripts
        └── share
    
  • setup.bat

    Nuclei SDK environment setup bat script for Windows. You need to create your own setup_config.bat.

    set NUCLEI_TOOL_ROOT=\path\to\your_tool_root

    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.

    %NUCLEI_TOOL_ROOT%
    β”œβ”€β”€ build-tools
    β”‚   β”œβ”€β”€ bin
    β”‚   β”œβ”€β”€ gnu-mcu-eclipse
    β”‚   └── licenses
    β”œβ”€β”€ gcc
    β”‚   β”œβ”€β”€ bin
    β”‚   β”œβ”€β”€ include
    β”‚   β”œβ”€β”€ lib
    β”‚   β”œβ”€β”€ libexec
    β”‚   β”œβ”€β”€ riscv-nuclei-elf
    β”‚   └── share
    └── openocd
        β”œβ”€β”€ bin
        β”œβ”€β”€ contrib
        β”œβ”€β”€ distro-info
        β”œβ”€β”€ OpenULINK
        β”œβ”€β”€ scripts
        └── share

How to use

  1. Create and modify your own setup config
    • For Linux, create setup_config.sh in $NUCLEI_SDK_ROOT.
    • For Windows, create setup_config.bat in %NUCLEI_SDK_ROOT%.
  2. Source the environment script right in NUCLEI_SDK_ROOT
    • For Linux: source setup.sh
    • For Windows: setup.bat
  3. Build and run application.
    • Note: By default, the SoC and Board is set to demosoc and nuclei_fpga_eval, if you don't pass any SOC and BOARD variable in Make command, it will use the default SoC and Board.
    • Assume that you will run this application -> application/baremetal/helloworld/.
    • cd application/baremetal/helloworld/
    • you can run make help to show help message.
    • We provided different Nuclei Core configurations(CORE=<your_core>) we supported, see Build/Makefile.core.
      • such as CORE=n305
    • We support three download modes(DOWNLOAD=) for different applications.
      • flashxip: Program will to be download into flash and run directly in Flash
      • flash: Program will be download into flash, when running, program will be copied to ilm/ram and run in ilm/ram
      • ilm: Program will be download into ilm/ram and run directly in ilm/ram, program lost when poweroff
    • For example, if you want to build your application for CORE=n305 DOWNLOAD=ilm, you can easily run this command:
      make CORE=n305 DOWNLOAD=ilm all
    • If you want to upload your application for CORE=n305 DOWNLOAD=ilm, you can easily run this command:
      make CORE=n305 DOWNLOAD=ilm upload
    • (Option 1)If you want to debug your application for CORE=n305 DOWNLOAD=ilm:
      • First open a new terminal in the same application folder and run: make CORE=n305 DOWNLOAD=ilm run_openocd
      • Then run this command make CORE=n305 DOWNLOAD=ilm run_gdb in the existing terminal, then you can debug it using gdb, if you want to load your program, you need to type load to achieve it.
      • Notice: Since version 0.2.4, you can also pass extra GDB_PORT=<portno>, to change to use new gdb port other than default 3333, for example, make CORE=n305 DOWNLOAD=ilm GDB_PORT=3344 run_openocd and make CORE=n305 DOWNLOAD=ilm GDB_PORT=3344 run_gdb
    • (Option 2)If you want to debug your application for CORE=n305 DOWNLOAD=ilm:
      make CORE=n305 DOWNLOAD=ilm debug
    • If you want to use UART terminal tool to view the UART message, you can choose screen or minicom in Linux, teraterm in Windows, the default UART baudrate we use is 115200.

Knowledge book

  • If you want to learn more about Nuclei SDK documentation, please click Nuclei SDK documentation

  • If you need to build a new application, or change CORE or DOWNLOAD option, please make sure that you have clean the project by make clean

  • If you want to specify additional compiler flags, please follow this guidance in your application Makefile.

    • Pass common compiler flags to all c/asm/cpp compiler, you can use COMMON_FLAGS in Makefile, such as COMMON_FLAGS := -O3 -funroll-loops -fpeel-loops
    • Pass C compiler only flags to c compiler, you can use CFLAGS in Makefile, such as CFLAGS := -O3 -funroll-loops -fpeel-loops
    • For ASM compiler only flags, you can use ASMFLAGS, for CPP compiler only flags, you can use CXXFLAGS.
  • If you want to pass additional linker flags, you can use LDFLAGS, and if you have additional library directories, you can use LIBDIRS to specify library directories.

  • The preprovided applications and its makefile is the best startup examples about how to use Nuclei SDK.

  • Pass extra V=1 to your make command, it will show verbose compiling information, otherwise it will only show basic information. Sample output with extra V=1

    $ make V=1 all
    Current Configuration: RISCV_ARCH=rv32imafdc RISCV_ABI=ilp32d SOC=demosoc BOARD=nuclei_fpga_eval CORE=n307fd DOWNLOAD=ilm
    "Assembling : " ../../../OS/FreeRTOS/Source/portable/GCC/portasm.S
    riscv-nuclei-elf-gcc -g -march=rv32imafdc -mabi=ilp32d -mcmodel=medany -ffunction-sections -fdata-sections -fno-common   -DDOWNLOAD_MODE=DOWNLOAD_MODE_ILM -I. -I../../../NMSIS/Include -I../../../OS/FreeRTOS/Source/include -I../../../OS/FreeRTOS/Source/  portable/GCC -I../../../SoC/demosoc/Board/nuclei_fpga_eval/Include -I../../../SoC/demosoc/Common/Include -MMD -MT ../../../OS/FreeRTOS/Source/  portable/GCC/portasm.S.o -MF ../../../OS/FreeRTOS/Source/portable/GCC/portasm.S.o.d -c -o ../../../OS/FreeRTOS/Source/portable/GCC/  portasm.S.o ../../../OS/FreeRTOS/Source/portable/GCC/portasm.S
    "Assembling : " ../../../SoC/demosoc/Common/Source/GCC/intexc_demosoc.S
    riscv-nuclei-elf-gcc -g -march=rv32imafdc -mabi=ilp32d -mcmodel=medany -ffunction-sections -fdata-sections -fno-common   -DDOWNLOAD_MODE=DOWNLOAD_MODE_ILM -I. -I../../../NMSIS/Include -I../../../OS/FreeRTOS/Source/include -I../../../OS/FreeRTOS/Source/  portable/GCC -I../../../SoC/demosoc/Board/nuclei_fpga_eval/Include -I../../../SoC/demosoc/Common/Include -MMD -MT ../../../SoC/demosoc/Common/  Source/GCC/intexc_demosoc.S.o -MF ../../../SoC/demosoc/Common/Source/GCC/intexc_demosoc.S.o.d -c -o ../../../SoC/demosoc/Common/Source/GCC/  intexc_demosoc.S.o ../../../SoC/demosoc/Common/Source/GCC/intexc_demosoc.S
    "Assembling : " ../../../SoC/demosoc/Common/Source/GCC/startup_demosoc.S

Contributing

Changelog

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].