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.

Need help on secure binding process boot from NAND

Other Parts Discussed in Thread: OMAP-L138, OMAPL138

HI Titus:

I do the binding process boot from NAND based on nand_c674x_c6748_lcdkc6748 project,  I could not find the following functions, could you point where I can find ?

**** Build of configuration Debug for project secureboot ****

"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all

'Building file: ../secure_boot.c'

'Invoking: C6000 Compiler'

"C:/ti/ccsv5/tools/compiler/c6000_7.4.4/bin/cl6x" -mv6740 -g --define=c6748 --define=_DEBUG --define=SKIP_LOW_LEVEL_INIT --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.4/include" --include_path="C:/ti/C6748_StarterWare_1_20_04_01/nandlib/include" --include_path="C:/ti/C6748_StarterWare_1_20_04_01/include" --include_path="C:/ti/C6748_StarterWare_1_20_04_01/include/hw" --include_path="C:/ti/C6748_StarterWare_1_20_04_01/include/c674x" --include_path="C:/ti/C6748_StarterWare_1_20_04_01/include/c674x/c6748" --include_path="C:/ti/C6748_StarterWare_1_20_04_01/grlib/include" --include_path="C:/ti/C6748_StarterWare_1_20_04_01/usblib/include" --include_path="C:/ti/C6748_StarterWare_1_20_04_01/usblib/include" --include_path="C:/ti/C6748_StarterWare_1_20_04_01/examples/lcdkC6748/nand" --include_path="../../SPI_Lib" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="secure_boot.pp"  "../secure_boot.c"

"../secure_boot.c", line 448: warning #552-D: variable "aisPt" was set but never used

'Finished building: ../secure_boot.c'

' '

'Building target: secureboot.out'

'Invoking: C6000 Linker'

"C:/ti/ccsv5/tools/compiler/c6000_7.4.4/bin/cl6x" -mv6740 -g --define=c6748 --define=_DEBUG --define=SKIP_LOW_LEVEL_INIT --display_error_number --diag_warning=225 --abi=coffabi -z -m"secureboot.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.4/lib" -i"../../lib" -i"../../../../../../../binary/c674x/cgt_ccs/nandlib/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/grlib/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/utils/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/usblib/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/ipclib/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/system_config/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/lcdkC6748/platform/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/drivers/Debug" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.4/include" --reread_libs --priority --xml_link_info="secureboot_linkInfo.xml" --rom_model -o "secureboot.out"  "./sk_cwrap.obj" "./sha256.obj" "./sha1.obj" "./sha.obj" "./secure_boot.obj" "./nandlib.obj" "./nand_emifa2.obj" "./aes_keyschedule.obj" "./aes_encrypt.obj" "./aes_decrypt.obj" "./aes_cbc_encrypt.obj" "./aes_cbc_decrypt.obj" "./aes.obj" "../secureboot.cmd" -lutils.lib -ldrivers.lib -lplatform.lib -lgrlib.lib -lSPI_Lib.lib -l"libc.a"

<Linking>

undefined               first referenced

  symbol                     in file     

---------               ----------------

_EMIFAClkConfig         ./secure_boot.obj

_EMIFANANDEdmaInit      ./secure_boot.obj

_EMIFANANDXferSetup     ./secure_boot.obj

_EMIFANANDXferStatusGet ./secure_boot.obj

error #10234-D: unresolved symbols remain

error #10010: errors encountered during linking; "secureboot.out" not built

>> Compilation failure

gmake: *** [secureboot.out] Error 1

