Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

U-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,

Max

18 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Well, sorry I had not checked everything in the PK1C20.h, some addresses were incompatible. It is fixed.

    When I get the prompt, I get this :

    U-Boot 1.1.2 (Apr 19 2005 - 16:56:44)
    CPU   : Nios-II
    SYSID : 192c0526, Thu Nov 25 09:37:20 2004
    BOARD : Psyent PK-1C20
    *** Warning - bad CRC, using default environment
    ==>

    Is the warning important, what CRC is it about ?

    Thanks
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Max,

    Great to hear things are working :-)

    > Is the warning important, what CRC is it about ?

    u-boot maintains environment variables in a flash sector. The default

    for the Altera Cyclone devkit is at 0x0002_0000 (3rd sector).

    When u-boot starts up it attempts to read the environment variables from

    this sector ... but runs a 32-bit CRC to ensure integrity. To get rid of the

    warning you can simply issue the 'saveenv' command.

    BUT BE CAREFUL ... if you already have something else saved in that sector,

    (like uClinux) ... you might want to re-configure the environment address

    (include/configs/PK1C20.c -- see the CFG_ENV_ADDR macro).

    Best Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    (Thanks for your precise details, Scott.)

    Hello, me _again_ with my uboot problems http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/laugh.gif

    I&#39;ve followed all the instructions given with U-BOOT in order to load my .bin into flash.

    (...)
    ==> cp.b 800000 0 1bdac
    Copy to Flash... done

    But when I restart am I supposed to have a sort of u-boot config prompt ? For the moment I have nothing. It says in doc that normally uboot starts automatically (because at 0x00).

    Ive searched troughout the net for docs about U-BOOT implementation but found nothing really interesting at this stage.

    Another thing : "bootm X" command returns

    ==> bootm 0# # Booting image at 00000000 ...
    Bad Magic Number

    What does it mean ?

    If someone can help,

    thanks.

    Max
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Max,

    > But when I restart am I supposed to have a sort of u-boot config prompt ?

    Yes. Normally, u-boot is stored in flash at the reset address. At startup,

    u-boot copies itself to SDRAM (in this case 018e_0000), then jumps into

    SDRAM. From there, everything is the same.

    A few things to check if u-boot doesn&#39;t start on reset/power-on:

    1. Make sure u-boot is stored at the actual reset address.

    2. When saving u-boot to flash ... make sure you write the entire image.

    If you use loadb/loads to download the binary/srec, the actual size of the

    binary will be reported -- use the reported size.

    3. To check the binary image you downloaded to SRAM, you can just

    use the &#39;go&#39; command. Based on your last post, you would execute:

    ==> go 800000

    Or to confirm that the image you stored in flash behaves properly:

    ==> go 0

    If your new image doesn&#39;t run ... you have other problems ;-)

    > Another thing : "bootm X" command returns

    > ...

    The magic number is invalid in the image header at address 0x0.:

    The bootm command is used to boot a u-boot image file generated with the

    mkimage utility (it&#39;s not the same as the &#39;go&#39; command). The bootm command

    does the following:

    0. Checks the header magic number.

    1. Performs a 32-bit CRC check of the image header.

    2. Performs a 32-bit CRC check of the image data.

    3. Executes other consistency checks (e.g. image type, architecture, etc).

    4. Optionally decompresses the data.

    5. Relocates the data to the load address.

    6. Disables interrupts.

    7. Finally, jumps to entry point address.

    So, it&#39;s normally used to boot a gzipped linux kernel image.

    > ...

    > docs about U-BOOT implementation

    > ...

    This has information for a PowerPC-based board, but it&#39;s loaded with

    target-independent info as well:

    http://www.denx.de/twiki/bin/view/dulg/uboot (http://www.denx.de/twiki/bin/view/dulg/uboot)

    Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I checked all your precious advices then I got this :

     
     ==> go 800000# # Starting application at 0x00800000 ...

    then ... nothing. The processor hangs, nothing else possible than reseting.

    Damn I must have a problem with my .bin as the one I had with my .srec !
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Egads!!! Looks like like most of the addresses have changed in the

    standard example since 4.1/Nios-II 1.0!!! That explains why you

    had to change all the addrs ... sorry about not noticing that, Max.

    So ... looks like the SRAM has moved as well ... so the quick-start

    info in the README needs to be updated. When you download,

    you&#39;ll have to do something like:

    ==> loadb 2000000

    ...

    ==> cp.b 2000000 0 <some hex count>

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Great! Hopefully, the sources at psyent will be updated soon 8-P

    Best Regards,

    --Scott