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

Is it possible to load a small custom bootloader

Altera_Forum
Honored Contributor II
1,908 Views

together with FPGA configuration file? If I understand correctly a common way to boot FPGA configuration file and application software is: 

1. After power up a FPGA config file is loaded to internal RAM (through a config device). 

2. Then after NIOS reset it jump to the reset address (it must be in flash) and begins implementation of a bootloader from flash, which loads app. Software into RAM. 

3. When it’s loaded it jump to a start address of SW in RAM. 

 

Am I right? Sorry, if it’s stupid question. 

 

If I’m right, is it possible to load my own bootloader on a time when FPGA config is loaded to RAM? 

 

Thanks.
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
354 Views

You have it exactly right. That is how our flash boot-loader works for flash; for parallel flash, the boot-loader is placed at the beginng of flash, and the Nios reset vector pointing to the base of flash will cause the boot-loader to execute. The boot-loader examines the flash data (elf data) and copies data records to the appropriate area of memory before jumping to the application. 

 

...I suppose the thing I'm getting at is that we've already done the boot-loaders for you... if you want to view the source they can be found in components/altera_nios2/sdk/src/boot_loader_sources
0 Kudos
Altera_Forum
Honored Contributor II
354 Views

Jesse, (or anyone) 

 

Is there bootloader support for the Enhanced Config devices? In particular we're usning the EPC16 with a StratixI. 

I'm not the engineer on that part, but he was saying the CFI didn't support that chip. 

 

I did some looking and didn't see any examples for the EPC chips. 

 

Also, are there any examples or app notes that address Failsafe in field upgrading of both the hardware and firmware using the NiosII/IDE bootloader? 

 

Thanks, 

Ken
0 Kudos
Altera_Forum
Honored Contributor II
354 Views

And in addition  

May be someone know - is EPCS16 supported by new version of IDE flash programmer ?
0 Kudos
Altera_Forum
Honored Contributor II
354 Views

Alex: EPCS16 & 64 should be supported by the flash programmer in the next Nios II release. If you need something sooner (I know several people have mentioned trouble here on the forum) let me know and we can work something our in the 'untested IP' section. 

 

Ken: Currently we only support CFI-compliant flash and the EPCS (serial) flash devices for booting Nios. To be honest I am not very familiar with the EPC-series of devices. I do know that they have been used with Nios systems in the past, though. I would imagine that once the physical flash interface is worked out along with a programming method, the boot-loader could be ported over from our CFI-flash boot-loader easily (off the top of my head I cannot think of any significant changes required to it). The CFI boot-loader basically requires that you program in the .flash we create for you based on the project .elf (as this contains the address/data records that tell the boot-loader where to place things in memory). The boot-loader assembly source is available in the nios2/components/altera_nios2/sdk/src/boot_loader_sources folder -- look for the "cfi_bits" source file.
0 Kudos
Altera_Forum
Honored Contributor II
354 Views

Yes Jese  

for me it's very important !  

because i have made prototype board and sold to it EPCS4 instead EPCS16 using wires  

 

And now program grow up to 180Kb and will grow murch more in nearest future  

 

I don't know when will be new NIOS2 release with EPCS16 support 

 

I'm afraid that it cause to full stop of my project for undefinded time.  

 

And I don't know what I will tell to my direction when I lose ability to continue project. 

 

If it possible to make something with that problem, extremly need to do it ASAP.  

 

I can work like tester with peoples who make that support, because i have real project and real working board with EPCS16.  

I'm also write reqest to mySupport, too  

you can mail me to arexol<at>mail.ru and i also we can do phonenumber exange to make contacts more effective
0 Kudos
Altera_Forum
Honored Contributor II
354 Views

Thank you Jesse http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif  

In my board EPCS16 IS working  

I also write letter to you 

Thank you very murch again http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif )
0 Kudos
Altera_Forum
Honored Contributor II
354 Views

 

--- Quote Start ---  

originally posted by kenland@Feb 11 2005, 03:48 PM 

jesse, (or anyone) 

 

is there bootloader support for the enhanced config devices?  in particular we&#39;re usning the epc16 with a stratixi. 

i&#39;m not the engineer on that part, but he was saying the cfi didn&#39;t support that chip. 

 

i did some looking and didn&#39;t see any examples for the epc chips. 

 

also, are there any examples or app notes that address failsafe in field upgrading of both the hardware and firmware using the niosii/ide bootloader? 

 

thanks, 

ken 

--- Quote End ---  

 

 

Did you ever get the EPC16 to work and, if so, could you tell me how you did it? 

 

Thanks, 

 

Nick
0 Kudos
Altera_Forum
Honored Contributor II
354 Views

Hi Nick, 

 

I see now you *are* using an Advanced Config Device with the Cyclone. I saw Cyclone and automatically thought EPCS16. 

 

Can you read Orcan Schematic files? I could send you a working example on Stratix. 

 

As far as bootloader goes it was real easy in the end. Turns out you can build a simple app in NiosII IDE that will fit in 2KB. So we just burned this into HW and set our reset vector to point to it. It&#39;s a caveman simple bootloader that copies firmware out of flash and then jumps to it. We store our firmware as binary S-records that makes it even simpler because each 4 bytes tells you where to put it. Not super efficient but the EPC16 is huge. 

 

The EPC16 is not CFI compliant so your on your own, unless Altera has added support lately. 

 

If you&#39;ve got budget private email me and I can try to hook you up with the genious that made our EPC16 work including failsafe. 

 

(We did the bootloader ourselves because only we can understand how simple it must be http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif ) 

 

Let me know about the schems. I could also just take a screen snap and send .jpg. 

 

Ken
0 Kudos
Altera_Forum
Honored Contributor II
354 Views

Hi Ken, 

 

I didn&#39;t see your post until now. It looks like you can program the EPC16 entirely using the JTAG. You have to convert the application code and boot loader into .hex files and then run the utility called "Convert Programming Files" (you also include the .sof file).  

 

The only catch is that I have to write my own boot loader that loads the application code into my SDRAM. I&#39;m looking into that right now but, from what you said, it appears to be pretty simple. Where is that built-in bootloader app you mentioned? I haven&#39;t run across it.  

 

Thanks again, 

 

Nick
0 Kudos
Reply