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.

[FAQ] AM6xx: How to get the TIFS Keywriter logs

Part Number: AM625

Tool/software:

The Keywriter is an application designed primarily for programming the keys and converting the device from HSFS to HSSE.

During the keywriting procedure, one may encounter errors reflected by the non-zero value in the "Keywriter Debug Response" log on the UART port used by the keywriter application. One can decode this non-zero value using the following documentation to understand the cause of the failure:

https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/security/keywriter.html#otp-key-writer-error-codes

In addition to returning the error code, the TIFS Keywriter also dumps the logs, which often provide more insights into the cause of the failure.

This FAQ discusses the various methods for obtaining these TIFS Keywriter logs.

  • The various methods for obtaining the TIFS Keywriter logs are as follows:

    1) Obtaining logs from the TIFS Keywriter UART port

    The TIFS Keywriter uses a dedicated UART port for printing the logs. So, the logs can be simply collected by connecting to this dedicated UART port.

    The exact UART port used for different devices is described in the following documentation:

    software-dl.ti.com/.../trace.html

    2) Obtaining logs from the Keywriter application UART port

    In addition to printing the logs on the UART, the TIFS Keywriter saves the logs in the memory buffer as well. These logs in the memory buffer are saved in the ASCII printable characters.

    So, in case the UART port used by the TIFS Keywriter for logging is not available, the logs can be read from the memory buffer and dumped on the same UART port as used by the keywriter application.

    The memory buffer location and the size is available under the "KeyWriter Firmware Trace Memory Buffer" section in the following documentation:

    software-dl.ti.com/.../trace.html

    For example, the following function reads the memory buffer as characters for the AM64 device. For the other devices, the ptr and sz value would need to be modified according to the device specific memory buffer location and size as mentioned in the TISCI documentation.

    void dump_sysfw_logs()
    {
        uint8_t* ptr = (uint8_t*)0x4405F000;
        uint32_t sz = 0x1000;
    
        DebugP_log("\r\n>> Start of SYSFW logs...\r\n");
    
        while(sz)
        {
            DebugP_log("%c", *ptr);
            ptr++;
            sz--;
        }
    
        DebugP_log("\r\n>> End of SYSFW logs!!!\r\n");
    }

    For the failure analysis, the ideal place to call this function is after the Sciclient_service call in the keywriter_processKeyConfig function.