for information:
simple bootloader:
you can write programs with the same quartus and SOPC settings and
store these programs at different locations in flash.
(Reset Address in flash at 0x00000000)
I have a c_bootloader at add 0x00000000 in flash
it can receive programs over uart (ymodem) and writes it into flash.
e.g I have c_bootloader at add=0x00000000 in flash
prog1 at add=0x00100000 in flash
prog2 at add=0x00200000 in flash
from the c_bootloader i can execute e.g. the following code to start
prog2 from flash
void (*pBoot)(void); // declare function pointer
int startadd; // declare startaddress as integer
..
startadd=0x200000;
pBoot=(void*)startadd;
pBoot(); // jump to new altera bootloader in flash
the trick is, that every program in flash has the small altera_bootloader
in front and copies itself from flash to ram and starts from ram. So the main
(difficult) job is done from the altera_bootloader.
the c_bootloader is just a noraml c-program, no assembler necessary.
you can use the same settings of quartus and sopc builder for the
c_bootloader and your other programs.
see also topic
How can I start different programs from flash
in general discussion forum
http://www.niosforum.com/forum/index.php?s...0&hl=bootloader (
http://www.niosforum.com/forum/index.php?showtopic=200&hl=bootloader)