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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Linux fails when running from flash during boot

Altera_Forum
Honored Contributor II
1,225 Views

Hello, 

 

I have having trouble getting my Linux image to boot completely without a kernel panic. 

 

I have been running my Linux image from RAM and it has been stable for a long time.  

 

I am flashing the SOF file and my linux image using the nios2-flash-programmer-gui. The flashing of the SOF file works fine. When the board comes out of reset, it is clear that the FPGA is configured properly because my HW is functioning.  

 

I am using the nios2-flash-programmer-gui on Windows to convert my 'linux.initramfs.gz' image.  

 

This image works fine when run from RAM, however, I am seeing a couple different errors that result in kernel panic: 

 

- "no cpio magic" (this image) 

- "junk in compressed archive" (a couple other images) 

 

It seems like different images fail at different points, possibly based on size. I am curious if there is a conflict in the flash space. The image I am running is 3.6MB. 

 

If someone can help me, I would really appreciate it. Relevant logs are below. 

 

Thanks, 

Dave ... 

 

Screen capture of the console log when running from RAM (successful): 

 

http://davehenning.com/pages/nios_flash_caps/from_ram.jpg [part1] 

http://davehenning.com/pages/nios_flash_caps/from_ram2.jpg [part2] 

 

Screen capture of the console log when this same image fails from flash: 

 

http://davehenning.com/pages/nios_flash_caps/from_flash.jpg 

 

Screen capture of nios2-flash-programmer-gui setup: 

 

http://davehenning.com/pages/nios_flash_caps/gui_setup.jpg 

 

Screen capture of a different (slightly smaller) Linux image failing during boot from flash: 

 

http://davehenning.com/pages/nios_flash_caps/from_flash_old.jpg
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
517 Views

Which board are you using? Kinda have to know that to know anything about flash map stuff, right? :-) 

 

Cheers, 

 

-slacker
0 Kudos
Altera_Forum
Honored Contributor II
517 Views

I am using a custom board, but it is based very closely on the Cyclone III Dev Kit (EP3c120). 

 

We are storing the SOF and ELF info in 64 MB CFI Flash. 

 

One thing I have found is that when I run the code immediately after flashing it works fine (by setting the flag in the GUI). However, when I power cycle the board it always fails part way through loading Linux.
0 Kudos
Altera_Forum
Honored Contributor II
517 Views

I think I found out my problem after scouring the nios-dev list. Because I am using the MMU, I need to specify virtual addresses when I run elf2flash. Specifically, I have to OR 0xC0000000 with addresses I use for the base/end addresses. I am not able to get to my hardware just yet, but this post gives me hope as this guy has the same behavior I do (kernel panic on cold boot, okay from RAM). 

 

http://sopc.et.ntust.edu.tw/pipermail/nios2-dev/2010-march/003396.html 

 

I think the information I needed is in the "Addressing for Devices" section here: 

 

http://www.nioswiki.com/dasuboot 

 

Do others agree? 

 

Dave ...
0 Kudos
Reply