Product Discontinuance Notification
1. Nios® II Software Developer's Handbook Revision History
2. Overview of Nios® II Embedded Development
3. Getting Started with the Graphical User Interface
4. Getting Started from the Command Line
5. Nios® II Software Build Tools
6. Overview of the Hardware Abstraction Layer
7. Developing Programs Using the Hardware Abstraction Layer
8. Developing Device Drivers for the Hardware Abstraction Layer
9. Exception Handling
10. Cache and Tightly-Coupled Memory
11. MicroC/OS-II Real-Time Operating System
12. Ethernet and the NicheStack TCP/IP Stack
13. Read-Only Zip File System
14. Publishing Component Information to Embedded Software
15. HAL API Reference
16. Nios® II Software Build Tools Reference
17. Nios® II Software Developer's Handbook Archives
1.1. Overview of Nios® II Embedded Development Revision History
1.2. Getting Started with the Graphical User Interface Revision History
1.3. Getting Started from the Command Line Revision History
1.4. Nios® II Software Build Tools Revision History
1.5. Overview of the Hardware Abstraction Layer Revision History
1.6. Developing Programs Using the Hardware Abstraction Layer Revision History
1.7. Developing Device Drivers for the Hardware Abstraction Layer Revision History
1.8. Exception Handling Revision History
1.9. Cache and Tightly-Coupled Memory Revision History
1.10. MicroC/OS-II Real-Time Operating System Revision History
1.11. Ethernet and the NicheStack TCP/IP Stack - Nios® II Edition Revision History
1.12. Read-Only Zip File System Revision History
1.13. Publishing Component Information to Embedded Software Revision History
1.14. HAL API Reference Revision History
1.15. Nios® II Software Build Tools Reference Revision History
2.1. Windows* Subsystem for Linux* (WSL 1) on Windows Requirements for Nios® II EDS
2.2. Prerequisites for Understanding the Nios® II Embedded Design Suite
2.3. Finding Nios II EDS Files
2.4. Nios® II Software Development Environment
2.5. Nios® II EDS Development Flows
2.6. Nios® II Programs
2.7. Intel FPGA Software Packages for Embedded Systems
2.8. Nios® II Embedded Design Examples
2.9. Third-Party Embedded Tools Support
2.10. Additional Nios® II Information
3.1. Installing Eclipse IDE into Nios® II EDS
3.2. Getting Started with Nios II Software in Eclipse
3.3. Makefiles and the Nios® II SBT for Eclipse
3.4. Using the BSP Editor
3.5. Run Configurations in the SBT for Eclipse
3.6. Optimizing Project Build Time
3.7. Importing a Command-Line Project
3.8. Packaging a Library for Reuse
3.9. Creating a Software Package
3.10. Programming Flash in Intel FPGA Embedded Systems
3.11. Creating Memory Initialization Files
3.12. Running a Nios® II System with ModelSim
3.13. Eclipse Usage Notes
3.13.1. Configuring Application and Library Properties
3.13.2. Configuring BSP Properties
3.13.3. Exclude from Build Not Supported
3.13.4. Selecting the Correct Launch Configuration Type
3.13.5. Target Connection Options
3.13.6. Renaming Nios® II Projects
3.13.7. Running Shell Scripts from the SBT for Eclipse
3.13.8. Must Use Nios® II Build Configuration
3.13.9. CDT Limitations
3.13.10. Enhancements for Build Configurations in SBT and SBT for Eclipse
5.1. Road Map for the SBT
5.2. Makefiles
5.3. Nios® II Embedded Software Projects
5.4. Common BSP Tasks
5.5. Details of BSP Creation
5.6. Tcl Scripts for BSP Settings
5.7. Revising Your BSP
5.8. Specifying BSP Defaults
5.9. Device Drivers and Software Packages
5.10. Boot Configurations for Intel FPGA Embedded Software
5.11. Intel FPGA-Provided Embedded Development Tools
5.12. Restrictions
7.1. HAL BSP Settings
7.2. The Nios® II Embedded Project Structure
7.3. The system.h System Description File
7.4. Data Widths and the HAL Type Definitions
7.5. UNIX-Style Interface
7.6. File System
7.7. Using Character-Mode Devices
7.8. Using File Subsystems
7.9. Using Timer Devices
7.10. Using Flash Devices
7.11. Using DMA Devices
7.12. Using Interrupt Controllers
7.13. Reducing Code Footprint in Embedded Systems
7.14. Boot Sequence and Entry Point
7.15. Memory Usage
7.16. Working with HAL Source Files
7.13.1. Enable Compiler Optimizations
7.13.2. Use Reduced Device Drivers
7.13.3. Reduce the File Descriptor Pool
7.13.4. Use /dev/null
7.13.5. Use a Smaller File I/O Library
7.13.6. Use the Lightweight Device Driver API
7.13.7. Use the Minimal Character-Mode API
7.13.8. Eliminate Unused Device Drivers
7.13.9. Eliminate Unneeded Exit Code
7.13.10. Turn off C++ Support
8.1. Driver Integration in the HAL API
8.2. The HAL Peripheral-Specific API
8.3. Preparing for HAL Driver Development
8.4. Development Flow for Creating Device Drivers
8.5. Nios® II Hardware Design Concepts
8.6. Accessing Hardware
8.7. Creating Embedded Drivers for HAL Device Classes
8.8. Integrating a Device Driver in the HAL
8.9. Creating a Custom Device Driver for the HAL
8.10. Reducing Code Footprint in HAL Embedded Drivers
8.11. HAL Namespace Allocation
8.12. Overriding the HAL Default Device Drivers
8.8.5.2.1. Creating and Naming the Driver or Package
8.8.5.2.2. Identifying the Hardware Component Class
8.8.5.2.3. Setting the BSP Type
8.8.5.2.4. Specifying an Operating System
8.8.5.2.5. Specifying Source Files
8.8.5.2.6. Specifying a Subdirectory
8.8.5.2.7. Enabling Software Initialization
8.8.5.2.8. Adding Include Paths
8.8.5.2.9. Version Compatibility
9.2.1. HAL APIs for Hardware Interrupts
9.2.2. HAL ISR Restrictions
9.2.3. Writing an ISR
9.2.4. Registering an ISR with the Enhanced Interrupt API
9.2.5. Enabling and Disabling Interrupts
9.2.6. Configuring an External Interrupt Controller
9.2.7. C Example
9.2.8. Upgrading to the Enhanced HAL Interrupt API
9.3.1.1. Execute Time-Intensive Algorithms in the Application Context
9.3.1.2. Implement Time-Intensive Algorithms in Hardware
9.3.1.3. Increase Buffer Size
9.3.1.4. Use Double Buffering
9.3.1.5. Keep Interrupts Enabled
9.3.1.6. Use Fast Memory
9.3.1.7. Use a Separate Exception Stack
9.3.1.8. Use Nested Hardware Interrupts
9.3.1.9. Locate ISR Body in Vector Table
9.3.1.10. Use Compiler Optimization
10.1. Nios® II Cache Implementation
10.2. HAL API Functions for Managing Cache
10.3. Initializing the Nios® II Cache after Reset
10.4. Nios® II Device Driver Cache Considerations
10.5. Cache Considerations for Writing Program Loaders
10.6. Managing Cache in Multi-Master and Multi-Processor Systems
10.7. Nios® II Tightly-Coupled Memory
15.1.1. _exit()
15.1.2. _rename()
15.1.3. alt_dcache_flush()
15.1.4. alt_dcache_flush_all()
15.1.5. alt_dcache_flush_no_writeback()
15.1.6. alt_uncached_malloc()
15.1.7. alt_uncached_free()
15.1.8. alt_remap_uncached()
15.1.9. alt_remap_cached()
15.1.10. alt_icache_flush_all()
15.1.11. alt_icache_flush()
15.1.12. alt_alarm_start()
15.1.13. alt_alarm_stop()
15.1.14. alt_dma_rxchan_depth()
15.1.15. alt_dma_rxchan_close()
15.1.16. alt_dev_reg()
15.1.17. alt_dma_rxchan_open()
15.1.18. alt_dma_rxchan_prepare()
15.1.19. alt_dma_rxchan_reg()
15.1.20. alt_dma_txchan_close()
15.1.21. alt_dma_txchan_ioctl()
15.1.22. alt_dma_txchan_open()
15.1.23. alt_dma_txchan_reg()
15.1.24. alt_flash_close_dev()
15.1.25. alt_exception_cause_generated_bad_addr()
15.1.26. alt_erase_flash_block()
15.1.27. alt_dma_rxchan_ioctl()
15.1.28. alt_dma_txchan_space()
15.1.29. alt_dma_txchan_send()
15.1.30. alt_flash_open_dev()
15.1.31. alt_fs_reg()
15.1.32. alt_get_flash_info()
15.1.33. alt_ic_irq_disable()
15.1.34. alt_ic_irq_enabled()
15.1.35. alt_ic_isr_register()
15.1.36. alt_ic_irq_enable()
15.1.37. alt_instruction_exception_register()
15.1.38. alt_irq_disable()
15.1.39. alt_irq_cpu_enable_interrupts ()
15.1.40. alt_irq_disable_all()
15.1.41. alt_irq_enable()
15.1.42. alt_irq_enable_all()
15.1.43. alt_irq_enabled()
15.1.44. alt_irq_init()
15.1.45. alt_irq_pending ()
15.1.46. alt_irq_register()
15.1.47. alt_llist_insert()
15.1.48. alt_llist_remove()
15.1.49. alt_load_section()
15.1.50. alt_nticks()
15.1.51. alt_read_flash()
15.1.52. alt_tick()
15.1.53. alt_ticks_per_second()
15.1.54. alt_timestamp()
15.1.55. alt_timestamp_freq()
15.1.56. alt_timestamp_start()
15.1.57. alt_write_flash()
15.1.58. alt_write_flash_block()
15.1.59. close()
15.1.60. fstat()
15.1.61. fork()
15.1.62. fcntl()
15.1.63. execve()
15.1.64. getpid()
15.1.65. kill()
15.1.66. stat()
15.1.67. settimeofday()
15.1.68. wait()
15.1.69. unlink()
15.1.70. sbrk()
15.1.71. link()
15.1.72. lseek()
15.1.73. alt_sysclk_init()
15.1.74. open()
15.1.75. times()
15.1.76. read()
15.1.77. write()
15.1.78. usleep()
15.1.79. alt_lock_flash()
15.1.80. gettimeofday()
15.1.81. ioctl()
15.1.82. isatty()
15.3.1. adc_stop
15.3.2. adc_start
15.3.3. adc_set_mode_run_once
15.3.4. adc_set_mode_run_continuously
15.3.5. adc_recalibrate
15.3.6. adc_interrupt_enable
15.3.7. adc_interrupt_disable
15.3.8. adc_clear_interrupt_status
15.3.9. adc_wait_for_interrupt - ADC Sample Storage Status Register
15.3.10. adc_interrupt_asserted
15.3.11. adc_wait_for interrupt - IRQ Status Register
15.3.12. alt_adc_word_read
16.1.1. Logging Levels
16.1.2. Setting Values
16.1.3. Utility and Script Summary
16.1.4. nios2-app-generate-makefile
16.1.5. nios2-bsp-create-settings
16.1.6. nios2-bsp-generate-files
16.1.7. nios2-bsp-query-settings
16.1.8. nios2-bsp-update-settings
16.1.9. nios2-lib-generate-makefile
16.1.10. nios2-bsp-editor
16.1.11. nios2-app-update-makefile
16.1.12. nios2-lib-update-makefile
16.1.13. nios2-swexample-create
16.1.14. nios2-elf-insert
16.1.15. nios2-elf-query
16.1.16. nios2-flash-programmer-generate
16.1.17. nios2-bsp
16.1.18. nios2-bsp-console
16.1.19. alt-file-convert (BETA)
16.5.2.1. add_memory_device
16.5.2.2. add_memory_region
16.5.2.3. add_section_mapping
16.5.2.4. are_same_resource
16.5.2.5. delete_memory_region
16.5.2.6. delete_section_mapping
16.5.2.7. disable_sw_package
16.5.2.8. enable_sw_package
16.5.2.9. get_addr_span
16.5.2.10. get_assignment
16.5.2.11. get_available_drivers
16.5.2.12. get_available_sw_packages
16.5.2.13. get_base_addr
16.5.2.14. get_break_offset
16.5.2.15. get_break_slave_desc
16.5.2.16. get_cpu_name
16.5.2.17. get_current_memory_regions
16.5.2.18. get_current_section_mappings
16.5.2.19. get_default_memory_regions
16.5.2.20. get_driver
16.5.2.21. get_enabled_sw_packages
16.5.2.22. get_exception_offset
16.5.2.23. get_exception_slave_desc
16.5.2.24. get_fast_tlb_miss_exception_offset
16.5.2.25. get_fast_tlb_miss_exception_slave_desc
16.5.2.26. get_interrupt_controller_id
16.5.2.27. get_irq_interrupt_controller_id
16.5.2.28. get_irq_number
16.5.2.29. get_memory_region
16.5.2.30. get_module_class_name
16.5.2.31. get_module_name
16.5.2.32. get_reset_offset
16.5.2.33. get_reset_slave_desc
16.5.2.34. get_section_mapping
16.5.2.35. get_setting
16.5.2.36. get_setting_desc
16.5.2.37. get_slave_descs
16.5.2.38. is_char_device
16.5.2.39. is_connected_interrupt_controller_device
16.5.2.40. is_connected_to_data_master
16.5.2.41. is_connected_to_instruction_master
16.5.2.42. is_ethernet_mac_device
16.5.2.43. is_flash
16.5.2.44. is_memory_device
16.5.2.45. is_non_volatile_storage
16.5.2.46. is_timer_device
16.5.2.47. log_debug
16.5.2.48. log_default
16.5.2.49. log_error
16.5.2.50. log_verbose
16.5.2.51. set_driver
16.5.2.52. set_ignore_file
16.5.2.53. set_setting
16.5.2.54. update_memory_region
16.5.2.55. update_section_mapping
16.5.2.56. add_default_memory_regions
16.5.2.57. create_bsp
16.5.2.58. generate_bsp
16.5.2.59. get_available_bsp_type_versions
16.5.2.60. get_available_bsp_types
16.5.2.61. get_available_cpu_architectures
16.5.2.62. get_available_cpu_names
16.5.2.63. get_available_software
16.5.2.64. get_available_software_setting_properties
16.5.2.65. get_available_software_settings
16.5.2.66. get_bsp_version
16.5.2.67. get_cpu_architecture
16.5.2.68. get_nios2_dpx_thread_num
16.5.2.69. get_sopcinfo_file
16.5.2.70. get_supported_bsp_types
16.5.2.71. is_bsp_hal_extension
16.5.2.72. is_bsp_lwhal_extension
16.5.2.73. open_bsp
16.5.2.74. save_bsp
16.5.2.75. set_bsp_version
16.5.2.76. set_logging_mode
16.5.3.1. add_class_sw_setting
16.5.3.2. add_class_systemh_line
16.5.3.3. add_module_sw_property
16.5.3.4. add_module_sw_setting
16.5.3.5. add_module_systemh_line
16.5.3.6. add_systemh_line
16.5.3.7. get_class_peripheral
16.5.3.8. get_module_assignment
16.5.3.9. get_module_name
16.5.3.10. get_module_peripheral
16.5.3.11. get_module_sw_setting_value
16.5.3.12. get_peripheral_property
16.5.3.13. remove_class_systemh_line
16.5.3.14. remove_module_systemh_line
16.5.3.15. set_class_sw_setting_property
16.5.3.16. set_module_sw_setting_property
16.4.1. Application Makefile Variables
You can modify the following application makefile variables on the command line:
- CREATE_OBJDUMP—Assign 1 to this variable to enable creation of an object dump file (.objdump) after linking the application. The nios2-elf-objdump utility is called to create this file. An object dump contains information about all object files linked into the .elf file. It provides a complete view of all code linked into your application. An object dump contains a disassembly view showing each instruction and its address.
- OBJDUMP_INCLUDE_SOURCE—Assign 1 to this variable to include source code inline with disassembled instructions in the object dump. When enabled, this includes the --source switch when calling the object dump executable. This is useful for debugging and examination of how the preprocessor and compiler generate instructions from higher level source code (such as C) or from macros.
- OBJDUMP_FULL_CONTENTS—Assign 1 to this variable to include a raw display of the contents of the .text linker section. When enabled, this variable includes the --full-contents switch when calling the object dump executable.
- CREATE_.elf_DERIVED_FILES—Setting this variable to 1 creates the HDL simulation and onchip memory initialization files when you invoke the makefile with the all target. When this variable is 0 (the default), these files are only created when you make the mem_init_generate or mem_init_install target.
Note: Creating the HDL simulation and onchip memory initialization files increases project build time.
- CREATE_LINKER_MAP—Assign 1 to this variable to enable creation of a link map file (.map) after linking the application. A link map file provides information including which object files are included in the executable, the path to each object file, where objects and symbols are located in memory, and how the common symbols are allocated.
- APP_CFLAGS_DEFINED_SYMBOLS—This variable allows you to define macros using the -D argument, for example -D <macro name> . The contents of this variable are passed to the compiler and linker without modification.
- APP_CFLAGS_UNDEFINED_SYMBOLS—This variable allows you to remove macro definitions using the -U argument, for example -U <macro name> . The contents of this variable are passed to the compiler and linker without modification.
- APP_CFLAGS_OPTIMIZATION—The C/C++ compiler optimization level. For example, -O0 provides no optimization and -O2 provides standard optimization. -O0 is recommended for debugging code, because compiler optimization can remove variables and produce non-sequential execution of code while debugging.
- APP_CFLAGS_DEBUG_LEVEL—The C/C++ compiler debug level. -g provides the default set of debug symbols typically required to debug an application. Omitting -g omits debug symbols from the .elf.
- APP_CFLAGS_WARNINGS—The C/C++ compiler warning level. -Wall is commonly used, enabling all warning messages.
- APP_CFLAGS_USER_FLAGS
- APP_INCLUDE_DIRS—Use this variable to specify paths for the preprocessor to search. These paths commonly contain C header files (.h) that application code requires. Each path name is formatted and passed to the preprocessor with the -I option.
You can add multiple directories by enclosing them in double quotes, for example --set APP_INCLUDE_DIRS "../my_includes ../../other_includes".
- APP_LIBRARY_DIRS—Use this variable to specify paths for additional libraries that your application links with.
Note: When you specify a user library path with APP_LIBRARY_DIRS, you also need to specify the user library names with the APP_LIBRARY_NAMES variable.
APP_LIBRARY_DIRS specifies only the directory where the user library file(s) are located, not the library archive file (.a) name.
Note: Do not use this variable to specify the path to a BSP or user library created with the SBT. The paths to these libraries are specified in public.mk files included in the application makefile.
You can add multiple directories by enclosing them in double quotes, for example --set APP_LIBRARY_DIRS "../my_libs ../../other_libs".
- APP_LIBRARY_NAMES—Use this variable to specify the names of additional libraries that your application must link with. Library files are .a files.
Note: You do not specify the full name of the .a file. Instead, you specify the user library name <name>, and the SBT constructs the filename lib<name>.a. For example, if you add the string "math" to APP_LIBRARY_NAMES, the SBT assumes that your library file is named libmath.a.
Each specified user library name is passed to the linker with the -l option. The paths to locate these libraries must be specified in the APP_LIBRARY_DIRS variable.
Note: You cannot use this variable to specify a BSP or user library created with the SBT. The paths to these libraries are specified in public.mk file included in the application makefile.
- BUILD_PRE_PROCESS—This variable allows you to specify a command to be executed prior to building the application, for example, cp *.elf ../lastbuild.
- BUILD_POST_PROCESS—This variable allows you to specify a command to be executed after building the application, for example, cp *.elf //production/test/nios2executables.