Nios II Software Developer Handbook

Transcription

Nios II Software DeveloperHandbookUpdated for Intel Quartus Prime Design Suite: 20.4SubscribeSend FeedbackNII-SDH 2020.12.14Latest document on the web: PDF HTML

ContentsContents1. Nios II Software Developer's Handbook Revision History. 121.1. Overview of Nios II Embedded Development Revision History. 131.2. Getting Started with the Graphical User Interface Revision History.131.3. Getting Started from the Command Line Revision History. 131.4. Nios II Software Build Tools Revision History.141.5. Overview of the Hardware Abstraction Layer Revision History. 141.6. Developing Programs Using the Hardware Abstraction Layer Revision History. 141.7. Developing Device Drivers for the Hardware Abstraction Layer Revision History. 141.8. Exception Handling Revision History. 151.9. Cache and Tightly-Coupled Memory Revision History.151.10. MicroC/OS-II Real-Time Operating System Revision History. 151.11. Ethernet and the NicheStack TCP/IP Stack - Nios II Edition Revision History.151.12. Read-Only Zip File System Revision History. 161.13. Publishing Component Information to Embedded Software Revision History. 161.14. HAL API Reference Revision History. 161.15. Nios II Software Build Tools Reference Revision History. 162. Overview of Nios II Embedded Development. 172.1.2.2.2.3.2.4.2.5.Installing Windows Subsystem for Linux (WSL) on Windows. 17Prerequisites for Understanding the Nios II Embedded Design Suite.18Finding Nios II EDS Files. 18Nios II Software Development Environment.18Nios II EDS Development Flows. 192.5.1. Nios II SBT Development Flow. 192.6. Nios II Programs.202.6.1. Makefiles and the SBT. 202.6.2. Nios II Software Project Types. 202.7. Intel FPGA Software Packages for Embedded Systems. 212.8. Nios II Embedded Design Examples.222.8.1. Hardware Examples. 222.8.2. Software Examples. 222.9. Third-Party Embedded Tools Support. 232.10. Additional Nios II Information. 233. Getting Started with the Graphical User Interface. 253.1. Installing Eclipse IDE into Nios II EDS.253.1.1. Windows Installation. 253.1.2. Linux Installation. 263.2. Getting Started with Nios II Software in Eclipse. 263.2.1. The Nios II SBT for Eclipse Workbench. 273.2.2. Creating a Project. 273.2.3. Navigating the Project. 293.2.4. Building the Project. 303.2.5. Configuring the FPGA. 303.2.6. Running the Project on Nios II Hardware. 303.2.7. Debugging the Project on Nios II Hardware. 313.2.8. Creating a Simple BSP. 373.3. Makefiles and the Nios II SBT for Eclipse. 37Nios II Software Developer Handbook2Send Feedback

Contents3.3.1. Eclipse Source Management. 383.3.2. User Source Management. 393.3.3. BSP Source Management. 403.4. Using the BSP Editor. 403.4.1. Tcl Scripting and the Nios II BSP Editor. 413.4.2. Starting the Nios II BSP Editor. 413.4.3. The Nios II BSP Editor Screen Layout.413.4.4. The Command Area.413.4.5. The Console Area.463.4.6. Exporting a Tcl Script.463.4.7. Creating a New BSP. 473.4.8. BSP Validation Errors.473.5. Run Configurations in the SBT for Eclipse. 483.5.1. Opening the Run Configuration Dialog Box.483.5.2. The Project Tab.483.5.3. The Target Connection Tab. 493.5.4. The Debugger Tab.493.6. Optimizing Project Build Time. 493.7. Importing a Command-Line Project. 493.7.1. Nios II Command-Line Projects. 503.7.2. Importing through the Import Wizard. 503.7.3. Road Map. 503.7.4. Import a Command-Line C/C Application. 513.7.5. Import a Supporting Project. 513.7.6. User-Managed Source Files. 523.8. Packaging a Library for Reuse. 523.8.1. Creating the User Library. 523.8.2. Using the Library. 533.9. Creating a Software Package. 533.10. Programming Flash in Intel FPGA Embedded Systems. 563.10.1. Starting the Flash Programmer. 563.10.2. Creating a Flash Programmer Settings File.573.10.3. The Flash Programmer Screen Layout. 573.10.4. The Command Area. 573.10.5. The Console Area. 583.10.6. Saving a Flash Programmer Settings File. 583.10.7. Flash Programmer Options. 583.11. Creating Memory Initialization Files. 593.11.1. Generate Memory Initialization Files. 593.11.2. Generate Memory Initialization Files by the Legacy Method. 603.11.3. Memory Initialization Files for User-Defined Memories. 603.12. Running a Nios II System with ModelSim.623.12.1. Using ModelSim with an SOPC Builder-Generated System. 623.12.2. Using ModelSim with a Platform Designer-Generated System. 623.13. Eclipse Usage Notes. 653.13.1. Configuring Application and Library Properties.653.13.2. Configuring BSP Properties. 653.13.3. Exclude from Build Not Supported. 663.13.4. Selecting the Correct Launch Configuration Type. 663.13.5. Target Connection Options.663.13.6. Renaming Nios II Projects. 66Send FeedbackNios II Software Developer Handbook3

