Forum Discussion
Altera_Forum
Honored Contributor
16 years agoDownload image ok, but boot fail
Hi Guys,
I need help... maybe someone have passed for this trouble. I try to run Linux on Nios II, obviously. My project is based on DE2_NET. Now I used a CYCLONE II EP2C8F256C8 in a custom board. First, I build the project for uCLinux and ran with sucess. After that, I add the TCMs in the SOPC and uClinux ran with success. So, after the system was validated, I went to LINUX with MMU. After some days, I can to program/download the image in a Flash with sucess. But the Linux don't boot. The stdout is a jtag_uart. When I run the “nios2-terminal”, nothing happen. Don't show error or some information... the terminal was blank, like this: [NiosII EDS]$ nios2-terminal nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Well, the Address Map is this: cpu.jtag_debug_module 0x08000000 - 0x080007fftimer_0 0x08400000 - 0x0840001f
sysid 0x08004d40 - 0x08004d47
jtag_uart_0 0x08004d50 - 0x08004d57
timer1 0x08004d00 - 0x08004d1f
sdram_0 0x02000000 - 0x02ffffff
epcs_controller 0x00100000 - 0x001007ff
tri_state_bridge_0
ext_flash 0x00000000 - 0x000fffff
onchip_memory2_0.s1 0x08000800 - 0x08000bff
onchip_memory2_0.s2 0x08400400 - 0x084007ff
the sdram have 8mbyte (pn: is42s16800d).
the flash memory have 8mbyte (pn: mp25p64).
the pll on the sopc builder is 100mhz for all peripherals. This is my script for download/program: ------------------------------------------------------------------------------------------------- nios2-configure-sof mylinux_top.sof
sof2flash --verbose --epcs --input=mylinux_top.sof --output=mylinux.flash
nios2-flash-programmer --mmu --epcs --base=0x00100000 mylinux.flash
elf2flash --mmu --epcs --after=mylinux.flash --input=zimage.initramfs.gz --output=epcs_controller.flash --boot=$sopc_kit_nios2/components/altera_nios2/boot_loader_epcs.srec
nios2-flash-programmer --mmu --epcs --base=0x00100000 epcs_controller.flash ------------------------------------------------------------------------------------------------- The result after run the “script” is: ------------------------------------------------------------------------------------------------ NiosII EDS]$ ./script Searching for SOF file: in . myLinux_top.sof Info: ******************************************************************* Info: Running Quartus II Programmer Info: Command: quartus_pgm --no_banner --mode=jtag -o p; myLinux _top.sof Info: Using programming cable "USB-Blaster [USB-0]" Info: Started Programmer operation at Wed May 26 09:35:39 2010 Info: Configuring device index 1 Info: Device 1 contains JTAG ID code 0x020B20DD Info: Configuration succeeded -- 1 device(s) configured Info: Successfully performed operation(s) Info: Ended Programmer operation at Wed May 26 09:35:40 2010 Info: Quartus II Programmer was successful. 0 errors, 0 warnings Info: Peak virtual memory: 55 megabytes Info: Processing ended: Wed May 26 09:35:40 2010 Info: Elapsed time: 00:00:05 Info: Total CPU time (on all processors): 00:00:03 26/05/2010 09:35:41 - (FINE) sof2flash: Starting Info: ******************************************************************* Info: Running Quartus II Convert_programming_file Info: Command: quartus_cpf --no_banner --convert --device=EPCS128 --option= myLinux.opt myLinux _top.sof myLinux.pof Info: Quartus II Convert_programming_file was successful. 0 errors, 0 warnings Info: Peak virtual memory: 69 megabytes Info: Processing ended: Wed May 26 09:35:48 2010 Info: Elapsed time: 00:00:07 Info: Total CPU time (on all processors): 00:00:05 Info: ******************************************************************* Info: Running Quartus II Convert_programming_file Info: Command: quartus_cpf --no_banner --convert myLinux.pof myLinux.rpd Info: Quartus II Convert_programming_file was successful. 0 errors, 0 warnings Info: Peak virtual memory: 67 megabytes Info: Processing ended: Wed May 26 09:35:54 2010 Info: Elapsed time: 00:00:06 Info: Total CPU time (on all processors): 00:00:05 26/05/2010 09:35:55 - (FINE) sof2flash: Done --mmu option was set true, EPCS virtual address is base + offset of 0xC0000000 Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Resetting and pausing target processor: OK Checksummed/read 60kB in 1.7s Erased 192kB in 2.0s (96.0kB/s) programmed 133kb +59kb in 5.1s (37.6kb/s) Did not attempt to verify device contents Leaving target processor paused --mmu option was set true, EPCS virtual address is base + offset of 0xC0000000 Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Resetting and pausing target processor: OK Checksummed/read 58kB in 1.5s Erased 3712kB in 38.2s (97.1kB/s) programmed 3655kb +57kb in 128.4s (28.9kb/s) Did not attempt to verify device contents Leaving target processor paused --------------------------------------------------------------------------------------- After power off/on custom board, I call the terminal: [NiosII EDS]$ nios2-terminal nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Please, suggestions... Thanks in advance. Fernando Andrade
16 Replies
- Altera_Forum
Honored Contributor
More one question:
Wich addresses should I put in Linux Kernel Configuration in these options: (0x????????) offset address for uimage.flash(0x????????) link address offset for booting Thanks
- Altera_Forum
Honored Contributor
did you checked your cpu reset vector ? does it point on your EPCS at the correct address ?
- Altera_Forum
Honored Contributor
Normaly you have to boot on your SDRAM so you don't need to change your kernel configuration...
- Altera_Forum
Honored Contributor
--- Quote Start --- did you checked your cpu reset vector ? does it point on your EPCS at the correct address ? --- Quote End --- The Reset Vector point to 0x00000000 (ext_flash + offset = 0x0) When I download uCLinux in this SOPC (without MMU) the system ran perfectly. In this case, the Reset vector point to same address. I'll try change for epcs... Thanks - Altera_Forum
Honored Contributor
If I download the Linux image via "nios2-download" command line, the result is:
[NiosII EDS]$ nios2-download -g zImage.initramfs.gz Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Pausing target processor: OK Initializing CPU cache (if present) OK Downloaded 3655KB in 2.2s (1661.3KB/s) Verified OK starting processor at address 0xc2500000 assertion "m_state == STATE_DEBUG" failed: file "nios2debug.cpp", line 538 5 [sig] nios2-gdb-server 3532 c:\altera\90\nios2eds\bin\nios2-gdb-server.e xe: *** fatal error - called with threadlist_ix -1 /cygdrive/c/altera/90/nios2eds/bin/nios2-download: line 594: 3532 Hangup nios2-gdb-server --go --tcpport none --write-pid ./nios2-download.pid ./zImage.initramfs.gz.srec - Altera_Forum
Honored Contributor
I think you might be mixed up in the flash usage. You programmed the sof and zImage to epcs flash. So you should set reset vector to epcs controller in sopc builder.
ext_flash means cfi flash, in your address map , it is only 1MB? If you want reset vector to ext_flash, you should program the zImage to ext_flash. - hippo - Altera_Forum
Honored Contributor
Thanks Actris and Hippo!!!
I change the reset vector to epcs_controller. I program the image into Flash memory and run the nios2-terminal. Now, the boot freeze after some initializations... This is a good new if we compare with old result. :cool: This is the new Results for "zImage.initramfs.gz": [NiosII EDS]$ nios2-terminal nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Uncompressing Linux... Ok, booting the kernel. Linux version 2.6.30-00514-ge7e25ac-dirty (tcb@vostromdv) (gcc version 4.1.2)# 4 0 Wed May 26 18:13:07 BRT 2010 console [early0] enabled Early printk initialized Linux/Nios II-MMU init_bootmem_node(?,0x24db, 0x2000, 0x3000) free_bootmem(0x24db000, 0xb25000) reserve_bootmem(0x24db000, 0x200) Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064 Kernel command line: NR_IRQS:32 PID hash table entries: 64 (order: 6, 256 bytes) Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) We have 12288 pages of RAM Memory available: 11256k/4969k RAM, 0k/0k ROM (1750k kernel code, 3218k data) Calibrating delay loop... 49.25 BogoMIPS (lpj=246272) Mount-cache hash table entries: 512 net_namespace: 296 bytes NET: Registered protocol family 16 init_BSP(): registering device resou rces bio: create slab <bio-0> at 0 NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 512 (order: 0, 4096 bytes) TCP bind hash table entries: 512 (order: -1, 2048 bytes) TCP: Hash tables configured (established 512 bind 512) TCP reno registered NET: Registered protocol family 1 This is the new Results for "linux.initramfs.gz": [NiosII EDS]$ nios2-terminal nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Linux version 2.6.30-00514-ge7e25ac-dirty (tcb@vostromdv) (gcc version 4.1.2)# 4 0 Wed May 26 18:13:07 BRT 2010 console [early0] enabled Early printk initialized Linux/Nios II-MMU init_bootmem_node(?,0x24db, 0x2000, 0x3000) free_bootmem(0x24db000, 0xb25000) reserve_bootmem(0x24db000, 0x200) Built 1 zonelists in Zone order, mobility grouping off. Total pages : 4064 Kernel command line: NR_IRQS:32 PID hash table entries: 64 (order: 6, 256 bytes) Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) W²???????? have 12288 pages of RAM Memory available: 11256k/4969k RAM, 0k/0k ROM (1750k kernel code, 3218k data"??? ??????????????????????????????????????????????? Calibrating delay loop... 49.25 BogoMIPS (lpj=246272) Mount-cache hash table entries: 512 net_namespace: 296 bytes NET: Registered protocol family 16 init_BSP(): registering device resources bio: create slab <bio-0> at 0 NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 512 (order: 0, 4096 bytes) TCP bind hash table entries: 512 (order: -1, 2048 bytes) TCP: Hash tables configured (established 512 bind 512) TCP reno registered NET: Registered protocol family 1 kernel panic - not syncing: no cpio magic Thanks - Altera_Forum
Honored Contributor
I see you have 16MB, not 8MB. Please config "boot link offset" to 0xa00000. That means zImage will start from top 5MB, and won't collide with kernel.
- Hippo - Altera_Forum
Honored Contributor
I change to 0x00a00000. The result was the same.
In the "niosii fpga configuration (custom_fpga)" screen, Wich the value should I put on "(0x______) offset address for uImage.flash"? Now the values are: [*] hw mul support[ ] hw mulx support
[ ] hw div support
(0x1c80000) offset for uimage.flash
[*] passed kernel command line from u-boot
(0x00a00000) link address offset for booting
[ ] support for dma ...
[ ] gpio interface
<> enable niosii pio driver
[*] activate early kernel debugging
... Thanks a lot, Hippo!
- Altera_Forum
Honored Contributor
(0x00a00000) link address offset for booting is correct.
Please skip the flash programmer at the moment. Please use nios2-download during the test. cd uClinux-dist make menuconfig make nios2-configure-sof your_system.sof nios2-download -g images/zImage - Hippo