Nios® II Software Developer Handbook
Total Page:16
File Type:pdf, Size:1020Kb
Nios® II Software Developer Handbook Updated for Intel® Quartus® Prime Design Suite: 21.1 Subscribe NII-SDH | 2021.04.02 Send Feedback Latest document on the web: PDF | HTML Contents Contents 1. Nios® II Software Developer's Handbook Revision History........................................... 12 1.1. Overview of Nios® II Embedded Development Revision History.................................. 13 1.2. Getting Started with the Graphical User Interface Revision History..............................13 1.3. Getting Started from the Command Line Revision History..........................................14 1.4. Nios II Software Build Tools Revision History............................................................14 1.5. Overview of the Hardware Abstraction Layer Revision History.................................... 14 1.6. Developing Programs Using the Hardware Abstraction Layer Revision History............... 14 1.7. Developing Device Drivers for the Hardware Abstraction Layer Revision History............15 1.8. Exception Handling Revision History....................................................................... 15 1.9. Cache and Tightly-Coupled Memory Revision History.................................................15 1.10. MicroC/OS-II Real-Time Operating System Revision History..................................... 15 1.11. Ethernet and the NicheStack TCP/IP Stack - Nios II Edition Revision History...............16 1.12. Read-Only Zip File System Revision History........................................................... 16 1.13. Publishing Component Information to Embedded Software Revision History............... 16 1.14. HAL API Reference Revision History...................................................................... 16 1.15. Nios II Software Build Tools Reference Revision History........................................... 16 2. Overview of Nios II Embedded Development................................................................ 18 2.1. Installing Windows Subsystem for Linux (WSL) on Windows...................................... 18 2.2. Prerequisites for Understanding the Nios II Embedded Design Suite............................19 2.3. Finding Nios II EDS Files.......................................................................................19 2.4. Nios II Software Development Environment.............................................................19 2.5. Nios II EDS Development Flows............................................................................. 20 2.5.1. Nios II SBT Development Flow................................................................... 20 2.6. Nios II Programs..................................................................................................21 2.6.1. Makefiles and the SBT.............................................................................. 21 2.6.2. Nios II Software Project Types................................................................... 22 2.7. Intel FPGA Software Packages for Embedded Systems.............................................. 22 2.8. Nios II Embedded Design Examples........................................................................23 2.8.1. Hardware Examples................................................................................. 23 2.8.2. Software Examples.................................................................................. 24 2.9. Third-Party Embedded Tools Support...................................................................... 24 2.10. Additional Nios II Information.............................................................................. 24 3. Getting Started with the Graphical User Interface........................................................ 26 3.1. Installing Eclipse IDE into Nios II EDS.....................................................................26 3.1.1. Windows Installation................................................................................ 26 3.1.2. Linux Installation..................................................................................... 27 3.2. Getting Started with Nios II Software in Eclipse....................................................... 27 3.2.1. The Nios II SBT for Eclipse Workbench........................................................ 28 3.2.2. Creating a Project.................................................................................... 28 3.2.3. Navigating the Project.............................................................................. 30 3.2.4. Building the Project.................................................................................. 31 3.2.5. Configuring the FPGA............................................................................... 31 3.2.6. Running the Project on Nios II Hardware.....................................................31 3.2.7. Debugging the Project on Nios II Hardware................................................. 32 3.2.8. Creating a Simple BSP.............................................................................. 38 3.3. Makefiles and the Nios II SBT for Eclipse................................................................. 38 ® Nios II Software Developer Handbook Send Feedback 2 Contents 3.3.1. Eclipse Source Management...................................................................... 39 3.3.2. User Source Management......................................................................... 40 3.3.3. BSP Source Management.......................................................................... 41 3.4. Using the BSP Editor............................................................................................ 41 3.4.1. Tcl Scripting and the Nios II BSP Editor....................................................... 42 3.4.2. Starting the Nios II BSP Editor...................................................................42 3.4.3. The Nios II BSP Editor Screen Layout..........................................................42 3.4.4. The Command Area..................................................................................42 3.4.5. Messages Tabs........................................................................................49 3.4.6. Exporting a Tcl Script................................................................................50 3.4.7. Creating a New BSP................................................................................. 50 3.4.8. BSP Validation Errors................................................................................51 3.5. Run Configurations in the SBT for Eclipse................................................................ 52 3.5.1. Opening the Run Configuration Dialog Box...................................................52 3.5.2. The Project Tab........................................................................................52 3.5.3. The Target Connection Tab........................................................................ 52 3.5.4. The Debugger Tab....................................................................................53 3.6. Optimizing Project Build Time................................................................................ 53 3.7. Importing a Command-Line Project........................................................................ 53 3.7.1. Nios II Command-Line Projects..................................................................53 3.7.2. Importing through the Import Wizard......................................................... 53 3.7.3. Road Map............................................................................................... 54 3.7.4. Import a Command-Line C/C++ Application................................................ 54 3.7.5. Import a Supporting Project...................................................................... 55 3.7.6. User-Managed Source Files....................................................................... 56 3.8. Packaging a Library for Reuse................................................................................56 3.8.1. Creating the User Library.......................................................................... 56 3.8.2. Using the Library..................................................................................... 56 3.9. Creating a Software Package................................................................................. 57 3.10. Programming Flash in Intel FPGA Embedded Systems............................................. 59 3.10.1. Starting the Flash Programmer................................................................ 60 3.10.2. Creating a Flash Programmer Settings File.................................................60 3.10.3. The Flash Programmer Screen Layout....................................................... 61 3.10.4. The Command Area................................................................................61 3.10.5. The Console Area................................................................................... 61 3.10.6. Saving a Flash Programmer Settings File................................................... 62 3.10.7. Flash Programmer Options...................................................................... 62 3.11. Creating Memory Initialization Files...................................................................... 63 3.11.1. Generate Memory Initialization Files......................................................... 63 3.11.2. Generate Memory Initialization Files by the Legacy Method.......................... 63 3.11.3. Memory Initialization