Forum Discussion
Altera_Forum
Honored Contributor
19 years ago --- Quote Start --- originally posted by slacker@Aug 8 2006, 02:41 PM andrew,
if i were you, i'd take a look at the algorithm used in:
$sopc_kit_nios2/components/altera_nios2/sdk/src/boot_loader_sources/boot_loader_epcs_bits.s.
yeah...it's assembly, but that might be what you want for a bootloader anyway, and it is pretty well commented...
cheers,
- slacker
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=17456)
--- quote end ---
--- Quote End --- Thanks, that's what I needed. Just got done looking at that and I remember looking at it before for different reasons a while back. It is indeed well documented and easy to follow. There's still some weirdness I don't understand related to the length of the bits but I think I'll be able to figure it out from here. After giving it a little thought I realize that stashing the old EPCS program isn't that useful since there's not much I can do after programming the new version. After the next reboot I'll either have a working config or not and the backed-up version of the EPCS content won't do me any good. I think eventually I'll write a two-stage bootloader where the first portion loads a known-good FPGA config with a minimal rescue monitor. That thing then can load the "real" FPGA config via a variety of methods, including EPCS or USB, which we have in our device using a FTDI chip. Thanks again, Andrew