2010-12-05 13:49:48     Error building uBoot after make clean

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2010-12-05 13:49:48     Error building uBoot after make clean

Wojtek Skulski (UNITED STATES)

Message: 96486   

 

Hi:

 

I made clean and now I cannot build uBoot anymore. Here is the error message at the end of the make. Any idea where to look for the problem?

 

make -C arch/blackfin/lib/ u-boot.lds.S

make[2]: Entering directory `/home/uclinux/u-boot/u-boot-2010.06/arch/blackfin/lib'

make[2]: Nothing to be done for `u-boot.lds.S'.

make[2]: Leaving directory `/home/uclinux/u-boot/u-boot-2010.06/arch/blackfin/lib'

UNDEF_SYM=`bfin-uclinux-objdump -x board/blackvme/libblackvme.a lib/libgeneric.a lib/lzma/liblzma.a lib/lzo/liblzo.a arch/blackfin/cpu/libblackfin.a arch/blackfin/lib/libblackfin.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a fs/ubifs/libubifs.a net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/fpga/libfpga.a drivers/gpio/libgpio.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/onenand/libonenand.a drivers/mtd/ubi/libubi.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/power/libpower.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/twserial/libtws.a drivers/usb/gadget/libusb_gadget.a drivers/usb/host/libusb_host.a drivers/usb/musb/libusb_musb.a drivers/usb/phy/libusb_phy.a drivers/video/libvideo.a drivers/watchdog/libwatchdog.a common/libcommon.a lib/libfdt/libfdt.a api/libapi.a post/libpost.a | sed  -n -e 's/.*\(___u_boot_cmd_.*\)/-u\1/p'|sort|uniq`; cd /home/uclinux/u-boot/u-boot-2010.06 && bfin-uclinux-ld --gc-sections -m elf32bfin -Bstatic -T u-boot.lds  $UNDEF_SYM arch/blackfin/cpu/start.o --start-group lib/libgeneric.a lib/lzma/liblzma.a lib/lzo/liblzo.a arch/blackfin/cpu/libblackfin.a arch/blackfin/lib/libblackfin.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a fs/ubifs/libubifs.a net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/fpga/libfpga.a drivers/gpio/libgpio.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/onenand/libonenand.a drivers/mtd/ubi/libubi.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/power/libpower.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/twserial/libtws.a drivers/usb/gadget/libusb_gadget.a drivers/usb/host/libusb_host.a drivers/usb/musb/libusb_musb.a drivers/usb/phy/libusb_phy.a drivers/video/libvideo.a drivers/watchdog/libwatchdog.a common/libcommon.a lib/libfdt/libfdt.a api/libapi.a post/libpost.a board/blackvme/libblackvme.a --end-group -L /opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2 -lgcc -L /opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2 -lgcc -Map u-boot.map -o u-boot

/opt/uClinux/bfin-uclinux/bin/bfin-uclinux-ld.real:u-boot.lds:1: ignoring invalid character `#' in expression

/opt/uClinux/bfin-uclinux/bin/bfin-uclinux-ld.real:u-boot.lds:1: syntax error

make[1]: *** [u-boot] Error 1

