Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

Quickest way to test remote configuration with a EPCS

Altera_Forum
Honored Contributor II
1,144 Views

Hello all, 

 

Once again my laziness gets the best of me and here I am. 

 

I have created two FPGA/NIOS loads, one factory and one application. 

The factory load has a remote reconfig controller, so I can play with  

this functionality. In the long run I wat to be able to download the application load, but for now all I want to do is get both loads in the 

EPCS and initiate a reconfig.  

 

I know the factory will start at EPCS location 0 and thus the boot for nios should be pretty staright forward. Now the application load I am not so sure . Here are a few questions: 

 

1) If all I want to do is get a bootable factory and application load(FPGA / NIOS) into the EPCS is the easiest method to use the convert programming files in QII and build up a multi design image? or should I stick with the scripts and the flash programmer? 

 

2) for the application bootloader, do I have to customize the bootloader code. I have read this on other threads, but did not know if their was a simpler method.  

 

I know you can direct the offset by using scripting i.e. 

# Now get the flash base address (0x400000) inserted in the image 

echo ">> Adjusting base address for combined image..." 

nios2-elf-objcopy --target srec --change-addresses 0x400000 hello_led_comb.flash hello_led_pg4.flash 

 

but I believe this simply locates the flash rather than alter the bootloaders fetch location. 

 

Thanks in advance for any help.
0 Kudos
10 Replies
Altera_Forum
Honored Contributor II
473 Views

 

--- Quote Start ---  

Hello all, 

 

Once again my laziness gets the best of me and here I am. 

 

I have created two FPGA/NIOS loads, one factory and one application. 

The factory load has a remote reconfig controller, so I can play with  

this functionality. In the long run I wat to be able to download the application load, but for now all I want to do is get both loads in the 

EPCS and initiate a reconfig.  

 

I know the factory will start at EPCS location 0 and thus the boot for nios should be pretty staright forward. Now the application load I am not so sure . Here are a few questions: 

 

1) If all I want to do is get a bootable factory and application load(FPGA / NIOS) into the EPCS is the easiest method to use the convert programming files in QII and build up a multi design image? or should I stick with the scripts and the flash programmer? 

 

2) for the application bootloader, do I have to customize the bootloader code. I have read this on other threads, but did not know if their was a simpler method. 

--- Quote End ---  

 

The bootloader installed with the EPCS component knows only how to load the NIOS II software that follows the factory configuration (at 0). If you program an "update" NIOS II application, say, half way into the EPCS, you can load it from the running factory version by copying it over the factory version (hint: use code in on-chip memory like the bootloader does). The hard part is when the update runs, it needs to know that it's the update so it doesn't try to copy itself infinitely. By the way, you have this booting problem even if you use the ALT_REMOTE_UPDATE component to stored a second configuration in EPCS. 

 

Bill
0 Kudos
Altera_Forum
Honored Contributor II
473 Views

Bill, 

 

Thanks for the response. I managed to get the AS remote reconfiguration working with some support from Altera. 

 

Thanks for the feedback, 

 

John
0 Kudos
Altera_Forum
Honored Contributor II
473 Views

Hi John, 

 

Is there a better solution or updated bootloader that loads the NIOS II software that's stored right after the configuration of the update version of the file? I'm hoping there's an easy solution to updating both the configuration and software. 

 

Thanks, 

Bill
0 Kudos
Altera_Forum
Honored Contributor II
473 Views

Bill, 

 

I started out with a plan of turning compression off the FPGA load, thus fixing the location of the software load. That said I was unable to get a consistent load size from compile to compile. The few loads I checked always appeared to deviate a few bytes. It is possible I am missing something here, so perhaps someone else will chime in. 

 

I ended up with a Fpga image located at a fixed location and then the software image located at a fixed position someways down. I only need one application image so this works in my application. I agree with you that the standard EPCS bootloader should be available and better yet parameterizable, without having to delve into assembly language.  

 

