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.

TMS320C6748: Can't load secure DSP with GenericSecureUartHost.exe

Part Number: TMS320C6748
Other Parts Discussed in Thread: OMAPL138, OMAP-L138, AM1808

Trying to load my program in to a secure C6748 (E) using GenericSecureUartHost.exe.
I read everything I could find here.

This is the response from the loader:

(File IO): Read 149516 bytes from file C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils\MXS_Gmbl.bin.
(Serial Port): Opening COM4 at 115200 baud...
(AIS Parse): Read magic word 0x41504954.
(AIS Parse): Waiting for BOOTME... (power on or reset target now)
(AIS Parse): BOOTME received!
(AIS Parse): Performing Start-Word Sync...
(AIS Parse): Performing Ping Opcode Sync...
(AIS Parse): Processing command 0: 0x58535920.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Secure key loading, entering secure mode.
(AIS Parse): Processing command 1: 0x58535923.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Setting boot exit mode...
(AIS Parse): Set exit mode to 0x00000000.
(AIS Parse): Processing command 2: 0x5853590D.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Executing function...
(AIS Parse): Secure mode; sending signature.
(AIS Parse): Processing command 3: 0x58535921.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading encoded section...
(AIS Parse): Loaded 145216-Byte section to address 0x11800000.
(AIS Parse): Processing command 4: 0x58535921.
(AIS Parse): Performing Opcode Sync...
(Serial Port): Read error: The operation has timed out.
(AIS Parse): I/O Error in read!
(Serial Port): Read error: The operation has timed out.
(AIS Parse): I/O Error in read!
(System): Boot aborted by user.
(Serial Port): Read error: The I/O operation has been aborted because of either a thread exit or an application request.

