Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

7.8.5.2.7. Enabling Software Initialization

If your driver or software package uses the HAL autoinitialization mechanism, your source code includes INSTANCE and INIT macros, to create storage for each driver instance, and to call any initialization routines. The generated alt_sys_init.c file invokes these macros, which must be defined in a header file named <hardware component class>.h.

For more information, refer to the “Provide *INSTANCE and *INIT Macros” chapter.

To support this functionality in Nios II BSPs, you must set the set_sw_property command’s auto_initialize argument to true using the following Tcl command:

set_sw_property auto_initialize true

If you do not turn on this attribute, alt_sys_init.c does not invoke the INIT and INSTANCE macros.