2010-08-13 11:33:52     BF518 UART boot problem

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

2010-08-13 11:33:52     BF518 UART boot problem

Abhijit Bokil (INDIA)

Message: 92414   






I have a BF518 based board which I designed using the bf518f-ezbrd schematic references online . I am trying to load u-boot for the first time through UART. I built the u-boot ldr file from u-boot-2008.10-2009R1.1-rc1 with necessary settings like:


- changed CONFIG_MEM_SIZE to 32 as I am using MT48LC16M16A2 (32MB SDRAM i.e. 4 M x 16 x 4 banks); also changed CONFIG_EBIU_SDRRC_VAL, CONFIG_EBIU_SDBCTL_VAL and CONFIG_EBIU_SDGCTL_VAL accordingly.


- changesd PLL settings accordingly for CLKIN=20MHz, CCLK=320MHz and SCLK=80MHz (CONFIG_VCO_MULT, CONFIG_CCLK_DIV,CONFIG_SCLK_DIV, etc. )


- BM2, BM1 and BM0 all set to 1,1,1 for UART boot




When I try to load u-boot.ldr via UART using bfin-uclinux-ldr, the boot-ROM starts and executes the initcode() function correctly and I can see all the prints as pasted below:


bfin-uclinux-ldr -l u-boot.ldr /dev/ttyUSB0 && kermit -l /dev/ttyUSB0 -b 115200 -C connect

Loading LDR u-boot.ldr ... OK!

Opening /dev/ttyUSB0 ... OK!

Configuring terminal I/O ... OK!

Trying to send autobaud ... OK!

Trying to read autobaud ... OK!

Checking autobaud ... OK!

Autobaud result: 115200bps 23.961mhz (header:0xBF DLL:0x0D DLH:0x00 fin:0x00)

Sending blocks of DXE 1 ... [2/10] (20%)[board said: A]

[board said: BCDEF�O]

[board said: PQST>






After this the board hangs completely.


Ideally, now the boot-ROM must jump to entry point of application i.e. start as defined in start.S. But nothing seems to be happening after the above prints.


Also, I can see that the PLL settings have been correctly applied as I can see a 80MHz clk signal at CLKOUT which is connected to CLK of RAM.




Any help will be greatly appreciated.




Anshuman K.




2010-08-13 11:52:49     Re: BF518 UART boot problem

Mike Frysinger (UNITED STATES)

Message: 92416   


at this point, the most likely candidate is external memory problems, hardware or software.


if you have JTAG, you can hook it up and try reading/writing external memory.  otherwise you'll have to edit the initcode.c and add some manual reading/writing/checking of external memory.




2010-08-16 10:15:11     Re: BF518 UART boot problem

Abhijit Bokil (INDIA)

Message: 92457   


Unluckily, I dont have a JTAG right now. But I tried your other suggestion i.e. I tried writing to different regions of SDRAM within initcode function itself after RAM initialization and read back those regions back, and compared the written and read values and everything is working fine. I guess this rules out the possibility of any problems related to RAM.


But still after the initcode, I dont get the u-boot console nor any prints defined in start.S




2010-08-16 10:40:06     Re: BF518 UART boot problem

Mike Frysinger (UNITED STATES)

Message: 92459   


reading and writing a few values is not exhaustive, so no, it doesnt rule out problems.  it just means that basic functionality is there.


you can try reading/writing all of external memory using different bit patterns and then making sure the values are sane to get more confidence.


if you look at the u-boot code, the very first thing it does in external memory is write a string to the UART.




2010-08-17 02:46:33     Re: BF518 UART boot problem

Abhijit Bokil (INDIA)

Message: 92477   


Thanks Mike!!


I was able to get the board running. Apparently there was a problem with the values I had used for the SDC registers.




2010-08-18 09:00:52     Re: BF518 UART boot problem

Abhijit Bokil (INDIA)

Message: 92555   


I was able to load u-boot via UART onto BF518F based board successfully. After this I downloaded new u-boot.ldr (that boots from parallel flash) using tftp and copied this ldr to flash memory. Now, when I reset the board with BMODE values 001, I dont see any prints on serial port.


While buliding u-boot.ldr that boots from flash, I used the same settings I used for building u-boot-uartboot.ldr (which loads successfully) except the boot mode i.e. i changed CONFIG_BFIN_BOOT_MODE to BFIN_BOOT_PARA. Apart from this, is there anything I am missing out.




2010-08-18 12:34:30     Re: BF518 UART boot problem

Mike Frysinger (UNITED STATES)

Message: 92557   


do `make clean` after changing the board config




2010-08-18 13:41:49     Re: BF518 UART boot problem

Abhijit Bokil (INDIA)

Message: 92561   


Yeah of course, I did 'make clean' before rebuilding it. Apart from that is there anything critical I might be missing out in building the ldr? I went through a lot of references all over and dont think am skipping any step. Unless of course, there's a problem with the hardware which I intend to debug anyways as a final option.




2010-08-18 14:00:15     Re: BF518 UART boot problem

Mike Frysinger (UNITED STATES)

Message: 92562   


not everyone does `make clean` ...


all you should need to do is change the boot mode define.  the rest of the system keys off of that when necessary.


you still have early serial debugging enabled but you dont see any output when booting from parallel flash (bmode 1) ?


are you sure the parallel flash was burned correctly ?  use cmp.b to verify the contents of the u-boot.ldr in external memory and the one burned into the flash at 0x20000000.




2010-08-18 14:11:23     Re: BF518 UART boot problem

Abhijit Bokil (INDIA)

Message: 92563   


yeah serial early debugging is still enabled and i dont see any prints when i reset the device with BMODE set to 001.


And I did a comparison between the downloaded ldr (in RAM) and the copy written to flash using cmp.b, everythng checks out fine.


I'm a little clueless now, I guess I'll take a look at the address and data lines running between BF518F and the flash chip during reset.




2010-08-18 14:17:58     Re: BF518 UART boot problem

Mike Frysinger (UNITED STATES)

Message: 92564   


this is where jtag would help.  it'll take a lot less time to connect and analyze things with that than to hook up probes all over the place and decode the traffic.


another thing you can try is that after you've booted up over the UART, switch your bmode pins to 001 (while still running u-boot), and then read the SYSCR register:

    md.w ffc00104 1

it should show the low three bits as 001 if your bmode pins are correct.


i also vaguely recall that your NOR flash needs to be available relatively quickly.  so you might want to double check the Blackfin & NOR flash datasheets to make sure the timings arent being violated.  but maybe that's really only an issue for people doing bypass mode which doesnt work on BF51x parts ...




2010-08-19 05:51:51     Re: BF518 UART boot problem

Abhijit Bokil (INDIA)

Message: 92577   


I was able to boot u-boot from flash successfully. It seems that AMS2 was'nt pulled high and so was continuously low at bootup. As a result when I reset the board with BMODE 001, boot-rom tried to boot from bank0 by pulling AMS0 low but since AMS2 was also low, bank2 was also enabled which upset the entire boot process.