- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello:
I've got a NIOS 2 running out of DRAM. So I plan to put the configuration into epcs (done) and put the application program into a FLASH (also done). I used elf2flash to create the srec filt that I loaded using a serial port bacause that's the way it will be done in the field. I ran elf2flash --verbose --log=log.txt --input-Project.elf --output-ProjectOut.srec --base=0x09000000 --end=0x09FFFFFF --reset=0x08000000 -flash=U23 --boot=boot_loader_cfi.srec All this ran OK and I found the boot_loader data infront of the applicatio code as expected. My question are: 1. Is this the proper boot loader to use. 2. The sof file does not use a cfi interface but the flash device works since I can store data and erase blocks. 3. My flash interface is 16 bits wide but the boot loader looks like it's working 8 bits at a time. 4. How can I create a custom bot loader? Thanks GeorgeLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ooops
Type in this line. should be --base=0x08000000 not --base=0x09000000 I ran elf2flash --verbose --log=log.txt --input-Project.elf --output-ProjectOut.srec --base=0x08000000 --end=0x09FFFFFF --reset=0x08000000 -flash=U23 --boot=boot_loader_cfi.srec- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For starters, I'd take a look at the boot_loader_sources directory:
<nios2_install_dir>/components/altera_nios2/sdk/src/boot_loader_sources
Cheers, - slacker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK i've done that and it looks like a fine boot loader moving 8 bits at a time.
But is this the correct one to use? How do I/you/anyone know? Did that source generated the srec file of the same name? thanks george- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, those are the sources for the CFI and EPCS based boot loaders. There's even a Makefile, in this directory, which will build these sources, for you, so you can play around with the source easily....
Personally, I would backup the existing sources prior to doing any serious experiementing, however. - slacker- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Slaker
Are you an Altera person saying that this is the correct loader or just typical user like me. The reason I ask is that this is a tedious, confusing and time consuming step in the process and I really don't want to spend days just to find out it's not the correct approach. Please, Please don't take offense since none is intended. It's the pressures of trying to ship a unit. Thanks George- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I ran the makefile on the source that came with the NIOS2 kit. I'm using 1.0.
The srec file that was produced matches the srec file Altera provided. So..............Has anyone used that with sucess??? George- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
George,
Most anyone who's programmed flash (either CFI or EPCS) on one of Altera's dev. kits has used these bootloaders. They are what's used to boot the "factory" designs. In the case of the EPCS device, the bootloader gets placed into a small onchip memory that's part of the epcs_controller. When booting from a CFI flash, the bootloader gets prepended to whatever application code you'd like to copy from the flash into volatile memory. The code is pretty well commented, as well! Cheers, - slacker P.S.: Yes, I work for Altera.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well I've confirmed with Altera Technical that that is the correct boot loader program.
I've programmed the epcs device and I've programmed my flash device with the loader and application code(s). But on porwe up the epcs configures the FPGA but no code is executed. It seems that the SDRAM 0x400 0000 to 0x7FF FFFF (spacing for clarity) in connected to both the NIOS instruction and data masters. But the flaos 0x800 0000 to 0x9FF FFFF is only connected to the NIOS data master. How can I get the NIOS to execute code from the FLASH. Reset vector is pointing to FLASH. gm- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
George,
Are you sure you programmed the application code into the EPCS? Your reset vector is pointed to the epcs_controller, right? You ensure that all of the rest of the linker sections point to volatile memory, as well. Additionally, you can't run code from the EPCS flash and you probably wouldn't want to anyway. (very slow) The epcs_controller has a small onchip memory which is filled with the epcs-flavored bootloader when the system is generated and compiled. The only caveat I would add to this is that this particular flow will not work for Stratix II and EPCS devices. Regards, - slacker- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been speaking with Altera Regional support and..............
It looks like the NIOS instruction master can't access the FLASH. I have a large SDRAM 0x400 0000 to 0x7FF FFFF that is connected to the NIOS instruction and data master buses. This is working properly. And a FLASH 0x800 0000 to 0x9FF FFFF connected to an avalon tristate bus. That tri state bus controller is also connected to both the NIOS instruction and data masters. I can access the data in flash reading locations as data. I CAN NOT access the data in flash using DMA transfers. The DMA transfers were selected to show up any weekness in the FLASH interface. I also believe that the DMA transfers perform more like trying to fetch instructinos from FLASH; reads after reads with one clock delat between them. THe Logic Analizer shows the data available out of the FLASH to the FPGA. But no Data is transfered into the SDRAM. I've concluded that the FLASH-Tristate interface is not working properly. But why is the real question. GM- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To close this topic.
That boot loader was the correct one to use. The tools put together the proper load sequence and operate as advertized. The 8 bit transfer in the boot loader is fast enough. I had several problems all of which interfeared with proper operation. 1.) I did a FLASH erase as a seperate process to loading code. My erase routine only erased every other block. I could not pass this off as a feature. SO I fixed it. 2.) The FLASH devices were connected to the tri-state bus. That bus was not connected to the instruction and data master on the NIOS side. 3.) The DMA transfers have not been tested since the 8 bit transfers are fast enough.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by gmm50@Oct 25 2005, 08:48 AM 2.) the flash devices were connected to the tri-state bus. that bus was not connected to the instruction and data master on the nios side. --- Quote End --- Yeah, that's one of those mistakes everyone makes once and never again. BTW, the rationale for 8-bit transfers is that the various blocks of data in the program may not necessarily have sizes that are multiples of 2 or 4 bytes. It's barely alluded to in the bootloader source comments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"Yeah, that's one of those mistakes everyone makes once and never again."
I sure hope so........... I thought an image aws an image so 16 bits would be 2x as fast as 8 bits??? gm- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by gmm50@Oct 26 2005, 03:44 PM i thought an image aws an image so 16 bits would be 2x as fast as 8 bits??? --- Quote End --- That's correct. But reading 16 (or even 32) bits at a time would require 16 (or 32) bit alignment, which is not guaranteed by the toolchain. If the .data segment had an odd size (as it might if the last thing in it is an odd-sized char array, or maybe even just a bool or char global variable), things would get difficult fast. Generally speaking, though, initialization code runs only once, and isn't usually worth optimizing for speed like that.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page