Forum Discussion
Altera_Forum
Honored Contributor
20 years agoBootloader size
Hi! I'm writing a bootloader for NIOSII to load my application from an rs232 uart into SDRAM. What I'm trying to do is pretty much the same as described in this topic: http://www.n...
Altera_Forum
Honored Contributor
20 years agoAssuming you're not using C++, edit alt_main.c so it just contains:
void alt_main (void)
{
alt_irq_init (ALT_IRQ_BASE);
main (alt_argc, alt_argv, alt_envp);
while (1);
} (file likely to be in directory C:\altera\kits\nios2_51\components\altera_hal\HAL\src ) Comment out "call alt_load" in crt0.S (which might break static initialisation, or running code directly from flash, neither which I personally use) For both the project and the syslib, set the compiler optimisation option to "minimise size". In the system library properties, check "small C library" and "reduced device drivers" and set stdin/stdout/stderr to null. I also edit some of the "component.mk" files to prevent library code being sucked in. I also write my own serial I/O code (interrupt handlers). In window\preferences, Nios-II, check "generate objdump file"; this will allow you to see what's being included in the build. Hmmm it's about time I wrote this up (would Altera accept App-Note submissions?)