Forum Discussion
Altera_Forum
Honored Contributor
12 years agoThe NiosII refuses to run from the .entry location upon power-up and configuration. It is only when the SBT tries to download a new elf through JTAG that the NiosII tries running the existing code, and then later on is made to run the new updated code. I have enabled Altera logging. Here is output from this:
[crt0.S] Inst & Data Cache Initialized. [crt0.S] Setting up stack and global pointers. [crt0.S] Clearing BSS [crt0.S] Calling alt_main. [alt_main.c] Entering alt_main, calling alt_irq_init. [alt_main.c] Done alt_irq_init, calling alt_os_init. [alt_main.c] Done OS Init, calling alt_sem_create. [alt_main.c] Calling alt_sys_init. [alt_main.c] Done alt_sys_init. [alt_main.c] Redirecting IO. [alt_main.c] Calling main. Hello from NiosII [alt_exit.c] Entering _exit() function. [alt_exit.c] Exit code from main was 0. [alt_exit.c] Calling ALT_OS_STOP(). [alt_exit.c] Calling ALT_SIM_HALT(). [alt_exit.c] Spinning forever. [crt0.S] Inst & Data Cache Initialized. [crt0.S] Setting up stack and global pointers. [crt0.S] Clearing BSS [crt0.S] Calling alt_main. [alt_main.c] Entering alt_main, calling alt_irq_init. [alt_main.c] Done alt_irq_init, calling alt_os_init. [alt_main.c] Done OS Init, calling alt_sem_create. [alt_main.c] Calling alt_sys_init. [alt_main.c] Done alt_sys_init. [alt_main.c] Redirecting IO. [alt_main.c] Calling main. Hello from NiosII [alt_exit.c] Entering _exit() function. [alt_exit.c] Exit code from main was 0. [alt_exit.c] Calling ALT_OS_STOP(). [alt_exit.c] Calling ALT_SIM_HALT(). [alt_exit.c] Spinning forever. As can be seen, the first crt0.S was started only after SBT tried to download a new elf through JTAG. The existing code was executed upto exit(). Following this after some time the new updated code was run to completion.