Altera_Forum
Honored Contributor
16 years agoFlash programming for DE2-70
Hello Friends,
This is a common problem here in the forum. However, Ihaven't been able to make heads nor tails out of it. I'm trying to program the sof file by EPCS and the OS in the CFI Flash. I'm running the system in a DE2-70 board with a Nios II/f processor. Below is my configuration for SOPC ext_flash base=0x00000000 end=0x007fffff epcs_controller base=0x00e05800 end=0x00e05fff on the cpu SOPC: reset vector offset 0x0 in ext_flash Then I compile the project. Everything seems fine. I am first trying to boot the default image to uclinux, because when I tried to change some things in SOPC builder, I had to rebuild almost everything, so I decided to go step by step. I built the default configuration BUT added MTD suport following: http://www.nioswiki.com/mtd QUestion 1) If I only have the CFi flash, do I only need to enable that one? No need for SPI FLash or NAND flash, right?
# ### To enable MTD
Memory Technology Device (MTD) support --->
--- Memory Technology Device (MTD) support
Debugging (NEW)
MTD concatenating support (NEW)
MTD partitioning support
RedBoot partition table parsing (NEW)
Command line partition table parsing (NEW)
TI AR7 partitioning support (NEW)
*** User Modules And Translation Layers ***
Direct char device access to MTD devices
-*- Common interface to block layer for MTD 'translation layers
TI AR7 partitioning support (NEW)
*** User Modules And Translation Layers ***
Direct char device access to MTD devices
-*- Common interface to block layer for MTD 'translation layers
Caching block device access to MTD devices
# ### To enable CFI flash
RAM/ROM/Flash chip drivers --->
Detect flash chips by Common Flash Interface (CFI) probe
Detect non-CFI AMD/JEDEC-compatible flash chips (NEW)
Flash chip driver advanced configuration options (NEW)
Support for Intel/Sharp flash chips# for neek
Support for AMD/Fujitsu flash chips# others
Support for ST (Advanced Architecture) flash chips (NEW)
Support for RAM chips in bus mapping (NEW)
Support for ROM chips in bus mapping (NEW)
Support for absent chips in bus mapping (NEW)
Mapping drivers for chip access --->
Support non-linear mappings of flash chips (NEW)
<*> Flash device in physical memory map
Physmap compat support
Generic uClinux RAM/ROM filesystem support (NEW)
Map driver for platform device RAM (mtd-ram) (NEW)
# ### To enable flash filesystem support
File systems -->
Miscellaneous filesystems --->
Journalling Flash File System v2 (JFFS2) support
# ##### end of kernel config
# ### user application config
Flash Tools --->
--- MTD utils
mtd-utils
eraseall
I didn't quite understand what modifications should be made in linux-2.6/arch/nios2/kernel/config.c but I guess none since I am using a Cyclone 2 chip. After that, I follow number 1 in: http://www.nioswiki.com/operatingsystems/uclinux/flashprogrammer I program up to the HW and it works correctly. But when I try to create the CFI Flash image I get the following:
$ elf2flash --base=0x00000000 --end=0x007fffff --reset=0x0 --input=/home/pancho/nios2-linux/uClinux-dist/images/zImage --output=ext_flash.flash --boot=/opt/altera8.1/nios2eds/components/altera_nios2/boot_loader_cfi.srec
~/nios2-linux/uClinux-dist
$ nios2-flash-programmer --base=0x0 ext_flash.flash
Using cable "USB-Blaster ", device 1, instance 0x00
Resetting and pausing target processor: OK
Checksummed/read 28kB in 0.5s
Erased 1472kB in 5.3s (277.7kB/s)
Programmed 1445KB +27KB in 14.2s (103.6KB/s)
Device contents checksummed OK
Leaving target processor paused
~/nios2-linux/uClinux-dist
$ nios2-terminal
nios2-terminal: connected to hardware target using JTAG UART on cable
nios2-terminal: "USB-Blaster ", device 1, instance 0
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)
And it never boots. I am using DE2_70_NET example. But I don't think there are hardware problems over there in any connections. If someone has used it please let me know if he/she was able to use it 'as is'. Hope this information is enough to see the problem. I can post any information that might be neccesary. Thank you all Francisco