Forum Discussion
Altera_Forum
Honored Contributor
21 years agoU-Boot : 'make' problem
Hello,
I'm trying to compile a Uboot package in order to upload the .srec file to the NIOSII Cyclone board. My problem is that "make" command terminates with this message :(...)
make: Entering directory `/cygdrive/c/altera/kits/nios2/examples/uboot/u-boot
-1.1.2/post/cpu'
make: `.depend' is up to date.
make: Leaving directory `/cygdrive/c/altera/kits/nios2/examples/uboot/u-boot-
1.1.2/post/cpu'
make -C tools all
make: Entering directory `/cygdrive/c/altera/kits/nios2/examples/uboot/u-boot
-1.1.2/tools'
gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x018e0000 -DUSE_HOSTCC -O
-c -o img2srec.o img2srec.c
In file included from /usr/include/sys/unistd.h:9,
from /usr/include/unistd.h:6,
from img2srec.c:61:
/usr/include/sys/types.h:106: conflicting types for `int8_t'
/usr/include/stdint.h:38: previous declaration of `int8_t'
/usr/include/sys/types.h:108: warning: redefinition of `int16_t'
/usr/include/stdint.h:39: warning: `int16_t' previously declared here
/usr/include/sys/types.h:110: warning: redefinition of `int32_t'
/usr/include/stdint.h:40: warning: `int32_t' previously declared here
/usr/include/sys/types.h:112: warning: redefinition of `int64_t'
/usr/include/stdint.h:45: warning: `int64_t' previously declared here
make: *** Error 1
make: Leaving directory `/cygdrive/c/altera/kits/nios2/examples/uboot/u-boot-
1.1.2/tools'
make: *** Error 2 It seems that these variables are overlaping each others. (I've entered "make dk1c20_config" before and everything went ok) Thanks alot, Max18 Replies
- Altera_Forum
Honored Contributor
Hi Max,
This looks like the sources directly from sourceforge.net ... this tree assumes you have an appropriately configured native gcc and shell environment -- which doesn't come with the nios2 toolchain 8-P The easiest thing to do is get the source tree from http://www.pysent.com/download (http://www.pysent.com/download) -- this tree has certain "nips & tucks" made to build cleanly with the default nios2 toolchain (under cygwin) -- and it's more up-to-date than the sourceforge tree (WRT Nios-II, the sourceforge tree has been lagging by several months). Otherwise, you'll either need to start editing the Makefiles (and some other files), or build the nios2 toolchain in a standard unix environment (not cygwin). If you're determined to edit Makefiles, the first thing you'll want to do is disable building the "tools" directory by removing it from the SUBDIRS make variable -- you won't need any of the targets from tools to download an srec. Regards, --Scottmake: Entering directory `/cygdrive/c/altera/kits/nios2/examples/uboot/u-boot-1.1.2/tools' - Altera_Forum
Honored Contributor
Thanks for your fast answer,
But it looks like your link is broken http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif - Altera_Forum
Honored Contributor
Sorry, I fat-fingered the URL ... it should be:
http://www.psyent.com/download (http://www.psyent.com/download) Regards, --Scott - Altera_Forum
Honored Contributor
Great, it seems that there is a already compiled .srec file ready to use for altera NIOS2 cyclone board. Will spare me some 'makefile adventures'.
Thanks alot again, Max. - Altera_Forum
Honored Contributor
Hello again,
I have a new problem : I've successfuly compiled u-boot and got my .srec file. When I download it to my board it says :
... but I don't get the u-boot prompt in my terminal. It freezes. Is it normal that the downloaded size is inferior to the .srec file size ? Is it possible that the uClinux loaded into flash mem (and started automatically when the nios2 processor is set up) is the problem ? Do I have to erase the uClinux in order to keep the processor blank of duties before d/l ? Thanks, Max ps:Sorry if my questions are silly I'm just a student http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif$ nios2-download -g u-boot Using cable "ByteBlasterMV ", device 1, instance 0x00 Pausing target processor: OK Downloaded 112KB in 2.7s (41.4KB/s) Starting processor at address 0x018E0000 - Altera_Forum
Honored Contributor
By despair I tried erasing the flash but of course it didn't fix anything http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif
- Altera_Forum
Honored Contributor
Hi Max,
> ... but I don't get the u-boot prompt in my terminal. It freezes. What terminal software are you using? Do you have the comm parameters set for 115200,N,8,1? > Is it normal that the downloaded size is inferior to the .srec file size ? Yes ... an srec will be at least twice the size of its associated binary. > Do I have to erase the uClinux in order to keep the processor blank of > duties before d/l ? No. u-boot should be linked to an SDRAM/SRAM address. When you download it, the -g option will will cause u-boot to be executed. BTW: Which Cyclone board are you using? --Scott - Altera_Forum
Honored Contributor
Hi Scott,
the board I am using is the Altera Cyclone Devboard (with EP1C20), I am currently using the "standard" Nios2 from Altera's examples. I am using the MS hyperterminal to get a terminal, and it is apparently correctly configured (115200,N,8,1). I upload the SREC file through the JTAG, then I suppose it expects to get a connection through the UART, is it right ? I suppose I don't need any uCLinux running to get all this, the executable file is directly run when I upload it. Is this right ? Another question : why do I have to upload an SREC file instead of an ELF binary file ? Is there something with the legacy SDK and the 'old' GERMS monitor ? Thanks a lot for these answers - Altera_Forum
Honored Contributor
Hi Max,
> I am currently using the "standard" Nios2 from Altera's examples. Ok. When building u-boot this is the "PK1C20_config" -- so this is correct. > I am using the MS hyperterminal to get a terminal, Ok ... make sure you're using the connector at the rear of the board (next to the Ethernet RJ-45). > it expects to get a connection through the UART, is it right Yes, you should see the u-boot banner, some SYSID info, then get the u-boot command prompt ("==>"). > I suppose I don't need any uCLinux Correct. uClinux is not needed ... in fact, u-boot is normally used to boot uClinux (or other OS). > why do I have to upload an SREC file instead of an ELF binary file ? I don't know the internals of nios2-download -- but probably because an srec download is much easier to code ;-) > Is there something with the legacy SDK and the 'old' GERMS monitor ? Yes ... but I don't think many developers are using it. A few things to check: Confirm that your Nios-II design and the include/configs/PK1C20.h file match up WRT reset address, exception address, etc. Also, did you build the example & program it to the EPCS or download it via JTAG? Or are you using the factory configuration? Regards, --Scott - Altera_Forum
Honored Contributor
Hi Scott,
thanks for the answers. I have checked that include/configs/PK1C20.h uses the same addresses as those set in SOPC builder. I did not even build the example, I am smply using the pre-compiled SOF file I found in the example directory (1C20/standard). I did not put the SOF file in the EPCS, I upload it through uart just before uploading the srec file. Anyway, I dont get anything on my uart.......