Forum Discussion

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

Running multiple images from EPCS (Factory & User)

Hi,

I am aware that there have been many topics on subjects similar to these. I have read many of them and tried to make use of the suggestions and advice offered there but am still having a few issues.

My aim is to have a fixed factory image at the base of the EPCS device which will allow a User image to be remotely programmed to a higher location in the EPCS. I have hardware and software images (based on AN429) which are able to write designs to the EPCS memory. I am now trying to configure the EPCS (and required custom bootloader) to load the user image and fall back to the remote configuration factory image if this fails.

I have created a combined hardware and software image for both the factory design (including bootloader) and the user image and programmed them to the EPCS. However when i reboot the FPGA the factory image is always loaded.

I think i have a reasonable understanding of the steps that are needed to achieve what I want but i may have misunderstood some parts or missed something out. If anyone could give me a few pointers that would be great. The steps i have taken are shown below

I am using a Stratix II EP2S60 on a custom PCB and Quartus 7.2 (fully licensed).

Thanks in advance,

Andy

--------------------------------

I have taken the following steps:
  • Remote Config Image - CPU reset vector is EPCS offset 0x0
  • User image - CPU reset vector is EPCS offset 0x0
  • Remote configuration image contains the SII remote update IP core created by jakobjones (showthread.php?t=3658)
  • I have created a custom bootloader using the trio_bootloader example from this topic (showthread.php?t=20623) by replacing the system.h file with my file from the Remote config sofwtare image and running the makefile
  • I have included the bootloader hex file in the Remote Config hardware project using the following assignment parameter:
    epcs:the_epcs|altsyncram:the_boot_copier_rom    INIT_FILE    trio_boot_loader_epcs.hex    Yes
. This corresponds to the name of the EPCS controller in the design
  • I have created a .flash file for the remote update image as follows:
sof2flash --input=hw_rem.sof --output=hw_rem.flash --epcs
elf2flash --input=sw_rem.elf --output=sw_rem.flash --after=hw_rem.flash --epcs --boot=trio_boot_loader_epcs.srec
cat hw_rem.flash sw_rem.flash > rem_image.flash
  • I have created a .flash file for a sample user image project (basic hardware, software flashes LEDs) as follow:
sof2flash --input=hw_usr.sof --output=hw_usr.flash --epcs
elf2flash --input=sw_usr.elf --output=sw_usr.flash --after=hw_usr.flash  --epcs --boot=trio_boot_loader_epcs.srec
cat hw_usr.flash sw_usr.flash > usr_image.flash
  • I have programmed the rem_image.flash image to the base of the EPCS and the usr_image.flash to the EPCS with an offset of 0x300000 (which equates to the line
    #define TRIO_USER_IMAGE_ADDRESS     0x300000
    in the bootloader.h part of the custom bootloader.

13 Replies