Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12604 Discussions

Makefile for HAL-free build (custom crt0.S)

Altera_Forum
Honored Contributor II
1,044 Views

Hello everyone. I'm relatively new to the Nios world and am looking for an example makefile and such to build a project without any of the HAL. (Actually, I'm going to use the PIO includes, but they are all inline.) My device has no external RAM on it. Even when not using any of the HAL services, it still uses up a few KB of RAM for the mandatory 4 file descriptors, the 32 entries in the interrupt jump table, etc. 

 

I will also have my own interrupt handler as I will only have one interrupt source in my system (my custom peripheral) and do not want the latency of the interrupt register loop in the HAL's interrupt handler. 

 

Has anyone published a simple project that demonstrates this? All I know is that it cannot be done through the IDE as the IDE makefiles force you to use the Altera crt0.S (so says my support contact). 

 

cheers 

-mark
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
353 Views

To use your own interrupt handler, I think you can edit the linker file "generated.x" in system library project debug folder, you also can edit crts.o directly. Don't forget to backup it before editing. 

 

To avoid using HAL, you can edit alt_sys_init.c
0 Kudos
Reply