Please help.

  • Hi,

    I've notified the sw team. They will post their feedback directly here.

    Best Regards,
    Yordan
  • Hello
    Please speed up the answer or help if you can. I am on "hold", waiting to solve this.

    Best regards
    Attila Szalay
  • Hello Attila,

    Sorry for the delay. Is this on a custom board or a TI EVM board?

    What are your AISgen settings? Can you post them here?

    Best,
    Sahin
  • Custom board. Programming and running for years with non secure processors. This is the first time we try to use a secure (E) processor in the board.
    The CCS project is set to generate an .out file.
    Eabi(ELF), little endian.
    Using command line "SecureHexAIS_OMAP-L138 -ini Secure.ini MXS_Gmbl.out" to generate .AIS file.

    The ini file is:
    --------------------------------------------------------------------
    [General]0
    busWidth = 16
    BootMode = NAND
    ;BootMode = legacy
    crcCheckType = NO_CRC
    seqReadEn = ON

    [Security]

    securityType = GENERIC
    bootExitType = NONSECURE
    encryptSections = ALL
    encryptionKey = 4A7E1F56AE545D487C452388A65B0C05
    ;rsaKeyFileName =
    genericSHASelection = SHA256
    ;genKeyHeaderFileName = gen_keyhdr_encrypted.bin

    [PLLANDCLOCKCONFIG]
    ; |------24|------16|-------8|-------0|
    ; PLL0CFG0: | CLKMODE| PLLM | PREDIV | POSTDIV|
    ; PLL0CFG1: | RSVD | PLLDIV1| PLLDIV3| PLLDIV7|
    PLL0CFG0 = 0x00120000
    PLL0CFG1 = 0x00010113
    ; |------24|------16|-------8|-------0|
    ; PLL1CFG0: | PLLM| POSTDIV| PLLDIV1| PLLDIV2|
    ; PLL1CFG1: | RSVD | PLLDIV3|
    PLL1CFG0 = 0x00010101
    PLL1CFG1 = 0x00000005

    [SecureLegacy]
    encryptImage = TRUE

    [TAPSCONFIG]
    TAPSCFG = 0x0000FFFF

    [BinaryInputFile]
    fileName = MXS_Gmbl.out
    ;loadAddress = 0x11800000
    ;entryPointAddress = 0x11800000
    ;entryPointAddress = 0xc1080000
    useEntryPoint = TRUE
    encrypt = TRUE
    --------------------------------------------------------------------

    A 256Mx16 NAND (MT29F4G16ABADAH4) is on CS3 (16 bit data) should be programmed for standalone operation.


    Thanks
    Attila
  • Hello Attila,

    I'm not sure why it's not working. I need to check with the team and get back to you.

    Did you already refer to the Secure Boot Wiki? processors.wiki.ti.com/.../Basic_Secure_Boot_for_OMAP-L138_C6748

    Regards,
    Sahin
  • Thanks. Time is pressuring here thou.
    I could just zip the whole thing and send it to you. I even can send the relevant pages of the schematic pdf files. (Guess you are under nondisclosure agreement?)
    I am completely puzzled and sure when we find the problem it will be simple.
  • Hi Patyi
    We regret the delays in response. Our lead security apps on this device is out of office till Jan 1st week. So potentially the issue may take longer to resolve.
    Can you confirm that the only change you have made in your project / hardware is to move from a non secure to secure version of the device?
    This will help eliminate potentially the possibility of NAND/DDR , other board related issues with your custom hardware as a potential suspect.

    I know you mentioned that you have looked through past E2Es?
    Have you specifically looked at the following
    e2e.ti.com/.../381405

    This was supported by another ex TIer, but it outlines a process and potential care abouts on creating a flash image.

    Can you please confirm that you are not missing anything relevant from this thread?

    Regards
    Mukul
  • I can’t believe that you only have 1 guy who can help!
    I am sure the board is the same as it was. I am the hardware/software designer here.
    I will do some more tests in the mean time and look at the link you sent. Looks something I did not see before.
    :)
  • Sounds good , keep us posted on the tests and see if the other e2e post does help.

    If you are confirming that there is no change in hardware/software except for adding the secure enabled processor and working with the software tools available to generate the image for secure boot, let us focus on the imaging/flashing/binding process.

    Regards
    Mukul
  • Log shows you are using encrypted section loads. Try using simple secure section loads (no encryption) to take one variable away. Please let us know if that changes the behavior.

  • There seems to be no change:

    Command:
    SecureHexAIS_OMAP-L138 -ini Secure.ini -otype binary -o MXS_Gmbl.ais MXS_Gmbl.out

    C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils>SecureHexAIS_OMAP-L138 -ini Secure.ini -otype binary -o MXS_Gmbl.ais MXS_Gmbl.out
    -----------------------------------------------------
    TI Secure AIS Hex File Generator for OMAP-L138
    (C) 2011, Texas Instruments, Inc.
    Ver. 1.25
    -----------------------------------------------------


    Creating boot image for a generic secure device.
    INFO: Boot exit type has been selected as NONSECURE.
    WARNING: Encrypted Key Header data is absent - generating plaintext version.
    The Customer Encryption Key will be transferred in plaintext!
    WARNING: Generic Secure device was specified, but no input sections were indicated for encryption.
    Only boot image signing will take place.
    INFO: Current SHA algorithm is SHA256.
    Begining the Secure AIS file generation.
    AIS file being generated for bootmode: NAND.
    Signature Hash: 03-4A-6E-78-B5-52-94-E3-50-40-C7-47-0F-6F-03-7A-07-27-9B-7A-97-48-04-1A-32-45-6D-99-ED-56-9B-FB
    Signature Byte Count = 60
    Parsing the input object file, MXS_Gmbl.out.
    Signature Hash: DD-89-C5-19-EB-6A-37-19-D8-CD-00-E6-68-D5-1C-BC-67-8C-10-D4-EB-15-74-6B-BA-D0-D9-15-5D-37-A8-30
    Signature Byte Count = 149392
    AIS file generation was successful.
    Wrote 149516 bytes to file MXS_Gmbl.ais.
    Conversion is complete.

    ----------------------------------------------------------------------------------------------------------------------
    GenericSecureUartHost.exe
    "
    (File IO): Read 149516 bytes from file C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils\MXS_Gmbl.ais.
    (Serial Port): Opening COM4 at 115200 baud...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME... (power on or reset target now)
    (AIS Parse): BOOTME received!
    (AIS Parse): Performing Start-Word Sync...
    (AIS Parse): Performing Ping Opcode Sync...
    (AIS Parse): Processing command 0: 0x58535920.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Secure key loading, entering secure mode.
    (AIS Parse): Processing command 1: 0x58535923.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Setting boot exit mode...
    (AIS Parse): Set exit mode to 0x00000000.
    (AIS Parse): Processing command 2: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 3: 0x58535901.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading section...
    (AIS Parse): Loaded 145216-Byte section to address 0x11800000.
    (AIS Parse): Processing command 4: 0x58535901.
    (AIS Parse): Performing Opcode Sync...
    (Serial Port): Read error: The operation has timed out.
    (AIS Parse): I/O Error in read!
    (Serial Port): Read error: The operation has timed out.
    (AIS Parse): I/O Error in read!
    (System): Boot aborted by user.
    (Serial Port): Read error: The I/O operation has been aborted because of either a thread exit or an application request.
    "
    -----------------------------------------------------------------------------------------------------------------
    The Secure.ini file:

    [General]
    busWidth = 16
    BootMode = NAND
    crcCheckType = NO_CRC
    seqReadEn = ON

    [Security]

    securityType = GENERIC
    bootExitType = NONSECURE
    ;encryptSections = ALL
    encryptionKey = 4A7E1F56AE545D487C452388A65B0C05
    ;rsaKeyFileName =
    genericSHASelection = SHA256
    ;genKeyHeaderFileName = gen_keyhdr_encrypted.bin

    ;[PLLANDCLOCKCONFIG]
    ;[PLL0CONFIG]
    ; |------24|------16|-------8|-------0|
    ; PLL0CFG0: | CLKMODE| PLLM | PREDIV | POSTDIV|
    ; PLL0CFG1: | RSVD | PLLDIV1| PLLDIV3| PLLDIV7|
    ;PLL0CFG0 = 0x00120000
    ;PLL0CFG1 = 0x00010113

    ; |------24|------16|-------8|-------0|
    ; PLL1CFG0: | PLLM| POSTDIV| PLLDIV1| PLLDIV2|
    ; PLL1CFG1: | RSVD | PLLDIV3|
    ;[PLL1CONFIG]
    ;PLL1CFG0 = 0x00010101
    ;PLL1CFG1 = 0x00000005

    ;[SecureLegacy]
    ;encryptImage = TRUE

    [TAPSCONFIG]
    TAPSCFG = 0x0000FFFF

    ;[BinaryInputFile]
    ; L2 RAM 0x11800000 256K
    ; DDR2 0xC0000000 256M
    ;fileName = MXS_Gmbl.out
    ;loadAddress = 0x11800000
    ;entryPointAddress = 0x11800000
    ;entryPointAddress = 0xc1080000 (in DDR2)
    ;useEntryPoint = TRUE
    ;encrypt = TRUE
  • It does not work:
    --------------------------------------------------------------------------
    Command:
    SecureHexAIS_OMAP-L138 -ini Secure.ini -otype binary -o MXS_Gmbl.ais MXS_Gmbl.out

    Response:
    C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils>SecureHexAIS_OMAP-L138 -ini Secure.ini -otype binary -o MXS_Gmbl.ais MXS_Gmbl.out
    -----------------------------------------------------
    TI Secure AIS Hex File Generator for OMAP-L138
    (C) 2011, Texas Instruments, Inc.
    Ver. 1.25
    -----------------------------------------------------

    Creating boot image for a generic secure device.
    INFO: Boot exit type has been selected as NONSECURE.
    WARNING: Encrypted Key Header data is absent - generating plaintext version.
    The Customer Encryption Key will be transferred in plaintext!
    WARNING: Generic Secure device was specified, but no input sections were indicated for encryption.
    Only boot image signing will take place.
    INFO: Current SHA algorithm is SHA256.
    Begining the Secure AIS file generation.
    AIS file being generated for bootmode: NAND.
    Signature Hash: B6-FE-9F-C5-6B-8C-37-12-39-9E-11-06-56-54-7E-FB-BE-A5-73-A1-60-D3-F3-3B-BF-FB-D4-14-45-D1-7F-E4
    Signature Byte Count = 60
    Parsing the input object file, MXS_Gmbl.out.
    Signature Hash: DD-89-C5-19-EB-6A-37-19-D8-CD-00-E6-68-D5-1C-BC-67-8C-10-D4-EB-15-74-6B-BA-D0-D9-15-5D-37-A8-30
    Signature Byte Count = 149392
    AIS file generation was successful.
    Wrote 149516 bytes to file MXS_Gmbl.ais.
    Conversion is complete.

    --------------------------------------------------------------------------
    Command:
    GenericSecureUartHost.exe

    Response:
    (File IO): Read 149516 bytes from file C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils\MXS_Gmbl.ais.
    (Serial Port): Opening COM4 at 115200 baud...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME... (power on or reset target now)
    (AIS Parse): BOOTME received!
    (AIS Parse): Performing Start-Word Sync...
    (AIS Parse): Performing Ping Opcode Sync...
    (AIS Parse): Processing command 0: 0x58535920.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Secure key loading, entering secure mode.
    (AIS Parse): Processing command 1: 0x58535923.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Setting boot exit mode...
    (AIS Parse): Set exit mode to 0x00000000.
    (AIS Parse): Processing command 2: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 3: 0x58535901.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading section...
    (AIS Parse): Loaded 145216-Byte section to address 0x11800000.
    (AIS Parse): Processing command 4: 0x58535901.
    (AIS Parse): Performing Opcode Sync...
    (Serial Port): Read error: The operation has timed out.
    (AIS Parse): I/O Error in read!
    (Serial Port): Read error: The operation has timed out.
    (AIS Parse): I/O Error in read!
    (System): Boot aborted by user.
    (Serial Port): Read error: The I/O operation has been aborted because of either a thread exit or an application request.

    --------------------------------------------------------------------------
    Hi Lets try to solve this problem.
    Thanks
    Attila
  • Current ini file:

    [General]
    busWidth = 16
    BootMode = NAND
    crcCheckType = NO_CRC
    seqReadEn = ON

    [Security]

    securityType = GENERIC
    bootExitType = NONSECURE
    ;encryptSections = ALL
    encryptionKey = 4A7E1F56AE545D487C452388A65B0C05
    ;rsaKeyFileName =
    genericSHASelection = SHA256
    ;genKeyHeaderFileName = gen_keyhdr_encrypted.bin

    ;[PLLANDCLOCKCONFIG]
    ;[PLL0CONFIG]
    ; |------24|------16|-------8|-------0|
    ; PLL0CFG0: | CLKMODE| PLLM | PREDIV | POSTDIV|
    ; PLL0CFG1: | RSVD | PLLDIV1| PLLDIV3| PLLDIV7|
    ;PLL0CFG0 = 0x00120000
    ;PLL0CFG1 = 0x00010113

    ; |------24|------16|-------8|-------0|
    ; PLL1CFG0: | PLLM| POSTDIV| PLLDIV1| PLLDIV2|
    ; PLL1CFG1: | RSVD | PLLDIV3|
    ;[PLL1CONFIG]
    ;PLL1CFG0 = 0x00010101
    ;PLL1CFG1 = 0x00000005

    ;[SecureLegacy]
    ;encryptImage = TRUE

    [TAPSCONFIG]
    TAPSCFG = 0x0000FFFF

    ;[BinaryInputFile]
    ; L2 RAM 0x11800000 256K
    ; DDR2 0xC0000000 256M
    ;fileName = MXS_Gmbl.out
    ;loadAddress = 0x11800000
    ;entryPointAddress = 0x11800000
    ;entryPointAddress = 0xc1080000 (in DDR2)
    ;useEntryPoint = TRUE
    ;encrypt = TRUE
  • Can you please indicate what is the value of the OSCIN that you have used on your custom board. Do the PLLM, divider values match with the OSCIN that you have used. Is the image that you are trying to use loading any section of code into mDDR/DDR2 memory? If there is any load section fro DDR then you need to configure PLL1 and EMIF using your INI script.  Based on your description, this appears to be an IO issue rather than security related issue.

    I recommend that you use the INI sectting from from the file  OMAP-L138_sec2nonsec.ini or OMAP-L138_generic_secure.ini in the OMAPL138 secure package that is available here and try and see if you can unlock the JTAG using a simple binary. Do you have a version  of the board with non-secure device, have you performed any regression tests on the UART interface there is no issues with serial IO?

    I have attached an example JTAG unlock binary that you can try on your board that simply unlocks the JTAG:

    Secure_LCDK.zip

    these have been tested to work on TI evaluation platforms.

    Regards,

    Rahul

  • I sent this yesterday but it disappeared!

    I want to continue debugging my problem.

    =====================================================
    My conversion command is:

    SecureHexAIS_OMAP-L138 -ini Secure.ini -otype binary -o MXS_Gmbl.ais MXS_Gmbl.out

    -----------------------------------------------------
    TI Secure AIS Hex File Generator for OMAP-L138
    (C) 2011, Texas Instruments, Inc.
    Ver. 1.25
    -----------------------------------------------------


    Creating boot image for a generic secure device.
    INFO: Boot exit type has been selected as NONSECURE.
    WARNING: Encrypted Key Header data is absent - generating plaintext version.
    The Customer Encryption Key will be transferred in plaintext!
    WARNING: Generic Secure device was specified, but no input sections were indicated for encryption.
    Only boot image signing will take place.
    INFO: Current SHA algorithm is SHA256.
    Begining the Secure AIS file generation.
    AIS file being generated for bootmode: NAND.
    Signature Hash: CC-C8-8C-07-11-76-9B-83-15-8B-14-21-69-E8-EE-DA-85-E2-EB-23-28-AE-FA-BB-04-9F-49-67-55-9F-C9-1F
    Signature Byte Count = 60
    Parsing the input object file, MXS_Gmbl.out.
    Signature Hash: DD-89-C5-19-EB-6A-37-19-D8-CD-00-E6-68-D5-1C-BC-67-8C-10-D4-EB-15-74-6B-BA-D0-D9-15-5D-37-A8-30
    Signature Byte Count = 149392
    AIS file generation was successful.
    Wrote 149516 bytes to file MXS_Gmbl.ais.
    Conversion is complete.
    --------------------------------------------------------------------------

    =====================================================
    My ini file is:

    [General]
    busWidth = 16
    BootMode = NAND
    crcCheckType = NO_CRC
    seqReadEn = ON

    [Security]

    securityType = GENERIC
    bootExitType = NONSECURE
    ;encryptSections = ALL
    encryptionKey = 4A7E1F56AE545D487C452388A65B0C05
    ;rsaKeyFileName =
    genericSHASelection = SHA256
    ;genKeyHeaderFileName = gen_keyhdr_encrypted.bin

    ;[PLLANDCLOCKCONFIG]
    ;[PLL0CONFIG]
    ; |------24|------16|-------8|-------0|
    ; PLL0CFG0: | CLKMODE| PLLM | PREDIV | POSTDIV|
    ; PLL0CFG1: | RSVD | PLLDIV1| PLLDIV3| PLLDIV7|
    ;PLL0CFG0 = 0x00120000
    ;PLL0CFG1 = 0x00010113

    ; |------24|------16|-------8|-------0|
    ; PLL1CFG0: | PLLM| POSTDIV| PLLDIV1| PLLDIV2|
    ; PLL1CFG1: | RSVD | PLLDIV3|
    ;[PLL1CONFIG]
    ;PLL1CFG0 = 0x00010101
    ;PLL1CFG1 = 0x00000005

    ;[SecureLegacy]
    ;encryptImage = TRUE

    [TAPSCONFIG]
    TAPSCFG = 0x0000FFFF

    ;[BinaryInputFile]
    ; L2 RAM 0x11800000 256K
    ; DDR2 0xC0000000 256M
    ;fileName = MXS_Gmbl.out
    ;loadAddress = 0x11800000
    ;entryPointAddress = 0x11800000
    ;entryPointAddress = 0xc1080000 (in DDR2)
    ;useEntryPoint = TRUE
    ;encrypt = TRUE


    =====================================================
    Trying to load with GenericSecureUartHost.exe :

    (File IO): Read 149516 bytes from file C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils\MXS_Gmbl.ais.
    (Serial Port): Opening COM4 at 115200 baud...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME... (power on or reset target now)
    (AIS Parse): BOOTME received!
    (AIS Parse): Performing Start-Word Sync...
    (AIS Parse): Performing Ping Opcode Sync...
    (AIS Parse): Processing command 0: 0x58535920.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Secure key loading, entering secure mode.
    (AIS Parse): Processing command 1: 0x58535923.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Setting boot exit mode...
    (AIS Parse): Set exit mode to 0x00000000.
    (AIS Parse): Processing command 2: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 3: 0x58535901.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading section...
    (AIS Parse): Loaded 145216-Byte section to address 0x11800000.
    (AIS Parse): Processing command 4: 0x58535901.
    (AIS Parse): Performing Opcode Sync...
    (Serial Port): Read error: The operation has timed out.
    (AIS Parse): I/O Error in read!
    (Serial Port): Read error: The operation has timed out.
    (AIS Parse): I/O Error in read!
    (System): Boot aborted by user.
    (Serial Port): Read error: The I/O operation has been aborted because of either a thread exit or an application request.


    Please advise

    Attila
  • Our messages crossed.
    I will do what you asked and let you know.
    Thanks.
    Attila
  • OSCIN = 24.000MHz
    Your test file programmed.
    ==============================================================================
    (File IO): Read 1580 bytes from file C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils\dsp_exitnonsecure_unlockjtag.bin.
    (Serial Port): Opening COM4 at 115200 baud...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME... (power on or reset target now)
    (AIS Parse): BOOTME received!
    (AIS Parse): Performing Start-Word Sync...
    (AIS Parse): Performing Ping Opcode Sync...
    (AIS Parse): Processing command 0: 0x58535920.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Secure key loading, entering secure mode.
    (AIS Parse): Processing command 1: 0x58535923.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Setting boot exit mode...
    (AIS Parse): Set exit mode to 0x00000000.
    (AIS Parse): Processing command 2: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 3: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 4: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 5: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 6: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 7: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 8: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 9: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 10: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 11: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 12: 0x58535921.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading encoded section...
    (AIS Parse): Loaded 864-Byte section to address 0x00831000.
    (AIS Parse): Processing command 13: 0x58535921.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading encoded section...
    (AIS Parse): Loaded 84-Byte section to address 0x00831360.
    (AIS Parse): Processing command 14: 0x58535906.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Performing jump and close...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): AIS complete. Jump to address 0x00831260.
    (AIS Parse): Waiting for DONE...
    (AIS Parse): Boot completed successfully.
    (Serial Port): Closing COM4.
    ==============================================================================

    The PLLM, divider values match with the OSCIN that I use.
    Not using mDDR/DDR2 memory for code or data when loading.
    I have over 30 the boards with non-secure device, did not performed any regression tests on the UART interface but there are no issues with the serial IO.The UART is used for initial programming on about 30 boards. Also the same interface is use on an operating system to connect to a PC to setup and monitor the system.
  • Thanks for providing the information.  I have attached the INI file that was used to generate the binary that I shared which seems to be loading fine on your board. Can you use it to regenerate the secure binary using your .out and let us know if there is any change in behavior.

    OMAP-L138_sec2nonsec.zip

    Also, if possible please post the .map file for the binary you are trying to load for our reference.  I am not completely sure what is causing the issue with your binary yet but it could be clock related which is why I was suspecting issue with the PLL setup. 

    Regards,

    Rahul

  • It does not work with your .ini file.
    How do I post the .map file?
  • I uploaded the map file, but not sure if you have it?

  • No, I did not receive the map file. Can you create a .zip with the map file and then attach it using the E2E Rich Editor.

  • I looked at the linker map file for your application and it appears you have a couple of sections that will need the boot loader to setup the EMIFA and EMIFB ( for DDR) before it can load the memory sections. you application places code/data sections in the EMIFACS4 and DDR sections but your INI file is not configuring those interfaces as far as I can tell:

    I would recommend you first try to boot load an application that gets loaded on the onchip memory only and then add configuration for PLL, EMIFA and EMIFB before you can boot load the full application. Other option that will allow more debug options is to create 2 stage boot, first stage dioes the secure boot and loads stage 1 in the on chip memory and then then you can initialize EMIFA and DDR memory and load the rest of the application.

    Regards,

    Rahul

  • Those should be no-load zones.
    "
    MEMORY
    {
    .
    EMIFACS4 o = 0x64000000 l = 0x00100000 /* 32MB FRAM (CS4) 512K x 16 */
    EMIFACS5 o = 0x66000000 l = 0x02000000 /* 32MB fPGA (CS5) */
    SHRAM o = 0x80000000 l = 0x00020000 /* 128KB Shared RAM */
    DDR2 o = 0xC0000000 l = 0x08000000 /* 128MB DDR2 8 banks x 8M x 2(16 bit) */
    .
    .
    SECTIONS
    {
    .
    .storagemem: type = NOINIT > EMIFACS4 // Nonvolatile data strorage
    .siggenbuffr: type = NOINIT > DDR2 // DDR2 RAM for signal generator buffers (scope function)
    .
    "
    but I will try to get them out of the program for now.
    Let you know.
  • 5657.MXS_Gmbl.zipI removed those sections from the program.

    Still can't load.

    (File IO): Read 149808 bytes from file C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils\MXS_Gmbl.ais.

    (Serial Port): Opening COM4 at 115200 baud...

    (AIS Parse): Read magic word 0x41504954.

    (AIS Parse): Waiting for BOOTME... (power on or reset target now)

    (AIS Parse): BOOTME received!

    (AIS Parse): Performing Start-Word Sync...

    (AIS Parse): Performing Ping Opcode Sync...

    (AIS Parse): Processing command 0: 0x58535920.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Secure key loading, entering secure mode.

    (AIS Parse): Processing command 1: 0x58535923.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Setting boot exit mode...

    (AIS Parse): Set exit mode to 0x00000000.

    (AIS Parse): Processing command 2: 0x5853590D.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Executing function...

    (AIS Parse): Secure mode; sending signature.

    (AIS Parse): Processing command 3: 0x5853590D.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Executing function...

    (AIS Parse): Secure mode; sending signature.

    (AIS Parse): Processing command 4: 0x5853590D.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Executing function...

    (AIS Parse): Secure mode; sending signature.

    (AIS Parse): Processing command 5: 0x5853590D.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Executing function...

    (AIS Parse): Secure mode; sending signature.

    (AIS Parse): Processing command 6: 0x5853590D.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Executing function...

    (AIS Parse): Secure mode; sending signature.

    (AIS Parse): Processing command 7: 0x5853590D.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Executing function...

    (AIS Parse): Secure mode; sending signature.

    (AIS Parse): Processing command 8: 0x5853590D.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Executing function...

    (AIS Parse): Secure mode; sending signature.

    (AIS Parse): Processing command 9: 0x58535921.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Loading encoded section...

    (AIS Parse): Loaded 145216-Byte section to address 0x11800000.

    (AIS Parse): Processing command 10: 0x58535921.

    (AIS Parse): Performing Opcode Sync...

    (Serial Port): Read error: The operation has timed out.

    (AIS Parse): I/O Error in read!

    (Serial Port): Read error: The operation has timed out.

    (AIS Parse): I/O Error in read!

    (System): Boot aborted by user.

    (Serial Port): Read error: The I/O operation has been aborted because of either a thread exit or an application request.

  • So I built a small project years ago to test if the boards is running at all:
    #include "Sprjt.h"

    volatile unsigned int RealTime_millisec;
    volatile unsigned int RealTime_Second;

    int main(void)
    {
    OLS80100_Init(); // Initialize hardware
    int time;

    while(1) // Poll loop
    {
    mGPIO_SET(GPIOBANK_0,LED_LIVE); // Turn "Live" LED ON.
    time = 5000000;
    while ( time-- > 0);
    mGPIO_CLR(GPIOBANK_0,LED_LIVE); // Turn "Live" LED OFF.
    time = 5000000;
    while ( time-- > 0);

    }
    }
    "
    I updated this and fed through the secure conversion. Using loading successfully. But does not run:

    (File IO): Read 6328 bytes from file C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils\MXS_Gmbl.ais.
    (Serial Port): Opening COM4 at 115200 baud...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME... (power on or reset target now)
    (AIS Parse): BOOTME received!
    (AIS Parse): Performing Start-Word Sync...
    (AIS Parse): Performing Ping Opcode Sync...
    (AIS Parse): Processing command 0: 0x58535920.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Secure key loading, entering secure mode.
    (AIS Parse): Processing command 1: 0x58535923.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Setting boot exit mode...
    (AIS Parse): Set exit mode to 0x00000000.
    (AIS Parse): Processing command 2: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 3: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 4: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 5: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 6: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 7: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 8: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 9: 0x58535921.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading encoded section...
    (AIS Parse): Loaded 5824-Byte section to address 0x80000000.
    (AIS Parse): Processing command 10: 0x58535921.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading encoded section...
    (AIS Parse): Loaded 56-Byte section to address 0x80001ED8.
    (AIS Parse): Processing command 11: 0x58535906.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Performing jump and close...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): AIS complete. Jump to address 0x800014C0.
    (AIS Parse): Waiting for DONE...
    (AIS Parse): Boot completed successfully.
    (Serial Port): Closing COM4.

    Attila
  • So I used an old test program, refreshed it and converted it using the SecureHexAIS_OMAP-L138.exe
    -----------------------------------------
    #include "Sprjt.h"

    volatile unsigned int RealTime_millisec;
    volatile unsigned int RealTime_Second;

    int main(void)
    {
    OLS80100_Init(); // Initialize hardware
    int time;

    while(1) // Poll loop
    {
    mGPIO_SET(GPIOBANK_0,LED_LIVE); // Turn "Live" LED ON.
    time = 5000000;
    while ( time-- > 0);
    mGPIO_CLR(GPIOBANK_0,LED_LIVE); // Turn "Live" LED OFF.
    time = 5000000;
    while ( time-- > 0);
    }
    }
    -----------------------------------------

    It loaded ! But does not run.

    -----------------------------------------
    (File IO): Read 6328 bytes from file C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils\MXS_Gmbl.ais.
    (Serial Port): Opening COM4 at 115200 baud...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME... (power on or reset target now)
    (AIS Parse): BOOTME received!
    (AIS Parse): Performing Start-Word Sync...
    (AIS Parse): Performing Ping Opcode Sync...
    (AIS Parse): Processing command 0: 0x58535920.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Secure key loading, entering secure mode.
    (AIS Parse): Processing command 1: 0x58535923.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Setting boot exit mode...
    (AIS Parse): Set exit mode to 0x00000000.
    (AIS Parse): Processing command 2: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 3: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 4: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 5: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 6: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 7: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 8: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 9: 0x58535921.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading encoded section...
    (AIS Parse): Loaded 5824-Byte section to address 0x80000000.
    (AIS Parse): Processing command 10: 0x58535921.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading encoded section...
    (AIS Parse): Loaded 56-Byte section to address 0x80001ED8.
    (AIS Parse): Processing command 11: 0x58535906.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Performing jump and close...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): AIS complete. Jump to address 0x800014C0.
    (AIS Parse): Waiting for DONE...
    (AIS Parse): Boot completed successfully.
    (Serial Port): Closing COM4.
    -----------------------------------------

    Attila
  • Can you EXIT in NONSECURE and add the TAPCONFIG to unlock the JTAG in the INI file. I would like to confirm the device booted and started executing main function in your application. I hope the init calls that you have in main are setting up the pinmux for the GPIO LED that you are trying to toggle and that you have verified this code on a non-secure device.

    Regards,
    Rahul
  • Used a test program from years ago, just blinks an LED.
    Program was tested in a non-secure DSP and works. It loads but does not run with the secure DSP.

    Here are the details.

    Windows command:
    SecureHexAIS_OMAP-L138 -ini OMAP-L138_sec2nonsec.ini -otype binary -o m.ais m.out


    ************************************************************************************
    The OMAP-L138_sec2nonsec.ini file:

    ; General settings that can be overwritten in the host code
    ; that calls the AISGen library.
    [General]
    ; Can be 8 or 16 - used in emifa
    busWidth=8

    ; SPIMASTER,I2CMASTER,EMIFA,NAND,EMAC,UART,PCI,HPI,USB,MMC_SD,VLYNQ,RAW
    BootMode=none

    ; 8,16,24 - used for SPI,I2C
    ;AddrWidth=8

    ; NO_CRC,SECTION_CRC,SINGLE_CRC
    crcCheckType=NO_CRC

    ; TRUE/ON or FALSE/OFF
    seqReadEn=ON

    ; Specify the symbol name for the boot finalize function
    ;FinalFxnSymbolName=none


    ; Security settings (keys, options, list of sections to encrypt, etc.)
    [Security]

    ; Security Type: GENERIC, CUSTOM, NONE
    securityType=GENERIC

    ; Boot Exit Type: NONSECURE, SECUREWITHSK
    ; NONSECURE = Device switches from secure type to non-secure type, jumping to loaded code
    ; (no secure kernel since no longer secure device).
    ; SECUREWITHSK = Device remains as secure type, secure kernel is loaded, allowing run-time
    ; security context switching.
    bootExitType = NONSECURE

    ; Option to include in the generated key header the flag to force the JTAG off
    ;genericJTAGForceOff=FALSE

    ; Encrypt section list (ALL or comma-separated list of section names)
    encryptSections=ALL

    ; CEK used for AES encryption of data - must be string of 32 hexadecimal characters
    encryptionKey=4A7E1F56AE545D487C452388A65B0C05

    ; Debug key
    ;keyEncryptionKey=0B94A91D33E597097F6C426F8F016872

    ; SHA Algorithm Selection
    genericSHASelection = SHA256

    ; Binary file containing secure key header for generic device
    ;genKeyHeaderFileName=key_hdr_SHA1_enc.bin



    ; This section allows setting the PLL0 system clock with a
    ; specified multiplier and divider as shown. The clock source
    ; can also be chosen for internal or external.
    ; |------24|------16|-------8|-------0|
    ; PLL0CFG0: | CLKMODE| PLLM | PREDIV | POSTDIV|
    ; PLL0CFG1: | RSVD | PLLDIV1| PLLDIV3| PLLDIV7|
    ;[PLL0CONFIG]
    ;PLL0CFG0 = 0x00130001
    ;PLL0CFG1 = 0x00000104

    ; This section allows setting up the PLL1. Usually this will
    ; take place as part of the EMIF3a DDR setup. The format of
    ; the input args is as follows:
    ; |------24|------16|-------8|-------0|
    ; PLL1CFG0: | PLLM| POSTDIV| PLLDIV1| PLLDIV2|
    ; PLL1CFG1: | RSVD | PLLDIV3|
    ;[PLL1CONFIG]
    ;PLL1CFG0 = 0x00000000
    ;PLL1CFG1 = 0x00000000

    ; This section lets us configure the peripheral interface
    ; of the current booting peripheral (I2C, SPI, or UART).
    ; Use with caution. The format of the PERIPHCLKCFG field
    ; is as follows:
    ; SPI: |------24|------16|-------8|-------0|
    ; | RSVD |PRESCALE|
    ;
    ; I2C: |------24|------16|-------8|-------0|
    ; | RSVD |PRESCALE| CLKL | CLKH |
    ;
    ; UART: |------24|------16|-------8|-------0|
    ; | RSVD | OSR | DLH | DLL |
    ;[PERIPHCLKCFG]
    ;PERIPHCLKCFG = 0x00000000


    ; This section allow setting the MPU1 or MPU2. If the
    ; rangenum is out of the allowed range then all the ranges
    ; (including the fixed range) take the start, end, and
    ; protection values.
    ; |------24|------16|----------8|----------0|
    ; MPUSELECT: | RSVD | mpuNum | rangeNum |
    ; STARTADDR: | startAddr |
    ; ENDADDR: | endAddr |
    ; MPPAVALUE: | mppaValue |
    ;[MPUCONFIG]
    ;MPUSELECT = 0x000001FF
    ;STARTADDR = 0x00000000
    ;ENDADDR = 0xFFFFFFFF
    ;MPPAVALUE = 0xFFFFFFFF



    ; This section can be used to configure the PLL1 and the EMIF3a registers
    ; for starting the DDR2 interface.
    ; See PLL1CONFIG section for the format of the PLL1CFG fields.
    ; |------24|------16|-------8|-------0|
    ; PLL1CFG0: | PLL1CFG |
    ; PLL1CFG1: | PLL1CFG |
    ; DDRPHYC1R: | DDRPHYC1R |
    ; SDCR: | SDCR |
    ; SDTIMR: | SDTIMR |
    ; SDTIMR2: | SDTIMR2 |
    ; SDRCR: | SDRCR |
    ; CLK2XSRC: | CLK2XSRC |
    ;[EMIF3DDR]
    ;PLL1CFG0 = 0x15010001
    ;PLL1CFG1 = 0x00000002
    ;DDRPHYC1R = 0x000000C4
    ;SDCR = 0x0A034622
    ;SDTIMR = 0x184929C8
    ;SDTIMR2 = 0xB80FC700
    ;SDRCR = 0x00000406
    ;CLK2XSRC = 0x00000000

    ; This section allow setting the MPU1 or MPU2. If the
    ; rangenum is out of the allowed range then all the ranges
    ; (including the fixed range) take the start, end, and
    ; protection values.
    ; |------24|------16|----------8|----------0|
    ; MPUSELECT: | RSVD | mpuNum | rangeNum |
    ; STARTADDR: | startAddr |
    ; ENDADDR: | endAddr |
    ; MPPAVALUE: | mppaValue |
    ;
    ; This MPU control must happen after the DDR init or else the
    ; MPU control has no effect
    ;[MPUCONFIG]
    ;MPUSELECT = 0x000002FF
    ;STARTADDR = 0x00000000
    ;ENDADDR = 0xFFFFFFFF
    ;MPPAVALUE = 0xFFFFFFFF

    ; This section can be used to configure the EMIFA to use
    ; CS0 as an SDRAM interface. The fields required to do this
    ; are given below.
    ; |------24|------16|-------8|-------0|
    ; SDBCR: | SDBCR |
    ; SDTIMR: | SDTIMR |
    ; SDRSRPDEXIT: | SDRSRPDEXIT |
    ; SDRCR: | SDRCR |
    ; DIV4p5_CLK_ENABLE: | DIV4p5_CLK_ENABLE |
    ;[EMIF25SDRAM]
    ;SDBCR = 0x00004421
    ;SDTIMR = 0x42215810
    ;SDRSRPDEXIT = 0x00000009
    ;SDRCR = 0x00000410
    ;DIV4p5_CLK_ENABLE = 0x00000001

    ; This section can be used to configure the async chip selects
    ; of the EMIFA (CS2-CS5). The fields required to do this
    ; are given below.
    ; |------24|------16|-------8|-------0|
    ; A1CR: | A1CR |
    ; A2CR: | A2CR |
    ; A3CR: | A3CR |
    ; A4CR: | A4CR |
    ; NANDFCR: | NANDFCR |
    ;[EMIF25ASYNC]
    ;A1CR = 0x00000000
    ;A2CR = 0x00000000
    ;A3CR = 0x00000000
    ;A4CR = 0x00000000
    ;NANDFCR = 0x00000000

    ; This section should be used in place of PLL0CONFIG when
    ; the I2C, SPI, or UART modes are being used. This ensures that
    ; the system PLL and the peripheral's clocks are changed together.
    ; See PLL0CONFIG section for the format of the PLL0CFG fields.
    ; See PERIPHCLKCFG section for the format of the CLKCFG field.
    ; |------24|------16|-------8|-------0|
    ; PLL0CFG0: | PLL0CFG |
    ; PLL0CFG1: | PLL0CFG |
    ; PERIPHCLKCFG: | CLKCFG |
    [PLLANDCLOCKCONFIG]
    PLL0CFG0 = 0x00180001
    PLL0CFG1 = 0x00000B05
    PERIPHCLKCFG = 0x00000051

    ; This section should be used to setup the power state of modules
    ; of the two PSCs. This section can be included multiple times to
    ; allow the configuration of any or all of the device modules.
    ; |------24|------16|-------8|-------0|
    ; LPSCCFG: | PSCNUM | MODULE | PD | STATE |
    ;[PSCCONFIG]
    ;LPSCCFG = 0x01030003

    ; This section allows setting of a single PINMUX register.
    ; This section can be included multiple times to allow setting
    ; as many PINMUX registers as needed.
    ; |------24|------16|-------8|-------0|
    ; REGNUM: | regNum |
    ; MASK: | mask |
    ; VALUE: | value |
    ;[PINMUX]
    ;REGNUM = 5
    ;MASK = 0x00FF0000
    ;VALUE = 0x00880000

    ; No Params required - simply include this section for the fast boot function to be called
    ;[FASTBOOT]

    ; This section allows configuration of one the systme IOPUs.
    ; The iopuNum field must be valid (0-5) and then mppaStart
    ; and mppaend fields allow setting a range of mppa MMRs to the
    ; same supplied mppa value.
    ; IOPUSELECT: | RSVD | iopuNum| mppaStart | mppaEnd |
    ; MPPAVALUE: | mppaValue |
    [IOPUCONFIG]
    IOPUSELECT = 0x000000FF
    MPPAVALUE = 0xFFFFFFFF

    [IOPUCONFIG]
    IOPUSELECT = 0x000100FF
    MPPAVALUE = 0xFFFFFFFF

    [IOPUCONFIG]
    IOPUSELECT = 0x000200FF
    MPPAVALUE = 0xFFFFFFFF

    [IOPUCONFIG]
    IOPUSELECT = 0x000300FF
    MPPAVALUE = 0xFFFFFFFF

    [IOPUCONFIG]
    IOPUSELECT = 0x000600FF
    MPPAVALUE = 0xFFFFFFFF

    ; This section allow setting the MPU1 or MPU2. If the
    ; rangenum is out of the allowed range then all the ranges
    ; (including the fixed range) take the start, end, and
    ; protection values.
    ; |------24|------16|----------8|----------0|
    ; MPUSELECT: | RSVD | mpuNum | rangeNum |
    ; STARTADDR: | startAddr |
    ; ENDADDR: | endAddr |
    ; MPPAVALUE: | mppaValue |
    ;[MPUCONFIG]
    ;MPUSELECT = 0x000001FF
    ;STARTADDR = 0x00000000
    ;ENDADDR = 0x00000000
    ;MPPAVALUE = 0xFFFFFFFF

    ; This section can be used to configure the PLL1 and the EMIF3a registers
    ; for starting the DDR2 interface.
    ; See PLL1CONFIG section for the format of the PLL1CFG fields.
    ; |------24|------16|-------8|-------0|
    ; PLL1CFG0: | PLL1CFG |
    ; PLL1CFG1: | PLL1CFG |
    ; DDRPHYC1R: | DDRPHYC1R |
    ; SDCR: | SDCR |
    ; SDTIMR: | SDTIMR |
    ; SDTIMR2: | SDTIMR2 |
    ; SDRCR: | SDRCR |
    ; CLK2XSRC: | CLK2XSRC |

    ; Logic PD L138 EVM with mDDR @132 MHz
    ;[EMIF3DDR]
    ;PLL1CFG0 = 0x15010001
    ;PLL1CFG1 = 0x00000002
    ;DDRPHYC1R = 0x000000C4
    ;SDCR = 0x0A034622
    ;SDTIMR = 0x184929C8
    ;SDTIMR2 = 0xB80FC700
    ;SDRCR = 0x00000406
    ;CLK2XSRC = 0x00000000


    ; SDI AM1808 with DDR @150 MHz
    ;[EMIF3DDR]
    ;PLL1CFG0 = 0x18010001
    ;PLL1CFG1 = 0x00000002
    ;DDRPHYC1R = 0x00000047
    ;SDCR = 0x08934832
    ;SDTIMR = 0x204929C9
    ;SDTIMR2 = 0x0C12C722
    ;SDRCR = 0x00000406
    ;CLK2XSRC = 0x00000000

    ; This function allows the user to selectively open up the
    ; the debug TAPs of the device. Since the function is not
    ; executed until the signature is checked, it does not
    ; pose a security issue.
    ; |------24|------16|----------8|----------0|
    ; TAPSCFG: | RSVD | tapscfg |
    [TAPSCONFIG]
    TAPSCFG = 0x0000FFFF


    ************************************************************************************
    Converting:

    WARNING: Encrypted Key Header data is absent - generating plaintext version.
    The Customer Encryption Key will be transferred in plaintext!
    INFO: Current SHA algorithm is SHA256.
    Begining the Secure AIS file generation.
    AIS file being generated for bootmode: NONE.
    Signature Hash: C2-23-1A-3C-00-4E-C9-34-0F-B1-91-D6-CB-46-96-89-75-54-6A-6A-5E-C5-80-C5-C8-9A-AC-68-D1-45-F2-20
    Signature Byte Count = 68
    Signature Hash: 44-BA-AD-61-79-77-DC-E8-5E-17-C3-49-91-6F-9E-01-48-9D-10-AD-11-4B-41-56-72-1E-A6-F4-E6-35-3A-38
    Signature Byte Count = 16
    Signature Hash: 8A-DD-4B-C8-83-56-4A-0F-B3-DB-14-06-79-B5-6D-A3-44-7B-4B-E8-BB-1A-C1-90-EF-76-CC-0E-0B-8B-52-22
    Signature Byte Count = 16
    Signature Hash: D7-1D-EB-18-0F-32-8E-F9-C3-5B-12-FE-27-B9-FE-C9-59-43-7E-9F-7C-E9-87-BA-EE-EA-74-B0-CE-A7-D2-E3
    Signature Byte Count = 16
    Signature Hash: B8-13-64-A6-66-78-FC-FE-B8-FA-42-6F-65-63-06-E0-27-34-E0-A4-BE-59-02-9F-95-3D-45-94-8A-C2-66-C5
    Signature Byte Count = 16
    Signature Hash: 5D-7A-14-49-19-41-A0-56-09-FB-61-D6-1F-1C-B1-62-DC-FD-D9-58-94-29-81-21-C9-6D-F4-7E-8B-59-09-C0
    Signature Byte Count = 16
    Signature Hash: 12-59-5B-FB-12-5D-D8-72-2B-26-CF-4F-AF-9C-7E-CF-89-04-34-47-84-E1-C0-EE-E1-AF-45-7E-B9-4F-E0-D4
    Signature Byte Count = 12
    Parsing the input object file, m.out.
    Encrypting section .text, since ALL was specified for encryptSections in ini file.
    Encrypting section .cinit, since ALL was specified for encryptSections in ini file.
    Signature Hash: 2E-23-0C-0A-7C-BF-BF-00-AB-4B-D2-16-14-29-44-78-1A-D0-4A-ED-1E-DC-9C-4B-8B-D1-E9-CD-E6-C0-F9-DD
    Signature Byte Count = 5912
    AIS file generation was successful.
    Wrote 6328 bytes to file m.ais.
    Conversion is complete.


    ************************************************************************************
    Loading using GenericSecureUartHost.exe:

    (File IO): Read 6328 bytes from file C:\Projects\CCS\OMAPL138_C6748_Generic_Security\OMAP-L138_Secure\GNU\AISUtils\m.ais.
    (Serial Port): Opening COM4 at 115200 baud...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME... (power on or reset target now)
    (AIS Parse): BOOTME received!
    (AIS Parse): Performing Start-Word Sync...
    (AIS Parse): Performing Ping Opcode Sync...
    (AIS Parse): Processing command 0: 0x58535920.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Secure key loading, entering secure mode.
    (AIS Parse): Processing command 1: 0x58535923.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Setting boot exit mode...
    (AIS Parse): Set exit mode to 0x00000000.
    (AIS Parse): Processing command 2: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 3: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 4: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 5: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 6: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 7: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 8: 0x5853590D.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Executing function...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): Processing command 9: 0x58535921.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading encoded section...
    (AIS Parse): Loaded 5824-Byte section to address 0x80000000.
    (AIS Parse): Processing command 10: 0x58535921.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading encoded section...
    (AIS Parse): Loaded 56-Byte section to address 0x80001ED8.
    (AIS Parse): Processing command 11: 0x58535906.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Performing jump and close...
    (AIS Parse): Secure mode; sending signature.
    (AIS Parse): AIS complete. Jump to address 0x800014C0.
    (AIS Parse): Waiting for DONE...
    (AIS Parse): Boot completed successfully.
    (Serial Port): Closing COM4.
  • Is anybody there?
  • Patyi,

    Sorry, I didn`t catch your last response.  Your INI file is exiting in nonsecure mode with JTAG unlocked. Did you check  if the device unlock the JTAG and if you can connect to the DSP? If you can connect then look at program counter at which the DSP is running the application.

    You can also add a spinlock code in the application at the start of main which will allow you to connect to the DSP and then debug the code. Example provided below"

    volatile int exitSpinLock = 0;
    void Debug_spinLock(void)
    {
        while (exitSpinLock == 0) { }
    }

    After booting the DSP will get trapped in the spinLock and when you connect, you can change the volatile variable so it allows for further execution.

    Regards,

    Rahul

  • SPrjct.zipCant connect to the DSP.

    The hardware pretty much C6748_LCDK look like. I am zipping the hole project, that is a stripped of version (99% off) of what I have as the main project.

  • I sent you SPrjct.zip in my previous message. That is the test project I made. It is 5 years old but still can be loaded and works on a non-secure board. Could you look at that. I really must solve this problem before it becomes a production problem! I am thinking that I even can send you a board with a test jig so someone could actually program it and tell me how to do it. I have millions of things to do and this one of them, but now it turns into the most important. It is getting urgent!
    Thanks a lot
    Attila