2009-08-26 19:29:22     Blackfin crashes when running u-boot macro, OK when each command entered

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

2009-08-26 19:29:22     Blackfin crashes when running u-boot macro, OK when each command entered

Ben Burleson (UNITED STATES)

Message: 79250   

 

I have a two-stage boot process that first downloads and saves a uImage to flash.  It then changes the boot command to boot the saved uImage.

 

I defined two macros (see below) to handle the different processes and they had been working perfectly for quite a while.  Recently, the blackfin is crashing just after saving the environment in the tftpupdate macro.  See attachment for output.  You can see it crashes directly after saving the environment - not sure if this is before reset is issued or a result of running the reset command.  It used to change the boot command, save the environment, and reboot itself all successfully.  It now requires a hard reset.  I'm also perplexed because running the sequence of command manually is successful.  Why would the board behave different when running the macro?

 

The initial boot command is 'run tftpupdate', then tftpupdate changes the boot command to 'run localboot'.

 

    "tftpupdate=" \

        "run erasejffs2;" \

        "tftp $(loadaddr) $(imagename);" \

        "protect off 0x20100000 0x203FFFFF;" \

        "erase 0x20100000 0x203FFFFF;" \

        "cp.b $(loadaddr) 0x20100000 0x300000;" \

        "protect on 0x20100000 0x203FFFFF;" \

        "setenv bootcmd run localboot;" \

        "saveenv;" \

        "reset" \

        "\0" \

    "localboot=" \

        "ping 172.16.5.1;" \

        "pf4 set;" \

        "cp.b 0x20100000 $(loadaddr) 100000;" \

        "pf4 clear;" \

        "cp.b 0x20000000 0x1100000 200000;" \

        "pf4 set;" \

        "bootm" \

        "\0"

 

 

u-boot.out

QuoteReplyEditDelete

 

 

2009-08-26 20:28:23     Re: Blackfin crashes when running u-boot macro, OK when each command entered

Mike Frysinger (UNITED STATES)

Message: 79252   

 

do_reset shouldnt be crashing.  i have no idea where you're getting your source code, but it doesnt appear to be from us.  and since you arent using a release binary, i cant look at the disassembly of the do_reset function.

 

QuoteReplyEditDelete

 

 

2009-08-27 13:25:48     Re: Blackfin crashes when running u-boot macro, OK when each command entered

Ben Burleson (UNITED STATES)

Message: 79312   

 

I'm building from u-boot-2008.10, I only have modifications to bfin_adi_common.h and cm-bf537e.h

 

The most interesting fact is that if I omit reset from tftpupdate, that completes with no crash.  Then I can immediately issue the reset command and that works as expected with no crash.  I thought some timing might be the problem - for some reason saving the environment wasn't completing before reset is issued causing a crash.  So I added a sleep between saveeenv and reset - this did not help, it still crashed after the sleep, on reset.

 

Can you think of anything that would cause the reset in my macro to behave different than a reset on the u-boot prompt?

QuoteReplyEditDelete

 

 

2009-08-27 15:56:45     Re: Blackfin crashes when running u-boot macro, OK when each command entered

Mike Frysinger (UNITED STATES)

Message: 79317   

 

post your u-boot ELF that matches the u-boot.bin from your crash

QuoteReplyEditDelete

 

 

2009-08-27 19:17:02     Re: Blackfin crashes when running u-boot macro, OK when each command entered

Ben Burleson (UNITED STATES)

Message: 79325   

 

Attached is the ELF

 

u-boot

QuoteReplyEditDelete

 

 

2009-10-06 04:16:57     Re: Blackfin crashes when running u-boot macro, OK when each command entered

Mike Frysinger (UNITED STATES)

Message: 80886   

 

hmm, i wonder if the pipeline is causing this problem.  if you edit cpu/blackfin/reset.c:bfin_reset_trampoline() and add "nop;nop;nop;" to the start of the asm(), does it work ?

Attachments

Outcomes