gmake: Target `all' not remade because of errors.

**** Build Finished ****

  • Hi Mike,


    _EMIFAClkConfig ./secure_boot.obj

    _EMIFANANDEdmaInit ./secure_boot.obj

    _EMIFANANDXferSetup ./secure_boot.obj

    _EMIFANANDXferStatusGet ./secure_boot.obj


    The log seems to be the "EMIFAClkConfig" was defined no where.

    Where did you get "EMIFAClkConfig" declaration ?
    I presume that you are trying to initialize the NAND in secureboot.c.
    So you can take the code from NAND writer for NAND initialization.

    OMAP-L138_FlashAndBootUtils_2_40/OMAP-L138/CCS/NANDWriter/src/nandwriter.c

    void main( void )
    {
    int status;

    // Init memory alloc pointer
    UTIL_setCurrMemPtr(0);

    // System init
    if (DEVICE_init() != E_PASS)
    {
    exit(1);
    }

    < Do rest of the secure stuff here >


    }

    Q1) Have you written any test code into NAND flash ?

    If so, then after added the NAND init code, try to do "NAND_readPage" function to read your test code headers information (unencrypted)

    Use Ref code for "NAND_readPage"

    mcsdk_1_01_00_02/host-tools/OMAP-L138_FlashAndBootUtils_2.40/Common/drivers/src/nand.c

    Please note that I have appended the last FAQ for NAND secure boot in the following TI wiki.

    http://processors.wiki.ti.com/index.php/Basic_Secure_Boot_for_OMAP-L138_C6748#How_to_do_secure_boot_from_NAND_flash.3F

    Please let me know if you have any issues.
  • Hi Titus:

    I have written the test code to NAND flash.

    I build it based on nand_c674x_c6748_lcdkC6748 project in starterware, how can I get the following functions? are they in a LIb, I can not find where they are.


    **** Build of configuration Debug for project nand_c674x_c6748_lcdkC6748 ****

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
    'Building target: nandReadWrite.out'
    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.4/bin/cl6x" -mv6740 -g --define=c6748 --diag_warning=225 --abi=eabi -z -m"nand_c674x_c6748_lcdkC6748.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.4/lib" -i"C:/ti/C6748_StarterWare_1_20_04_01/build/c674x/cgt_ccs/c6748/lcdkC6748/nand/Debug" -i"C:/OMAPL138_C6748_Generic_Security/5611.security_collateral_update/spi_secure_boot/SPI_Lib" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.4/include" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/drivers/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/lcdkC6748/platform/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/system_config/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/ipclib/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/c6748/usblib/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/utils/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/grlib/Debug" -i"../../../../../../../binary/c674x/cgt_ccs/nandlib/Debug" --reread_libs --xml_link_info="nandReadWrite_linkInfo.xml" --rom_model -o "nandReadWrite.out" "./sk_cwrap.obj" "./sha256.obj" "./sha1.obj" "./sha.obj" "./secure_boot.obj" "./nandlib.obj" "./nand_emifa2.obj" "./nandDma.obj" "./aes_keyschedule.obj" "./aes_encrypt.obj" "./aes_decrypt.obj" "./aes_cbc_encrypt.obj" "./aes_cbc_decrypt.obj" "./aes.obj" "../secureboot.cmd" -l"libc.a" -ldrivers.lib -lutils.lib -lplatform.lib -lsystem_config.lib
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    AES_cbcEncrypt ./secure_boot.obj
    AES_encrypt ./secure_boot.obj
    AES_keySchedule ./secure_boot.obj
    EMIFANANDWaitPinStatusGet ./secure_boot.obj
    SK_allocSC ./secure_boot.obj
    SK_registerSCWP ./secure_boot.obj
    SK_setUserKey ./secure_boot.obj
    _STACK_SIZE ./secure_boot.obj

    error: unresolved symbols remain
    error: errors encountered during linking; "nandReadWrite.out" not built

    >> Compilation failure
    gmake: *** [nandReadWrite.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****
  • Could you please send me your project through private chat and not here.
  • Hi Stalin:
    could you please re-open the private chat, the one you offered a while ago is closed.

    I used the following command to get secureboot.ais when port the security collateral update with nand read and write, compiler shows no error.
    SecureHexAIS_OMAP-L138.exe -ini secureboot.ini -otype binary -o secureboot.ais secureboot.out.
    then run the "secureboot.ais" through "GenericSecureUartHost", it show boot completed. the code does not run. what am i missing. I would like to get your advice.

    Mike
  • Hi Titus:
    Thank you for the best support! You are the best!
    Mike