Forum Discussion
Nios boot loader
Hi.
I am new in Nios subject, but i have not many time to study this issue. My boss wants results, so please, help me as you can. One of functionalities for my system is to update the program(I mean Nios firmware). May i update the firmware without updating boot loader. If the answer is YES, how to do it? If the answer is NO, how can l update firmware? If this option (update firmware) is available, how to do it. If you, guys, do not wants to explain, but there are documents or application note, which can explain me the issue, give links to this documents. Thank, you Slava.8 Replies
- Altera_Forum
Honored Contributor
You can have two images in flash. One contains the bootloader and a configuration able to reconfigur the flash memory, and a second one contains the application.
Have a look at application note 458 (http://www.altera.com/literature/an/an458.pdf) - Altera_Forum
Honored Contributor
--- Quote Start --- You can have two images in flash. --- Quote End --- I do not need two images According an458, l can build boot loader and application and,if i use EPCS memory, boot record not must contain boot loader and application(boot record) together. So i can buid boot loader and if i want to update the application, i just replace current application by a new one. Is it correct? - Altera_Forum
Honored Contributor
Yes you can do it this way too. But if you have only one image in flash and it gets screwed up when trying to update it, you could end up with an unbootable system that would require a JTAG connection to re-initialize.
- Altera_Forum
Honored Contributor
But i do not get what the advantage of two images. If i screwed up when trying to update,
l end up with bootable system, but the application, which is able to update is not on the flash and l can not try to update the application again. - Altera_Forum
Honored Contributor
If something goes wrong when you write in the flash, then on the next power up, the FPGA won't be able to load its configuration, and you will need a JTAG connection to reconfigure it.
If you have two images, and a problem occurs when flashing the application image, the FPGA can still configure itself with the first image and wait for instructions. It is then possible to correct the problem without a JTAG interface. - Altera_Forum
Honored Contributor
One of the two images is the bootloader and is "read only", the second one is the application (you can and should flash this one).
If you mess up the application, then the FPGA boots with the bootloader and lets you upload a new application image. There is no need to reconnect a JTAG cable to reprogram it, because the bootloader is still intact, just like your boss wanted. - Altera_Forum
Honored Contributor
daixiwen, i know you'll know the answer to this - i have the advanced bootloader built as in am458 but when the loader tries to write the new image over the interrupt vectors, the system wedges - how do you get around this? (http://alteraforum.com/forum/member.php?u=4443)
Chris - Altera_Forum
Honored Contributor
I never used the advanced bootloader, but I guess that disabling the interrupts before rewriting the table could be a good idea. I don't think the bootloader uses interrupts anyway.