Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

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

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

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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