make[1]: Leaving directory `/home/uclinux/u-boot/u-boot-2010.06'

make: *** [blackvme] Error 2

$

$

QuoteReplyEditDelete

 

 

2010-12-05 15:59:21     Re: Error building uBoot after make clean

Mike Frysinger (UNITED STATES)

Message: 96487   

 

did you read the u-boot.lds file ?

QuoteReplyEditDelete

 

 

2010-12-05 17:46:13     Re: Error building uBoot after make clean

Wojtek Skulski (UNITED STATES)

Message: 96488   

 

Mike:

 

My goal is to add support for Winbod Q series of SPI flash chips to uBoot, because Winbond X chips are obsolete. I have the W25Q64BV soldered on my new BlackVME boards because I could not purchase the ST chips. So I purchased W25Q64BV, but the 2009 uBoot only supports the X version of Windbond chips.. I need to modify uBoot. I went too fast. I am now investigating where the things start going bad.

 

1) make clean; make blackstamp --> build success

 

2) make clean; make blackvme with STMICRO --> build success.

 

3) make blackvme with original WINBOND X-series--> build success. (Without make clean.)

 

Amazing. Previously the build failed several times with the u-boot.lds error. But now the error is gone, even though I have not done anything to fix it. So now I can start modifying the file drivers/mtd/spi/winbond.c

 

4) I modified the file adding W25Q16, W25Q32, W25Q64, W25Q128. (The chip on my board is W25Q64BV.)

 

5) make blackvme with WINBOND X and Q-series--> build success. (Without make clean.)

 

6) I loaded the new uBoot to SPI flash using my favorite XSPI utility. It booted, but it does not recognize the flash chip from which it booted. Not only that. The Ether does not work, either. (I have not touched anything in the ethernet.) So this uBoot binary is truly screwed up, though it looks functional over RS-232.

 

bfin> sf probe 2

Failed to initialize SPI flash at 0:2

 

7) make clean; make blackvme  with WINBOND X and Q-series--> build success. (With make clean.)

 

This version does not recognize the SPI flash, either. It looks like it is time to start serious debugging of winbond.c

 

In any case, the original problem with u-boot.lds is automagically gone, even though I did nothing to fix it.

QuoteReplyEditDelete

 

 

2010-12-05 19:54:53     Error building uBoot after make clean

Phil Wilshire (UNITED STATES)

Message: 96489    >

You cannot use # or // comments in the u-boot.lds.S file

you have to use the /* .... */ style of comments.

Phil Wilshire

QuoteReplyEditDelete

 

 

2010-12-05 20:18:57     Re: Error building uBoot after make clean

Wojtek Skulski (UNITED STATES)

Message: 96490   

 

Phil:

 

thank you for the hint. The funny thing is that I have not even looked at that file. The error appeared and then went away all by itself. It was very stubborn, and then just went away without me touching either the u-boot.lds.S or u-boot.lds.

QuoteReplyEditDelete

 

 

2010-12-05 21:35:51     Re: Error building uBoot after make clean

Mike Frysinger (UNITED STATES)

Message: 96494   

 

enable DEBUG in the different spi files to get useful output

 

QuoteReplyEditDelete

 

 

2010-12-05 22:28:22     Re: Error building uBoot after make clean

Wojtek Skulski (UNITED STATES)

Message: 96495   

 

Mike:

 

I am trying to enable DEBUG, but it has no effect. I must be doing something completely silly. I have rebuilt the u-boot.ldr.hex multiple times, and the changes do not propagate to that file. Consider the output which I just got:

 

Hit any key to stop autoboot:  0

bfin> sf probe 2

Failed to initialize SPI flash at 0:2

bfin>

 

I found the file which is printing this message and I have modified it. Then I made clean. I also removed the .a and .o file. Then I rebuilt u-Boot, reflashed the chip, and I am still getting the same message rather than the modified one which should start with "./common/cmd_sf.c.". About the only place on disk where the old message is hiding is in the cmd_sf.c.svn-base. Is it possible that the compiler is stubbornly using cmd_sf.c.svn-base to rebuild the binary ???

 

$ grep -r "Failed to initialize SPI flash at" .

Binary file ./u-boot.ldr.M25P64 matches

Binary file ./u-boot.ldr matches

Binary file ./u-boot matches

grep: ./include/asm/arch: No such file or directory

grep: ./arch/blackfin/include/asm/arch: No such file or directory

Binary file ./u-boot.bin matches

Binary file ./common/cmd_sf.o matches

./common/.svn/text-base/cmd_sf.c.svn-base:              printf("Failed to initialize SPI flash at %u:%u\n", bus, cs);

./common/cmd_sf.c:              printf("./common/cmd_sf.c Failed to initialize SPI flash at %u:%u\n", bus, cs);

Binary file ./common/libcommon.a matches

 

I will now remove all these files except ./common/cmd_sf.c and make clean; make blackvme. I should be getting the modified message rather than the original one.

 

Likewise, enabling DEBUG (which I did of course) has no effect whatsoever. It looks as if I am rebuilding the same binary over and over again. It must be hiding somewhere on disk.

 

I have never seen anything like that. I have doing this business for months and it always worked... But now it does not.

QuoteReplyEditDelete

 

 

2010-12-05 23:12:46     Re: Error building uBoot after make clean

Wojtek Skulski (UNITED STATES)

Message: 96497   

 

I was doing something completely silly. When I did everything step by step, I realized that I was burning the wrong flash. I have two flash chips on board, one for Blackfin and the other one for the FPGA. I jumpered the FPGA to be the target of burning, and then I was booting the same flash image over and over again from the Blackfin flash. Silly me.

 

When I switched the jumpers, the whole thing just worked with the DEBUG printouts and the new Winbond Q series. By the way, the only difference between the old X chips and the new Q chips (apart from quadruple SPI lanes, which we are not using with Blackfin) is the chip ID code. The old X chips return 0x30xx codes, while the new Q chips return 0x40xx codes. Otherwise they are identical from the Blackfin standpoint.

 

An exciting news is that Winbond is planning to release a 32 megabyte Q chip W25Q256. It is not available yet, but hopefully it will be available soon. I am attaching the modified winbond.c file because the X chips are marked "legacy" and may be hard to get.

 

Hit any key to stop autoboot:  0

bfin> sf probe 2

SF: entered *spi_flash_probe in ./drivers/mtd/spi/spi_flash.c

SF: spi_flash_cmd sending command 9f

SF: Got idcode ef 40 17 00 00

SF: probing for WINBOND

SF: Winbond: entered *spi_flash_probe_winbond

SF: Detected W25Q64 with page size 256, total 8 MiB

8192 KiB W25Q64 at 0:2 is now current device

bfin>

 

winbond.c.XandQ_chips

QuoteReplyEditDelete

 

 

2010-12-06 01:55:52     Re: Error building uBoot after make clean

Mike Frysinger (UNITED STATES)

Message: 96500   

 

generally, patches are preferred rather than whole files

 

once i trim the noise, the attached patch should do what you need i think

 

winbond-q.patch

QuoteReplyEditDelete

 

 

2010-12-09 05:32:30     Re: Error building uBoot after make clean

Mike Frysinger (UNITED STATES)

Message: 96589   

 

upstream already merged a patch for W25Q64 support, so i redid the patch on top of that.  then i merged it into our trunk and pushed it upstream.

Outcomes