Forum Discussion
Altera_Forum
Honored Contributor
19 years agoError in SDK Shell when I do FlashProgrammer
dear all,
I follow the web page-- http://nioswiki.jot.com/wikihome/operating...flashprogrammer (http://nioswiki.jot.com/wikihome/operatingsystems/flashprogrammer) I want Nios II to boot from EPCS device,so I do the folowing: 1.rebuild the kernel and get zImage_epcs_1102 2.in NIOS SDK Shell: elf2flash --input=zImage_epcs_1102 --output=zImage_epcs_1102.flash --location=0x00900800 --epcs --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_epcs.srec nios2-flash-programmer --epcs --base=0x00900800 zImage_epcs_1102.flash (0x00900800 is the base address of epcs controller in SOPC builder) (zImage_epcs_1102.flash is 2424 KB) BUT, I get this: Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Resetting and pausing target processor: OK Checksummed/read 1024kB in 140.2s Erased 1024kB in 15.4s (66.4kB/s) Programmed 970KB +54KB in 128.8s (7.9KB/s) Did not attempt to verify device contents Leaving target processor paused Anyone can give me some hints?2 Replies
- Altera_Forum
Honored Contributor
Here is an examle programming script created by Nios IDE, where the software is not a linux but uC-os II. Try modifying it.
There seems to be no need for a --location sting when you select to program using a boot loader, the --location string is probably only needed if you program some kind of filesystem or data into the flash. But I may be wrong, we only program Linux into cfi_flash. # ! /bin/sh# # This file was automatically generated by the Nios II IDE Flash Programmer.# # It will be overwritten when the flash programmer options change.# cd D:/bandrej/projects/lcd_and_onewire/software/lcd_and_onewire/Debug # Creating .flash file for the FPGA configuration $SOPC_KIT_NIOS2/bin/sof2flash --epcs --input=D:/bandrej/projects/lcd_and_onewire/lcd_display.sof --output=lcd_display.flash # Programming flash with the FPGA configuration $SOPC_KIT_NIOS2/bin/nios2-flash-programmer --sidp=0x00028980 --id=1554744427 --timestamp=1148379456 --epcs --base=0x00000000 lcd_display.flash # Creating .flash file for the project $SOPC_KIT_NIOS2/bin/elf2flash --epcs --after=lcd_display.flash --input=lcd_and_onewire.elf --output=epcs_controller.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_epcs.srec # Programming flash with the project $SOPC_KIT_NIOS2/bin/nios2-flash-programmer --sidp=0x00028980 --id=1554744427 --timestamp=1148379456 --epcs --base=0x00000000 epcs_controller.flash IzI - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by ziguowei@Nov 3 2006, 05:01 PM dear all,i follow the web page--
http://nioswiki.jot.com/wikihome/operating...flashprogrammer (http://nioswiki.jot.com/wikihome/operatingsystems/flashprogrammer)
i want nios ii to boot from epcs device,so i do the folowing:
1.rebuild the kernel and get zimage_epcs_1102
2.in nios sdk shell:
elf2flash --input=zimage_epcs_1102 --output=zimage_epcs_1102.flash --location=0x00900800
--epcs --boot=$sopc_kit_nios2/components/altera_nios2/boot_loader_epcs.srec
nios2-flash-programmer --epcs --base=0x00900800 zimage_epcs_1102.flash
(0x00900800 is the base address of epcs controller in sopc builder)
(zimage_epcs_1102.flash is 2424 kb)
but, i get this:
using cable "usb-blaster [usb-0]", device 1, instance 0x00
resetting and pausing target processor: ok
checksummed/read 1024kb in 140.2s
erased 1024kb in 15.4s (66.4kb/s)
programmed 970kb +54kb in 128.8s (7.9kb/s)
did not attempt to verify device contents
leaving target processor paused
anyone can give me some hints?
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=19136)
--- quote end ---
--- Quote End --- The programming is OK. The flash file is srec hex format, and take about twice the real binary size. If you want nios2 to boot from epcs, you have to run sopc builder, assign reset vector to epcs controller. then regenerate hardware and compile in quartus. Generate new sof. Next you can rebuild kernel, and program the flash. You MUST include sof in the epcs flash, as you DID NOT include it in your example. DO EXACTLY the steps in WIKI. If you use EPCS flash, find out and change the sof path and epcs base below. on nios2 sdk shell, cd arch/nios2nommu/boot# Creating .flash file for the FPGA configuration sof2flash --epcs --input=$SOPC_KIT_NIOS2/examples/verilog/niosII_cycloneII_2c35/standard/standard.sof --output=standard.flash# Programming flash with the FPGA configuration nios2-flash-programmer --epcs --base=0x02200000 standard.flash# Creating .flash file for the project elf2flash --epcs --after=standard.flash --input=zImage --output=epcs_controller.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_epcs.srec# Programming flash with the project nios2-flash-programmer --epcs --base=0x02200000 epcs_controller.flash