Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

8.8.5.2.7. Enabling Software Initialization

If your driver or software package uses the HAL auto-initialization 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.