Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Format of config data in EPCS?

I'm working on in-system programming of the EPCS via the NIOS EPCS controller component. I think I understand how to convert the files, upload them to my design and burn them into the EPCS.

What I don't understand is how to tell how long the existing config data in the EPCS is. I'd like to stash the existing config data before burning over it but I don't know how to figure out the length of the existing data. I have some vague recollection of reading that the config data always starts at addr 0 and ends with a large number of 0 bytes but I can't find that document any more.

Can someone tell me how the config data is formatted and whether there is some kind of header where I can read the length? If I do have to scan through all the data to find the terminating 0x00 bytes, how many terminating bytes are there?

Using Cyclone 1c12 with EPCS4.

Thanks much,

Andrew

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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&#39;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&#39;s still some weirdness I don&#39;t understand related to the length of the bits but I think I&#39;ll be able to figure it out from here.

    After giving it a little thought I realize that stashing the old EPCS program isn&#39;t that useful since there&#39;s not much I can do after programming the new version. After the next reboot I&#39;ll either have a working config or not and the backed-up version of the EPCS content won&#39;t do me any good.

    I think eventually I&#39;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