It seems to me that this should be a built in feature of SOPC i.e. I designate a onchip bootrom and then tell it where the FPGA image will start. The tool then creates the bootloader that will automatically find the software image ala epcs flash loader and away we go. From what I can tell the only real differnece is where the FPGA image will begin, other than that the bootloader should be identical. Perhaps, christmas will come early and this feature will be stuck in the next release. 

 

 

regards, 

 

john
0 Kudos
Altera_Forum
Honored Contributor II
473 Views

Hi John, 

 

 

--- Quote Start ---  

I started out with a plan of turning compression off the FPGA load, thus fixing the location of the software load. That said I was unable to get a consistent load size from compile to compile. The few loads I checked always appeared to deviate a few bytes. It is possible I am missing something here, so perhaps someone else will chime in. 

--- Quote End ---  

 

I placed the configuration and firmware at a fixed address, and for me, the configuration was a fixed size so I knew the start of the application. I was able to do the copy from within the application and restart the program. I had to use a flag in onchip memory so I wouldn't be in an infinite loop copying after every restart. Copying code to the same place I was running was tricky too but I got it working. 

 

--- Quote Start ---  

 

I ended up with a Fpga image located at a fixed location and then the software image located at a fixed position someways down. I only need one application image so this works in my application. I agree with you that the standard EPCS bootloader should be available and better yet parameterizable, without having to delve into assembly language. 

 

It seems to me that this should be a built in feature of SOPC i.e. I designate a onchip bootrom and then tell it where the FPGA image will start. The tool then creates the bootloader that will automatically find the software image ala epcs flash loader and away we go. From what I can tell the only real differnece is where the FPGA image will begin, other than that the bootloader should be identical. Perhaps, christmas will come early and this feature will be stuck in the next release. 

--- Quote End ---  

With the help of my Altera FAE I've gotten a description of what is lacking to someone at Altera who hopefully can make progress on this. We'll see. I agree and mentioned the points you have stated here - it should work for configuration and the application accompanying the configuration. 

 

 

Bill
0 Kudos
Altera_Forum
Honored Contributor II
473 Views

Did you search the forum? I've posted some pretty in-depth instructions on how to accomplish what you're doing. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
473 Views

Hi Jake, 

 

 

--- Quote Start ---  

Did you search the forum? I've posted some pretty in-depth instructions on how to accomplish what you're doing. 

--- Quote End ---  

 

 

Yes, I saw what you had done. It wasn't compatible with the Cyclone III (it's Remote Update is different, although not insurmountable). 

 

The best solution is to try get Altera to see how important remote update is (for the application, not just configuration) and provide a solution out of the box. Although I could easily handle the assembly code, a good many developers cannot. 

 

Thanks, 

Bill
0 Kudos
Altera_Forum
Honored Contributor II
473 Views

Well rather than wait for Altera to produce something (which may never happen) they have provided this: 

http://www.altera.com/literature/an/an458.pdf 

 

But I assume you've seen it already.  

 

Perhaps if I get some free time I'll write a generic bootloader that people can configure and use. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
473 Views

Yes, I've seen an458 and AFAICT it provides a boot copier but still doesn't address the EPCS bootloader which is always going to load the image in the first part of EPCS, not the image following the configuration the remote update loaded. 

 

Can it be generic? Without and without ALT_REMOTE_UDDATE? How about providing an entry point for an application to call passing an address to load an application from? I looked at doing this - calling into the bootloader with registers set after it located the start of software but I wasn't sure it would work. 

 

Thanks, 

Bill
0 Kudos
Altera_Forum
Honored Contributor II
473 Views

I was thinking generic in the sense that code would be included to support multiple device families and you simply just use a macro to define which family you are working with. We could also use macros to indicate the address of the "Application" image. Mine basically does this but as you've indicated, I tuned it for Stratix II GX. Though I suppose it wouldn't take long to tune it for Cyclone III or some other family. 

 

Jake
0 Kudos
Reply