Nios® V Processor Software Developer Handbook

ID 743810
Date 10/02/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

6.12.3. Customizing the Boot Sequence

You can provide your own implementation of the start-up sequence by simply defining alt_main() in your Nios® V project. This gives you complete control of the boot sequence, and allows you to selectively enable HAL services. If your application requires an alt_main() entry point, you can copy the default implementation as a starting point and customize it to your needs.

Function alt_main() calls function main(). After main() returns, the default alt_main() enters an infinite loop. Alternatively, your custom alt_main() might terminate by calling exit(). Do not use a return statement.

The following line of code is the prototype for alt_main():

void alt_main (void) 

The HAL build environment includes mechanisms to override default HAL BSP code. This lets you override boot loaders, as well as default device drivers and other system code, with your own implementation.

alt_sys_init.c is a generated file, which you must not modify. However, the Nios® V processor tools enables you to control the generated contents of alt_sys_init.c. To specify the initialization sequence in alt_sys_init.c, you manipulate the auto_initialize and alt_sys_init_priority properties of each driver, using the set_sw_property Tcl command.