Forum Discussion

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

Cyclone V: switching between application images using altremote_update

Hi all,

I am using a Cyclone V in a custom design and I have some issues while using the altremote_update megafunction:

I have 3 different images stored in an EPCS device:

  • factory image, stored at 0x000000

  • application image A, stored at 0x180000

  • application image B, stored at 0x300000

The factory image is never used in normal operation, it is only used as a fall back image when updating one of the application images has gone wrong.

I want to switch between application image A and application image B and back (the FPGA receives an external pulse signal when it should switch between the images). According to the Cyclone V Handbook, Figure 7-22, it appears that it is only possible to switch between the application images via the factory image, and not directly.

My problem is that I am only able to load one of the application images, and then switch back to the factory image. The factory image then loads the same application image as before, while the other application image is never loaded (so only image A is started every time, or only image).

In the factory image I am using logic to determine which application should be loaded. This logic is based on a Cyclone IV design, in which this setup works OK. In the Cyclone IV design, it is possible to use the READ_SOURCE port of the altremote_update megafunction to determine which boot address the previous image had been loaded from. The factory image can then use the address of the previously loaded image (for instance of image A), to switch to the other other image (in this case image).

For the Cyclone V, the READ_SOURCE port is not available in the altremote_update megafunction, so no information about previous configurations seems to be available. When I read the boot address (using the Page Select parameter) in in the factory image, it always reads back 0x000000, also when I try to write this address to another value in one of the application images.

Does anyone know whether it is possible in a Cyclone V design to still get information about the previously loaded application image? Or is the only solution to store that information in an external memory? Or is there another solution to this problem and am I trying to solve it in the wrong way?

Thanks in advance,

martenv

14 Replies

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

    Hi,

    Instead of using .rbf file, use .rpd file for ASx1/x4 configuration scheme. AS configuration scheme support .jic, .pof and .rpd file format. The .rpd file is a binary file for EPCQ/EPCS devices containing a binary bitstream of configuration data for FPGAs that support Active Serial configuration. The .rbf file is not supported in AS mode as there are option bits for AS mode is not available in the .rbf file.

    starting in Quartus II v13.1, you can generate a .rpd file which only contains the required configuration data (not the whole flash size).

    1.Open the File -> Convert Programming Files GUI.

    2.Select Programming file type: Programmer Object File (.pof) or JTAG Indirect Configuration file (.jic).

    3.Select the appropriate configuration device and Mode.

    4.Click SOF Data in the window at the bottom then Add File and add the SRAM Object file (.sof).

    5.Check the Create config data RPD box.

    6.Click Generate.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks.

    To this point, I have had similar experiences/observations with the .rbf and .rpd (bit reversal, compression on, no timing issues, no bit corruption that I can see.)

    In both cases, the board gets stuck in an infinite loop upon startup. The clock starts around 10MHz through initial config stages, then jumps up to about 90MHz for the quad-read. In this phase, the data is being read on 4 data lines from the flash device, but then goes back to the beginning of the boot cycle.

    Do you think it may have to do with some setting or checkbox when creating the file?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi all,

    I am using a Cyclone V in a custom design and I have some issues while using the altremote_update megafunction:

    I have 3 different images stored in an EPCS device:

    • factory image, stored at 0x000000

    • application image A, stored at 0x180000

    • application image B, stored at 0x300000

    The factory image is never used in normal operation, it is only used as a fall back image when updating one of the application images has gone wrong.

    I want to switch between application image A and application image B and back (the FPGA receives an external pulse signal when it should switch between the images). According to the Cyclone V Handbook, Figure 7-22, it appears that it is only possible to switch between the application images via the factory image, and not directly.

    My problem is that I am only able to load one of the application images, and then switch back to the factory image. The factory image then loads the same application image as before, while the other application image is never loaded (so only image A is started every time, or only image).

    In the factory image I am using logic to determine which application should be loaded. This logic is based on a Cyclone IV design, in which this setup works OK. In the Cyclone IV design, it is possible to use the READ_SOURCE port of the altremote_update megafunction to determine which boot address the previous image had been loaded from. The factory image can then use the address of the previously loaded image (for instance of image A), to switch to the other other image (in this case image).

    For the Cyclone V, the READ_SOURCE port is not available in the altremote_update megafunction, so no information about previous configurations seems to be available. When I read the boot address (using the Page Select parameter) in in the factory image, it always reads back 0x000000, also when I try to write this address to another value in one of the application images.

    Does anyone know whether it is possible in a Cyclone V design to still get information about the previously loaded application image? Or is the only solution to store that information in an external memory? Or is there another solution to this problem and am I trying to solve it in the wrong way?

    Thanks in advance,

    martenv

    --- Quote End ---

    Although this is an old thread...how do switch from the application image back to the factory image?

    I have tried to set ru_reconfig high (after setting AnF back to 0 and flash address back to 0x0), but the FPGA freezes and ru_reconfig gets stuck at high (as in POR).

    Br

    Marius