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.

Booting from NAND - round 2

Hello,

in a previous post ( http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/110596.aspx ) I described a problem I was having running programs from NAND and was advised to check out the latest MCSDK.

I have:

  • installed the latest MCSDK (beta2 as of this post)
  • Programmed the IBL
  • Configured the boot parameter table
  • loaded POST pre-compiled *.dat file into NAND
  • Powered down the board and set the boot pins to NAND (according to the IBL evmc6678-instructions.txt)
  • Powered up the board

However after these steps I am unable to observe the POST program running.  Is this normal, or should there be a console print just as if I ran the program from CCS?

You all have been a great help to us so far.  I hope this is a simple error on my part :)

Thank you in advance!

  • A couple things to check, it's hard to tell from the quick summary of steps above...

    First, the *.dat format is not the actual format to load into NAND, but if you followed the steps in:

    C:\Program Files\Texas Instruments\mcsdk_2_00_00_beta2\tools\writer\nand\docs\README.txt

    it should program it correctly.

    Second, and this is probably the one that you may have overlooked, if you programmed the latest IBL into the I2C, this IBL by default only supports Linux BBLOB format from NAND.  It doesn't support ELF.  So you actually need to make a change in the i2cConfig.gel before programming the boot configuration table into the I2C.  The instructions for this and an example using NAND boot are found here:

    C:\Program Files\Texas Instruments\mcsdk_2_00_00_beta2\tools\boot_loader\examples\i2c\nand\docs\README.txt

    And the only comments I'll add to that README.txt is:

    "No Boot" mode is:  

    SW6 [position 4, 3, 2, 1] = On, On, On, On = 4b0000

    SW5 [position 4, 3, 2, 1] = Off, On, On, On = 4b1000

    SW4 [position 4, 3, 2, 1] = On, On, On, On = 4b0000

    SW3 [position 4, 3, 2, 1] = On, On, On, Application specific Endianess = 4b000x (where x = off for little endian and on for big endian)


    And if you really do use the 3pin serial UART cable, you need to move the yellow jumpers on the EVM because by default, these are set to use the serial of USB.  See the EVM technical reference manual.

    Hope that helps,

    Travis

     

  • Hi Travis, thank you for the detailed response!  I did indeed overlook the BBLOB/ELF configuration step.  I'm trying that right now and will get back with my results.

    Thanks again,

    r_robotics

  • Hmm, I can't seem to find the file i2crom_0x51_c6678_le.dat referenced in evmc6678-instructions.txt (located at <mcsdk_2_00_00_beta2>\tools\boot_loader\ibl\doc )  Appearently, last time I programmed the IBL, I used the file i2crom.dat that I found at<mcsdk_2_00_00_beta2>\tools\boot_loader\ibl\src\make\ibl_c661x.  That's the only *.dat file with "i2c" in its name in the MCSDK structure.  Is this the file I should be using?  If not, where can I acquire it?  Thanks!

  • Yes, you are correct, the I2crom.dat is the correct file.  Apparently there is need for some file name cleanup in the beta2 docs/readme.  Also the same readme, it refers to i2crom_0x51_c6678_le.dat, which is actually mcsdk_2_00_00_beta2\tools\boot_loader\ibl\src\util\i2cConfig\i2cparam_c661x_le.out too.  So hopefully that gets you everything you need.

    So essentially you have 3 major steps to boot your image from NAND.

    1) Write your image into NAND via the Nandwriter utility.  This involves taking your custom.out file and running it through bin2CCS to yield a .dat format which is used by the Nandwriter.

    2) Write the IBL into the EEPROM via the I2C EEPROM writer utility.  Essentially all you have to do here is rename the i2crom.dat to app.dat and run the utility in CCS.

    3) Write the config table for NAND boot into the I2C.  Here is where you use CCS to run i2cparam_c661x_le.out, and you point to your modified i2cConfig.gel for the ELF format.

    4) power cycle the board and set the dip switches to NAND to boot.

    Obviously there is more detail in the readme files.  Also, I editted my previous post, since re-compile was a poor choice of words.  I think it makes better sense now.

     

    Regards,

    Travis

     

  • Thanks, Travis.  I'll see if I can get it running with your instructions.  I'll post back here with my results.

  • Hi Travis,

    Unfortunately, after trying multiple times (and having a college colleague attempt, just to make sure I'm not insane), I have not been able to successfully run any program from NAND.  I know it's probably frustrating from your end to describe all the steps, so I've posted below exactly what I have done (sometimes in very boring detail...mostly for my own sanity):

    • Configure GEL
      • Change i2cConfig.gel to read:
        •  ibl.bootModes[1].u.nandBoot.bootFormat        = ibl_BOOT_FORMAT_ELF;
    • Load IBL
      • Copy <MCSDK_beta2>/tools/boot_loader/ibl/src/make/ibl_c661x/i2crom.dat to <MCSDK_beta2>/tools/writer/eeprom/evm6678l/bin/
      • Rename file to app.dat
      • Make sure eepromwriter_input.txt is set to load app.dat to I2C address 81 (0x51)
        • Other parameters not changed:
        • start_addr = 0
        • swap_data = 1 (also tried with swap_data = 0)
      • Power-down EVM
      • Set boot pins to little endian "No Boot"
      • Launch the EVM6678 target configuration
      • Load the evm6678l.gel file that accompanied the CCSv5.02 patch
        • Wait for memory map setup to complete
      • Connect to Core 0
        •  Wait for GEL initialization sequence to finish
      • Load Core 0 with <MCSDK_beta2>\tools\writer\eeprom\evmc6678l\bin\eepromwriter_evm6678.out
      • Load memory location 0x80000000 with the app.dat file, making sure to use the header information to set the size of the memory block
      • Run the EEPROM writer program
      • ===Everything runs successfully
    • Configure IBL
      • Terminate previous debug session (load IBL session)
      • Power-down EVM
      • Power-up EVM
      • Boot pins still set to little endian "No Boot"
      • Launch the EVM6678 target configuration
      • Load the evm6678l.gel file that accompanied the CCSv5.02 patch
        • Wait for memory map setup to complete
      • Connect to Core 0
        •  Wait for GEL initialization sequence to finish
      • Load Core 0 with <MCSDK_beta2>\tools\boot_loader\ibl\src\util\i2cConfig\i2cparam_c661x_le.out
      • Load GEL file <MCSDK_beta2>\tools\boot_loader\ibl\src\util\i2cConfig\i2cConfig.gel
      • Run the i2cparam_c661x_le.out program
      • Run the EVM c6678 IBL -> setConfig_c6678_main GEL script
      • Press "Enter"
      • ===Program states that the I2C table write completed
    • Program NAND
      • Terminate previous debug session (configure IBL session)
      • Power-down EVM
      • Copy C:\cssv5.02\mcsdk_2_00_00_beta2\tools\post\evmc6678l\bin\post_evm6678l.out to <MCSDK_beta2>\tools\bin2ccs\
      • Rename post_evm6678l.out to app.out
      • Double click on bin2css.bat to generate app.dat
      • Copy app.dat to <MCSDK_beta2>\tools\writer\nand\evmc6678l\bin\
      • Power-up EVM
      • Boot pins still set to little endian "No Boot"
      • Launch the EVM6678 target configuration
      • Load the evm6678l.gel file that accompanied the CCSv5.02 patch
        • Wait for memory map setup to complete
      • Connect to Core 0
        •  Wait for GEL initialization sequence to finish
      • Load Core 0 with <MCSDK_beta2>\tools\writer\nand\evmc6678l\bin\nandwriter_evm6678l.out
      • Load memory location 0x80000000 with the app.dat file, making sure to use the header information to set the size of the memory block
      • Run the nandwriter_evm6678l.out program
      • ===Console states that the NAND programing completed successfully
    • Test NAND
      • Terminate previous debug session (program NAND session)
      • Power-down EVM
      • Configure boot pins for little endian NAND boot (via the definition given in the <MCSDK_beta2>\tools\boot_loader\ibl\doc\evmc6678-instructions.txt
        • "   NAND Boot:
             Set the dip switches (pin1, pin2, pin3, pin4) to:
              SW3(off, off, on, off),
              SW4(on, off, on, on),
              SW5(on, on, on, off),
              SW6(on, on, on, on)
             This will set the boot para index to 2 to boot the NAND image, by default
             the boot configuration table sets the NAND offset address to be 16384
             (start of block 1) and image format to be BBLOB for image 0."
      • Power-up the EVM
      • ===At this point, even after waiting a minute or so, nothing appears to come across the RS232 port.

    Any suggestions would be greatly appreciated.  Thank you!

  • Sorry that should have read "colleague" not "college"

  • It looks right to me.  I'll have a few others go through this and see if they can detect the issue.  The only thing I can think of right now is that you may not have the latest gel file, depending on when you downloaded the CCSv5.0.2 patch.  The DDR settings in gel are crucial, please make sure you are using v1.4 (attached).  If not re-run and let me know the results.

    Regards,

    Travis

    evmc6678l.zip
  • Travis, thank you for the update.  I'll try the new GEL file and see what happens.

  • I've started poking with this issues as well. Just to confirm, the ibl .dat file in the ibl_c661x folder is compatible with the c6678? Or should an image be built for the 6678 per the instructions in mcsdk-2\mcsdk_2_00_00_beta2\tools\boot_loader\ibl\doc\release_info.txt

     

    Thanks,

    Chris

  • Hi Travis,

    Unfortunately, the new GEL file had no effect.  I am still unable to boot the POST program from NAND.  I am having a co-worker try the procedure on his machine with a fresh install of CCS5.

    Have you, or do you know anyone who has actually gotten this to work themselves?  If so, could you give me details of their install procedure for CCS, their emulator, etc.?  I have tried to get this working with three separate boards and they all fail the same way.  I'm running out of options and very low on time.

    I really appreciate the help!

  • No one has actually booted the POST program from NAND that I'm aware of, but it should work.  If you want to make sure that you have programmed the IBL into the EEPROM correctly and that portion works, then you can boot the device to run the POST from I2C using:

    POST Boot:
       Set the dip switches (pin1, pin2, pin3, pin4) to:
        SW3(off, off, on, off),
        SW4(on, on, on, on),
        SW5(on, on, on, on),
        SW6(on, on, on, on)


    Make sure that is working first. 

    I reviewed your procedure with a colleague and found a couple issues, highlighted in RED.  The first one I missed when reviewing earlier, because I only looked at the ibl_BOOT_FORMAT_ELF and didn't notice you specified NOR not NAND.  Can you confirm these please?

     

    • Configure GEL
      • Change line 715 of i2cConfig.gel to read:
        •  ibl.bootModes[1].u.nandBoot.bootFormat        = ibl_BOOT_FORMAT_ELF;
    • Load IBL
      • Copy <MCSDK_beta2>/tools/boot_loader/ibl/src/make/ibl_c661xi2crom.dat to <MCSDK_beta2>/tools/writer/eeprom/evm6678l/bin/
      • Rename file to app.dat
      • Make sure eepromwriter_input.txt is set to load app.dat to I2C address 81 (0x51)
        • Other parameters not changed:
        • start_addr = 0
        • swap_data = 0 (Needs to be set this way, and is by default, see the readme.txt in the I2C writer)
      • Power-down EVM
      • Set boot pins to little endian "No Boot"
      • Launch the EVM6678 target configuration
      • Load the evm6678l.gel file that accompanied the CCSv5.02 patch
        • Wait for memory map setup to complete
      • Connect to Core 0
        •  Wait for GEL initialization sequence to finish
      • Load Core 0 with <MCSDK_beta2>\tools\writer\eeprom\evmc6678l\bin\eepromwriter_evm6678.out
      • Load memory location 0x80000000 with the app.dat file, making sure to use the header information to set the size of the memory block
      • Run the EEPROM writer program
      • ===Everything runs successfully
    • Configure IBL
      • Terminate previous debug session (load IBL session)
      • Power-down EVM
      • Power-up EVM
      • Boot pins still set to little endian "No Boot"
      • Launch the EVM6678 target configuration
      • Load the evm6678l.gel file that accompanied the CCSv5.02 patch
        • Wait for memory map setup to complete
      • Connect to Core 0
        •  Wait for GEL initialization sequence to finish
      • Load Core 0 with <MCSDK_beta2>\tools\boot_loader\ibl\src\util\i2cConfig\i2cparam_c661x_le.out
      • Load GEL file <MCSDK_beta2>\tools\boot_loader\ibl\src\util\i2cConfig\i2cConfig.gel
      • Run the i2cparam_c661x_le.out program
      • Run the EVM c6678 IBL -> setConfig_c6678_main GEL script
      • Suggested to wait 30s for this to complete
      • Press "Enter"
      • ===Program states that the I2C table write completed
    • Program NAND
      • Terminate previous debug session (configure IBL session)
      • Power-down EVM
      • Copy C:\cssv5.02\mcsdk_2_00_00_beta2\tools\post\evmc6678l\bin\post_evm6678l.out to <MCSDK_beta2>\tools\bin2ccs\
      • Rename post_evm6678l.out to app.out
      • Double click on bin2css.bat to generate app.dat
      • Copy app.dat to <MCSDK_beta2>\tools\writer\nand\evmc6678l\bin\
      • Power-up EVM
      • Boot pins still set to little endian "No Boot"
      • Launch the EVM6678 target configuration
      • Load the evm6678l.gel file that accompanied the CCSv5.02 patch
        • Wait for memory map setup to complete
      • Connect to Core 0
        •  Wait for GEL initialization sequence to finish
      • Load Core 0 with <MCSDK_beta2>\tools\writer\nand\evmc6678l\bin\nandwriter_evm6678l.out
      • Load memory location 0x80000000 with the app.dat file, making sure to use the header information to set the size of the memory block
      • Run the nandwriter_evm6678l.out program
      • ===Console states that the NAND programing completed successfully
    • Test NAND
      • Terminate previous debug session (program NAND session)
      • Power-down EVM
      • Configure boot pins for little endian NAND boot (via the definition given in the <MCSDK_beta2>\tools\boot_loader\ibl\doc\evmc6678-instructions.txt
        • "   NAND Boot:
             Set the dip switches (pin1, pin2, pin3, pin4) to:
              SW3(off, off, on, off),
              SW4(on, off, on, on),
              SW5(on, on, on, off),
              SW6(on, on, on, on)
             This will set the boot para index to 2 to boot the NAND image, by default
             the boot configuration table sets the NAND offset address to be 16384
             (start of block 1) and image format to be BBLOB for image 0."
      • Power-up the EVM

     

    Regards,

    Travis

  • Hi Travis,

    I know that must have been time consuming.  Thank you for going through all of that.  The first error was a typo on my part, I copied the wrong line.  I have just edited my original post to reflect the corrected line.

    We are now trying your first suggestion to verify that the IBL is properly loaded.  Once that is done we will then implement your latter two annotations.  And report back with our findings.

    Thanks again, Travis!

     

  • Hello,

     

    We found the root cause of the problem. The logical block to physical block and physical block to logical block mapping are not done correctly in the IBL NAND driver, this will cause a non-bblob(e.g. ELF, COFF) image loading fail. Please replace with the following code in tools\boot_loader\ibl\src\driver\nand\nand.c and re-build IBL or use the attached i2crom_0x51_c6678_le.txt to re-program IBL:

    Int32 nand_open (void *ptr_driver, void (*asyncComplete)(void *))
    {

        ...   

        /* Construct the logical to physical block array */ 
        for (i = startBlock, j = 0; i < nandmcb.devInfo.totalBlocks; i++)  {
            if (nandmcb.blocks[i] != 0xff)
                nandmcb.logicalToPhysMap[j++] = i;
        }

        /* Construct the physical to logical block array */
        for (i = startBlock, j = 0; i < nandmcb.devInfo.totalBlocks; i++)  {
            if (nandmcb.blocks[i] == 0xff)
                nandmcb.physToLogicalMap[i] = 0xff;
            else
                nandmcb.physToLogicalMap[i] = j++;
        }
    3884.i2crom_0x51_c6678_le.txt

        /* Seek to the first byte of the file */
        nandmcb.fpos                = -1;      /* Force a read on the first seek */
        nandmcb.currentLogicalBlock = 0xffffffff;
        nandmcb.currentPage         = 0xffffffff;

        nand_seek (0, 0);

        return (0);
    }

    Regards,
    Hao.

  • Hao, thank you very much for your help.  I will modify the IBL, recompile and see what I can do.  I'll report back with results.

    Thanks again!

  • Travis, Hao, thank you very much for your help.  We were able to boot the POST program from NAND following all of your directions.  Thanks again!

  • great!  sorry it took a while to debug.  i was able to duplicate the isse on my evm yesterday, and hao had to dig into the ibl to find the problem. 

    regards,

    travis

  • What I need to do for rebuild IBL with this bugfix?

    I tried make c661x. The resulting i2crom.dat has size 228k and I can't write it to I2C.

    Please publish new IBL release with this bugfix.

    Thanks.

  • pup pup,

    The production version of the MCSDK (with this fix) should be on-line tomorrow.  Please check out:

    http://software-dl.ti.com/sdoemb/sdoemb_public_sw/bios_mcsdk/latest/index_FDS.html

     

    If you want to rebuild with current MCSDK beta-2...

    1) replace the nand.c file as Hao mentioned above

    2) rebuild IBL with instructions listed in: C:\Program Files\Texas Instruments\mcsdk_2_00_00_beta2\tools\boot_loader\ibl\doc\release_info.txt

    3) follow the listed instructions above to program into the EEPROM.

     

    Regards,

    Travis

  • Thanks!

    Now I can run my simple program from NAND via I2C IBL. The loading time ~7s. Is it posible to increase the loading speed via I2C IBL ?

  • Not that I'm aware of.  When asking new topic questions, you should start a new thread for better results.

     

    Regards,

    Travis