Contents3.13.7. Running Shell Scripts from the SBT for Eclipse. 673.13.8. Must Use Nios II Build Configuration. 673.13.9. CDT Limitations. 683.13.10. Enhancements for Build Configurations in SBT and SBT for Eclipse. 694. Getting Started from the Command Line. 724.1. Advantages of Command-Line Software Development. 724.2. Outline of the Nios II SBT Command-Line Interface. 724.2.1. Utilities.724.2.2. Scripts.734.2.3. Tcl Commands. 764.2.4. Tcl Scripts. 764.2.5. The Nios II Command Shell. 764.3. Getting Started in the SBT Command Line.774.3.1. Prerequisites. 774.3.2. Creating Hello World for an Intel FPGA Development Board. 784.3.3. Running Hello World on an Intel FPGA Development Board.784.3.4. Debugging hello world. 794.4. Software Build Tools Scripting Basics. 804.4.1. Creating a BSP with a Script. 814.4.2. Creating an Application Project with a Script. 844.5. Running make. 844.5.1. Creating Memory Initialization Files. 855. Nios II Software Build Tools. 865.1. Road Map for the SBT.875.1.1. What the Build Tools Create.875.1.2. Comparing the Command Line with Eclipse.875.2. Makefiles. 875.2.1. Modifying Makefiles. 885.2.2. Makefile Targets.885.3. Nios II Embedded Software Projects. 895.3.1. Applications and Libraries.895.3.2. Board Support Packages. 905.3.3. Software Build Process. 925.4. Common BSP Tasks.935.4.1. Adding the Nios II SBT to Your Tool Flow. 935.4.2. Linking and Locating.955.4.3. Other BSP Tasks.1015.5. Details of BSP Creation. 1055.5.1. BSP Settings File Creation. 1075.5.2. Generated and Copied Files. 1075.5.3. HAL BSP Files and Folders. 1085.5.4. Linker Map Validation.1125.6. Tcl Scripts for BSP Settings.1125.6.1. Calling a Custom BSP Tcl Script. 1125.7. Revising Your BSP. 1155.7.1. Rebuilding Your BSP. 1155.7.2. Regenerating Your BSP. 1165.7.3. Updating Your BSP. 1185.7.4. Recreating Your BSP. 119Nios II Software Developer Handbook4Send Feedback

Contents5.8. Specifying BSP Defaults. 1215.8.1. Top Level Tcl Script for BSP Defaults. 1225.8.2. Specifying the Default stdio Device. 1235.8.3. Specifying the Default System Timer.1245.8.4. Specifying the Default Memory Map. 1245.8.5. Specifying Default Bootloader Parameters.1245.8.6. Using Individual Default Tcl Procedures. 1265.9. Device Drivers and Software Packages. 1265.10. Boot Configurations for Intel FPGA Embedded Software. 1265.10.1. Memory Types.1265.10.2. Boot from Flash Configuration. 1275.10.3. Boot from Monitor Configuration. 1275.10.4. Run from Initialized Memory Configuration.1285.10.5. Run-time Configurable Reset Configuration. 1285.11. Intel FPGA-Provided Embedded Development Tools. 1295.11.1. Nios II Software Build Tool GUIs. 1295.11.2. The Nios II Command Shell.1315.11.3. The Nios II Command-Line Commands. 1315.12. Restrictions. 1516. Overview of the Hardware Abstraction Layer. 1526.1. Getting Started with the Hardware Abstraction Layer. 1526.2. HAL Architecture for Embedded Software Systems.1536.2.1. Services.1536.2.2. Layers of a HAL-Based System. 1536.2.3. Applications versus Drivers.1546.2.4. Generic Device Models. 1546.2.5. C Standard Library—newlib.1556.3. Embedded Hardware Supported by the HAL. 1556.3.1. Nios II Processor Core Support. 1556.3.2. Supported Peripherals.1556.3.3. MPU Support. 1576.3.4. MMU Support.1577. Developing Programs Using the Hardware Abstraction Layer. 1587.1.7.2.7.3.7.4.7.5.7.6.7.7.HAL BSP Settings. 158The Nios II Embedded Project Structure. 159The system.h System Description File. 160Data Widths and the HAL Type Definitions.

Nios II Software Developer Handbook Updated for Intel Quartus Prime Design Suite: 21.1 Subscribe Send Feedback NII-SDH 2021.04.02 Latest document on