- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I meet a weird problem on building image. The source I use is uClinux-dist-20060803 with patch v18. There are also some custom applications added into the image. All compiles are done without any error and the image can be generated successfully. When I download the generated image into target board, some generated images will cause problems. The error message is below: Uncompressing Linux... ERROR length error -- System halted Here are the stpes I build the image: make clean make vendor_hwselect SYSPTF=~/project/ptf/nios2.ptf make romfs make make make linux image When the problem occurs, I do the above steps again and again without any code modification. Sometimes I can get a workable image(it can enter shell mode and execute all applications on the initramfs). It is really really weird. Use same sources/configurations, but get different results. Although I can get the good image finally, but it does spends me lots of time on development. Is there anyone can explain me what's going on ?...Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
removed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
removed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I had the same problem when I tried to upload my image to the board. It worked with the nios2download program, but it did not work sometimes with my own bootloader. My bootloader loads the image from a serial flash into DDR by using a small program in a Mk4 block of the FPGA. The problem turned out to be byte alignment. Sometimes the zImage was even length then it worked, but when it was odd length it didn't. To solve the problem I added 1 byte to the binary to make it even length, then it always worked. Mybe your problem is similar to mine. Note: I converted the elf format to binary to store it in my serial flash.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you are right, nacide.
although my problem happens with nios2-download program, it is also the byte alignment issue. after tracing the booting process, i found that if the size of generated vmlinux.bin.gz (in linux-2.6.x/arch/nios2nommu/boot/compressed/) is odd, i will get "length error" during uncompressing kernel. it is because that in function gunzip (linux-2.6.x/lib/inflate.c), it always gets wrong length value when size of vmlinux.bin.gz is odd. orig_crc[23:00] is correct, but orig_crc[31:24](the last byte we get) is wrong. the length value in zImage is correct, but it gets wrong value during uncompressing. what i did is trying to add some spaces at the end of .data section in linux-2.6.x/arch/nios2nommu/boot/compressed/vmlinux.scr in order to make sure that we can get correct orig_crc[31:24] byte without byte alignment issue.SECTIONS
{
.data : {
input_len = .;
LONG(input_data_end - input_data) input_data = .;
*(.data)
input_data_end = .;
LONG(0) /* for byte alignment issue */
}
}
now i can always get the workable image after that patch. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif here are steps i do to generate image. 1. make clean vendor_hwselect SYSPTF=~/project/ptf/nios2.ptf 2. make romfs 3. make 4. make linux image
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great. I updated the nios2 patches to ver 21. Please check if it works for odd size gz.
SECTIONS
{
.data : {
input_len = .;
LONG(input_data_end - input_data) input_data = .;
*(.data)
. = ALIGN(4);
input_data_end = .;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, it works.
thanks for your nios2 patch, hippo. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page