This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Why UBL can find valid magicnum 0xA1ACED66, but can not find valid uboot image?

Hi All,

I am using DM365 with my own PCB.

The problem below happened to some boards (not all of  them).

Sometimes when I turn off it when it is working fine and turn on it again, UBL can not find valid UBOOT image. Please see the message below,

DM36x initialization passed!
TI UBL Version: 1.50
Booting Catalog Boot Loader
BootMode = NAND
Starting NAND Copy...
Valid magicnum, 0xA1ACED66, found in block 0x00000013.
No valid boot image found!
NAND Boot failed.
Aborting...

This looks weird.

Refer to UBL's code, if it can find valid magicnum, it should jump out from the loop and go to run UBoot.

How come it still print "No valid boot image found!" ?

And I used Jtag to dump UBL and UBOOT image, they are same as the original one.

Could somebody help me with this problem?

Thank you very much!

 

Best Regards,

Ivy

  • Hi,

    Sorry, I forgot to mention that if I reprogram the board, it will work fine for long time, and then suddenly has the smae problem again.

     

    Thanks and Best Regards,

    Ivy

  • Hi,

    Is it possible that I can use Jtag to debug UBL step by step?

    Thanks and Best Regards,

    Ivy

  • Are you sure your DDR2 is fully functional?  Could you be seeing a NAND boot failure by getting DDR2 write errors rather than NAND read errors?

  • Hi Ivan,

    Thank you very much for the reply.

    I think in this stage the UBL code is still running in DM365 Internal RAM, not in DDR2.

    And I did not see any DDR errors.

    I only can see the error below,

    Starting NAND Copy...
    Valid magicnum, 0xA1ACED66, found in block 0x00000013.
    No valid boot image found!
    NAND Boot failed.

    Thanks and Best Regards,

    Ivy

  • UBL is running from internal memory, but it's trying to copy the NAND contents to DDR2, hence my suspicion here.  As a sanity check, could you try out the DDR2 memory test in the spectrum digital EVM support page?

    http://support.spectrumdigital.com/boards/evmdm365/revf/

    See:

    DM365 EVM Target Content
    Includes source code & tests for the DM365 EVM.
    (see tests\readme.txt for software porting hints)
    ZIP - 08/20/10
  • Hi Ivan,

    I will do the test. But I could not find any instructions in the zip file, the readme.txt does not help. 

    Could you please tell me how to do the test?

     

    Thanks and Best Regards,

    Ivy

  • Ivy,

    Try \evmdm365_v1\tests\ddr.  You will need to run the ddr.out file.  I'm attaching it here for convenience.  You can modify this test so it runs indefinitely as well, and run it for ~1 hr.  Can you give this a shot?  This is a quick sanity test to try on the failing board.  

    ddr.out
  • Hi Ivan,

    Thank you very much for the reply.

    I am now doing the DDR test, I will let you know the result later.

    Sorry, I think I made a mistake before.

    The ubl image in the nand is same as the original one, but the Uboot image in the NAND has 1 bit difference from the original one.

    I think it is this 1 bit cause the "Can not find valid boot image" problem.

    But I do not know why DM365 does not correct this 1 bit error in UBL, the hardware 4-bit ECC is enabled in UBL.

    Do you have any suggestion?

     

    Thanks and Best Regards,

    Ivy

  • Hi Ivan,

    Thank you very much for your great help.

    We finally fixed the problem.

    It is because we used an old UBL release which does not correct ECC errors.

    Refert to  the topic "How to set ECC control setting in UBL?"http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/p/182730/708236.aspx#708236 in TI's forum,  we fixed the problem by modifying UBL code as below:

    // Start calculating the correction addresses and values
      AEMIF->NANDFCR |= (0x1U << DEVICE_EMIF_NANDFCR_4BITECC_ADD_CALC_START_SHIFT);

      /*
       * loop without any of the correction calculations having taken place.\r
       * So wait till ECC_STATE reads less than 4.\r
       */
      do
      {
        temp = (AEMIF->NANDFSR >> 8) & 0xf;
      }while (temp < 4);

      // Loop until timeout or the ECC calculations are complete (bit 11:10 == 00b)
      i = NAND_TIMEOUT;
      do
      {
        temp = (AEMIF->NANDFSR & DEVICE_EMIF_NANDFSR_ECC_STATE_MASK)>>10;
        i--;
      }
      while((i>0) && (temp != 0x0));

    Highlighted text needs to be added.

    Thanks and Best Regards,

    Ivy