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.

AM623: Keywriter error

Part Number: AM623


Tool/software:

Hi, TI expert! 

I have a development environment for am6234, with our own evaluation board.

The software SDK version is PROCESSOR-SDK-LINUX-RT-AM62X-08.06.00.42.

After referring to section  “4.1 UART boot” in《AM62X_OTP_Keywriter_User_Guide_08_06_00.pdf》, I was able to properly burn certificates to efuse via uart.

But when I used IPC to load the firmware of Keywriter, the following error occurred:

The corresponding code implementation is as follows:

#include <stdint.h>
#include <drivers/sciclient.h>
#include <drivers/sciclient/include/tisci/security/tisci_keywriter.h>
#include "keycert.h"

/* Keywriter certificate */
const uint8_t gKeyCert[KEYCERT_SIZE_IN_BYTES] __attribute__((aligned(128)))
    = KEYCERT;

void keywriter_processKeyConfig()
{
    int32_t status = SystemP_SUCCESS;
    Sciclient_ReqPrm_t reqParam;
    Sciclient_RespPrm_t respParam;
    struct tisci_msg_keywriter_req request;
    struct tisci_msg_keywriter_resp response;

    request.image_addr_lo     = ((uint32_t) gKeyCert & 0xFFFFFFFFU);
    request.image_addr_hi     = ((uint32_t)(((uint64_t) gKeyCert) >> 32) & 0xFFFFFFFFU);

    reqParam.messageType      = (uint16_t) TISCI_MSG_KEY_WRITER;
    reqParam.flags            = (uint32_t) TISCI_MSG_FLAG_AOP;
    reqParam.pReqPayload      = (const uint8_t *) &request;
    reqParam.reqPayloadSize   = (uint32_t) sizeof (request);
    reqParam.timeout          = (uint32_t) SystemP_WAIT_FOREVER;

    /* Populated by the API */
    respParam.flags           = 0U;
    respParam.pRespPayload    = (uint8_t *) &response;
    respParam.respPayloadSize = (uint32_t) sizeof (response);

	DebugP_log("keys Certificate found: 0x%x \r\n", (uint32_t) gKeyCert);

    status = Sciclient_service(&reqParam, &respParam);

	DebugP_log("Keywriter Debug Response:0x%x \r\n", (uint32_t) response.debug_response);

	if (( status == SystemP_SUCCESS ) && ( response.debug_response == 0x0U ))
	{
		DebugP_log("Success Programming Keys \r\n");
	}
	else
	{
		DebugP_log("Error occured... \r\n");
	}

	DebugP_assertNoLog((status == SystemP_SUCCESS) && ((respParam.flags & TISCI_MSG_FLAG_ACK) == TISCI_MSG_FLAG_ACK));

}


int main()
{
    System_init();
    Drivers_open();

    DebugP_log("\r\n\n");
    DebugP_log("Starting Keywriting\r\n");
    keywriter_processKeyConfig();
    DebugP_log("Finishing Keywriting\r\n");

    Drivers_close();
    System_deinit();

    return 0;
}


The code uses the tisci API interface of the keywriter to burn the certificate to efuse:
software-dl.ti.com/.../keywriter.html

Reference for loading Keywriter firmware use IPC:

https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM62X/10_00_07_04/exports/docs/linux/Foundational_Components_IPC62x.html#getting-started-with-ipc-linux-examples

I would like to ask what caused this failure and how to solve it?

Regards,

Li