Forum Discussion
Altera_Forum
Honored Contributor
20 years agoU-BOOT !!!!!!!!!!!!
Hi http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wacko.gif ,
that u-boot is really driving me crazy. This is what I've done: 1- Compiled u-boot (got the .bin and the .srec) 2- Used flash programmer to program the .bin in flash (user zone) 3- Used quartus programmer to program standard.sof 4- Followed those instructions in the Using.txt But everytime I launch the nios2-console I get an error messageCommunication port must be specified.
Use openport <port> to configure the communication port. And I'm totally lost within that, It's by God bless that I succeded to write this topic Please rescue me52 Replies
- Altera_Forum
Honored Contributor
Hi,
I executed this command in the console: openport sld and I got connected (I think so at least) Then I executed the commands in Using.txt: 1> halt 2> load bin 0x02000000 u-boot.bin 3> exit Then [SOPC Builder]$ nios2-download -g u-boot Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Pausing target processor: OK Downloaded 99KB in 1.2s (82.5KB/s) Verified OK Starting processor at address 0x01FC0000 /cygdrive/d/u-boot-src/u-boot [SOPC Builder]$ Why it won't launch u-boot !!!!!!!!!!!!!!!!!!!!!! - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by mfm@Apr 28 2006, 02:08 AM hi,i executed this command in the console: openport sld
and i got connected (i think so at least)
then i executed the commands in using.txt:
1> halt
2> load bin 0x02000000 u-boot.bin
3> exit
then
[sopc builder]$ nios2-download -g u-boot
using cable "usb-blaster [usb-0]", device 1, instance 0x00
pausing target processor: ok
downloaded 99kb in 1.2s (82.5kb/s)
verified ok
starting processor at address 0x01fc0000
/cygdrive/d/u-boot-src/u-boot
[sopc builder]$
why it won't launch u-boot !!!!!!!!!!!!!!!!!!!!!!
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14773)
--- quote end ---
--- Quote End --- If you use jtag uart, you must run nios2-terminal. You have to disable jtag uart and use serial uart, if you want it auto start.
- Altera_Forum
Honored Contributor
Hi hippo,
thanks for your reply. <div class='quotetop'>QUOTE </div> --- Quote Start --- You have to disable jtag uart and use serial uart, if you want it auto start.[/b] --- Quote End --- And how to do that? - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by mfm@Apr 28 2006, 01:32 PM hi hippo,thanks for your reply.
<div class='quotetop'>quote
--- quote end ---
--- quote start ---
you have to disable jtag uart and use serial uart, if you want it auto start. --- Quote End --- And how to do that? <div align='right'><{post_snapback}> (index.php?act=findpost&pid=14796)</div> [/b] --- Quote End --- In kernel config, drivers->char->serial-> [*] Nios serial support [*] Support for console on Nios UART [ ] Altera JTAG UART support And in u-boot config, use serial uart instead of jtag uart. You can open a hyperterminal for uart in windows. As pointed out by scott, you can use auto start in u-boot. http://forum.niosforum.com/forum/index.php?showtopic=3779 (http://forum.niosforum.com/forum/index.php?showtopic=3779)
- Altera_Forum
Honored Contributor
Hi http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif ,
finally I make it http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/laugh.gif It's like I get stupid for a long while http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif Well, I wanna know how to download µClinux into flash memory for the first time. And as well, if somebody can tell me where to find details of the u-boot commands. Warm Regards - Altera_Forum
Honored Contributor
Hi MFM,
I'm glad you have things up-and-running and didn't commit suicide! ;-) > I wanna know how to download µClinux into flash memory for the first time. 1. erase the flash There are several ways to do this, the easiest to _understand_ is: ==> protect off all ==> erase 01000000 02ffffff 2. download the image --using tftpboot (e.g. download to linux.img memory location 0100_0000) ==> tftpboot 1000000 linux.img --using loadb (this uses kermit -- so you must start transfer after the following): ==> loadb 1000000 3. program the flash If you downloaded, say 2e_8348 bytes to address 0100_0000, you can simply "copy" the bytes to the flash memory ... u-boot is smart enough to know you're copying to flash. For example, to program flash memory at 0800_0000 ==> protect off all ==> cp.b 1000000 8000000 2e8348 > if somebody can tell me where to find details of the u-boot commands. See Section 5.9: http://www.denx.de/wiki/view/dulg/uboot (http://www.denx.de/wiki/view/dulg/uboot) Regards, --Scott - Altera_Forum
Honored Contributor
Hi Scott,
thanks a lot, I think I'm in the right way. BTW I want to ask you what gzip got to do with the mkimage, do we have to compress the kernel before uploading it to flash? Please explain that a little bit detailed. Warm Regards - Altera_Forum
Honored Contributor
Hi MFM,
> what gzip got to do with the mkimage, do we have to compress the kernel before > uploading it to flash? Compressing the kernel is up to you ... if you're operating in an embedded environment, it may become a requirement if you have limited non-volatile memory resources. When you generate for example, bzImage, the kernel is already compressed and includes its own decompression/relocation code. In this case you would tell u-boot that the image has compression 'None' since u-boot is not required to perform the decompression. If you choose to compress the kernel yourself (e.g. using gzip) then you should tell u-boot that the image compression is "gzip" -- then u-boot will decompress the kernel as it copies it to its load address. So why not just let the kernel make scripts generate a compressed image? Well, for uClinux/Nios-II it really doesn't matter since (the last time I looked), the uClinux kernel doesn't expect any parameters to be passed into it by the bootloader. In some other architectures (like PowerPC), however, the kernel expects parameters to be passed in (such as the kernel command line, a pointer to a compressed ramdisk image, etc) -- usually referred to as "residual data". When you build a compressed kernel image, the "boot" code that decompresses the kernel usually does not expect any bootloader parameters and instead hard codes the residual data. This eliminates some nice features in u-boot (most notably the kernel command line). So there's a long-winded explanation -- sorry for rambling. But here's the bottom line: The preferred u-boot way: Generate an uncompressed kernel image from the kernel make. Then compress it yourself with bzip/gzip and tell mkimage it's compressed. The Nios-II way: right now it doesn't matter. I do things the u-boot way ... but to be honest, it's only because of habit. If you're using buildroot, there's no need to do things the u-boot way since everything is a single image (with ramdisk) -- so just tell mkimage that compression = 'None'. Regards, --Scott - Altera_Forum
Honored Contributor
Hi Scott,
lots of thanks for you, your explanations make things look clearely. <div class='quotetop'>QUOTE </div> --- Quote Start --- So there's a long-winded explanation -- sorry for rambling[/b] --- Quote End --- Sorry for what http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/dry.gif I love that way to explain things we can't find in any document. Wish everybody in this forum explain things that way and not only give solutions in one or two lines. Thanks again. Warm Regards - Altera_Forum
Honored Contributor
Hi Scott,
well, I've done the following: - I programmed the u-boot.bin in flash memory using the flash programmer at the user space of the flash (0x400000). - u-boot works fine but when I type flinfo this is what I get
- when I try to save my variables with saveenv:==> flinfo Bank# 1: Size: 0 KB in 0 Sectors Sector Start Addresses: ==>
Besides, I feel confused between Flash and SDRAM adresses, I can't even decide what adresses to submit to mkimage, is the adress I've programmed u-boot at is suitable and how u-boot proceeds to boot a kernel and a FS images. All adresses matter is troubling me. So if you could explain me that I'm gonna be thankful. PS. I'm using a Stratix Pro 1s40 board Warm Regards==> saveenv Saving Environment to Flash... Error: start address not on sector boundary ==>