2011-04-21 15:54:41     Development issue: u-boot immediately crashes

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

2011-04-21 15:54:41     Development issue: u-boot immediately crashes

Reggy Perrin (UNITED STATES)

Message: 100090   

 

Hi folks,

 

We have a system using BF524 and a single NAND chip.  U-boot is booting off the NAND.  Everything is great, except I've screwed up my development system.

 

Normally, I have 2 processes for loading a new u-boot:

 

    Normal:  Use running u-boot to load/erase/flash new u-boot

    JTAG loading:  Use gnICE+ to load via these instructions

 

I've now flashed a version of u-boot which loads and immediately crashes.  #1 cannot be used

 

I've tried multiple ways of #2, but since the system is initialized already, none seem to work.  Here are the two things I've tried:

 

Option 1:  just like jtag loading instructions (these are the commands I'm trying in gdb after connecting via gdb-proxy):

 

file serial/u-boot

target remote :2000

load init.elf

c

load serial/u-boot

call memset(&_bss_start, 0, &_bss_end - &_bss_start)

detach

 

Option 2:  Trying to load the binary of u-boot into memory and jump to it's start location (I actually use a variety of this in #1, so I know the process works under normal circumstances).  NOTE:  Through experimentation, we found that loading big files via JTAG worked best in 10k chunks, hence the partials to load 1 binary file:

 

target remote :2000

restore serial/u-boot.bin binary 0x050000 0x000000 0x010000

restore serial/u-boot.bin binary 0x050000 0x010000 0x020000

restore serial/u-boot.bin binary 0x050000 0x020000 0x030000

jump *0x50000

 

Neither work.

 

At this current time, I do not have the ability to switch the bootstrapping to bypass the NAND boot (I can next week, but not at my present location).

 

Can anybody think of a creative way to use jtag/gdb/gdb-proxy to regain control of my system? 

 

Thanks,

RP

 

FWIW, here's the error log when it boots:

 

 

 

U-Boot 2010.06 (ADI-2010R1-RC2) (Apr 21 2011 - 14:42:39)

 

CPU:   ADSP bf524-0.2 (Detected Rev: 0.2) (nand flash boot)

bf524-0.2: Apr 21 2011

Clock: VCO: 387.500 MHz, Core: 387.500 MHz, System: 77.500 MHz

RAM:   64 MiB

Flash: 0 Bytes

NAND:  128 MiB

*** Warning - bad CRC or NAND, using default environment

 

In:    serial

Out:   serial

Err:   serial

KGDB:  [on serial] ready

Booting...

 

 

Ack! Something bad happened to the Blackfin!

 

SEQUENCER STATUS:

SEQSTAT: 00008000  IPEND: 0032  SYSCFG: 3fbffa4

  HWERRCAUSE: 0x2: system mmr error

  EXCAUSE   : 0x0: custom exception

RETE: <0x3ded581f> { ___ashrdi3 + 0x39f36083 }

RETN: <0x6469b837> { ___ashrdi3 + 0x606fc09b }

RETX: <0xefce578f> { ___ashrdi3 + 0xebd45ff3 }

RETS: <0x03f90972> { _main_loop + 0x66 }

RETI: <0x03f8dac2> { _printf + 0xe }

 

PROCESSOR STATE:

R0 : 03fa7054    R1 : 000d000d    R2 : 03effaa6    R3 : 03effa9c

R4 : 03f80000    R5 : 03f80000    R6 : 00000002    R7 : 00000000

P0 : 03faed14    P1 : fffffbdc    P2 : ffc00104    P3 : 03efff80                                                                   

P4 : 03f01304    P5 : 00000001    FP : 03effed8    SP : 03eff9bc                                                                   

LB0: 03f8131e    LT0: 03f8131e    LC0: 00000000                                                                                    

LB1: 03f93896    LT1: 03f93864    LC1: 00000000                                                                                    

B0 : ffb00400    L0 : 00000000    M0 : 68c3f9cc    I0 : 03f212a0                                                                   

B1 : 00000000    L1 : 00000000    M1 : 7549ac57    I1 : 03effea0

B2 : 00000000    L2 : 00000000    M2 : 2ddcd65d    I2 : 00040010

B3 : 00000000    L3 : 00000000    M3 : b0ac637f    I3 : 6a3665bd

A0.w: 0000003e   A0.x: 00000000   A1.w: 0000003e   A1.x: 00000000

USP : ffb00ffc  ASTAT: 00001065

 

Hardware Trace:

   0 Target : <0x03f810d8> { _bfin_panic + 0x0 }

     Source : <0x03f80b68> { _evt_default + 0x60 }

   1 Target : <0x03f80b08> { _evt_default + 0x0 }

     Source : <0x03f8dabe> { _printf + 0xa }

   2 Target : <0x03f8dab4> { _printf + 0x0 }

     Source : <0x03f9096e> { _main_loop + 0x62 }

   3 Target : <0x03f9095a> { _main_loop + 0x4e }

     Source : <0x03f93712> { _is_z3_END_pressed + 0x12 }

   4 Target : <0x03f9370a> { _is_z3_END_pressed + 0xa }

     Source : <0x03f806d8> { _bfin_gpio_get_value + 0x64 }

   5 Target : <0x03f806c8> { _bfin_gpio_get_value + 0x54 }

     Source : <0x03f8069a> { _bfin_gpio_get_value + 0x26 }

   6 Target : <0x03f80674> { _bfin_gpio_get_value + 0x0 }

     Source : <0x03f93706> { _is_z3_END_pressed + 0x6 }

   7 Target : <0x03f93700> { _is_z3_END_pressed + 0x0 }

     Source : <0x03f90956> { _main_loop + 0x4a }

   8 Target : <0x03f90956> { _main_loop + 0x4a }

     Source : <0x03f8daea> { _printf + 0x36 }

   9 Target : <0x03f8dae0> { _printf + 0x2c }

     Source : <0x03f986ce> { _serial_puts + 0x1a }

  10 Target : <0x03f986c2> { _serial_puts + 0xe }

     Source : <0x03f98672> { _serial_putc + 0x3a }

  11 Target : <0x03f98658> { _serial_putc + 0x20 }

     Source : <0x03f9865e> { _serial_putc + 0x26 }

  12 Target : <0x03f98658> { _serial_putc + 0x20 }

     Source : <0x03f9865e> { _serial_putc + 0x26 }

  13 Target : <0x03f98658> { _serial_putc + 0x20 }

     Source : <0x03f9865e> { _serial_putc + 0x26 }

  14 Target : <0x03f98658> { _serial_putc + 0x20 }

     Source : <0x03f9865e> { _serial_putc + 0x26 }

  15 Target : <0x03f98658> { _serial_putc + 0x20 }

     Source : <0x03f9865e> { _serial_putc + 0x26 }

 

### ERROR ### Please RESET the board ###

 

 

QuoteReplyEditDelete

 

 

2011-04-21 16:02:50     Re: Development issue: u-boot immediately crashes

Reggy Perrin (UNITED STATES)

Message: 100091   

 

One slight correction:  I realized I actually never run the binary when loaded into memory.  I use the restore function to load it into memory via JTAG, then go back to the currently running u-boot and flash memory I just loaded.

QuoteReplyEditDelete

 

 

2011-04-21 16:47:18     Re: Development issue: u-boot immediately crashes

Mike Frysinger (UNITED STATES)

Message: 100092   

 

with 2010R1, you probably need to update to memset(&_bss_vma, 0, &_bss_len)

QuoteReplyEditDelete

 

 

2011-04-21 16:58:51     Re: Development issue: u-boot immediately crashes

Reggy Perrin (UNITED STATES)

Message: 100093   

 

Mike,

 

If I loaded the binary into memory, how can I compute the starting address to jump to (if I wanted to try option #2)?

QuoteReplyEditDelete

 

 

2011-04-21 17:09:17     Re: Development issue: u-boot immediately crashes

Mike Frysinger (UNITED STATES)

Message: 100095   

 

use the symbols from the elf.  _start will always point to the start address.

 

when doing the jtag loading, you probably want to run gdbproxy with the --reset option so the cpu is in a sane state when you connect.

QuoteReplyEditDelete

 

 

2011-04-21 17:17:12     Re: Development issue: u-boot immediately crashes

Reggy Perrin (UNITED STATES)

Message: 100096   

 

Mike,

 

Awesome, --reset was what I need.  Add that to my JTAG process, and it now recovers.  Thank you!

Attachments

    Outcomes