cancel
Showing results for 
Search instead for 
Did you mean: 

No response from StSafe-A110 when using PutAttribute command

Sokario
Associate

Hello,

I am trying to use the StSafe-A110 on the SPL02 profile with a STM32H743ZG using mbed-OS. I followed most of the information I found but I got an issue. 

static StSafeA_Handle_t _stsafe_handler;
static uint8_t _rx_tx_buffer[STSAFEA_BUFFER_MAX_SIZE];
uint8_t _statusCode;
static uint8_t Host_MAC_Cipher_Key[2 * STSAFEA_HOST_KEY_LENGTH] = {
0x7A, 0xE2, 0xD7, 0x31, 0x18, 0x58, 0x7F, 0x59, 0x6E, 0x05, 0xF5, 0x8E, 0x81, 0x1D, 0x54, 0xE7, /* Host MAC key */
0xF8, 0x5C, 0xA8, 0x37, 0xBD, 0xF3, 0xF7, 0xCC, 0x5B, 0xC2, 0xE7, 0x7B, 0x4C, 0xC1, 0xBA, 0x6E /* Host cipher key */
};

StSafeA_Init(&_stsafe_handler, _rx_tx_buffer);

StSafeA_HostKeySlotBuffer_t HostKeySlot;
STS_CHK(_statusCode, StSafeA_HostKeySlotQuery(&_stsafe_handler, &HostKeySlot, STSAFEA_MAC_NONE));
if ((_statusCode == STSAFEA_OK) && (HostKeySlot.HostKeyPresenceFlag == 0U)) // Not populated
{
STS_CHK(_statusCode,
(int32_t)StSafeA_PutAttribute(&_stsafe_handler,
STSAFEA_TAG_HOST_KEY_SLOT,
Host_MAC_Cipher_Key,
2 * STSAFEA_HOST_KEY_LENGTH,
STSAFEA_MAC_NONE));
}

During the pairing process, the StSafeA_PutAttribute command is sent but the StSafe doesn't respond. I linked some picture of the I2C communication (implemented with mbed-OS I2C class), we can see the command sent and the multiple NACK.

Nevertheless, I try to update data partition with the StSafe to check if to worked as the HostKeySlot.HostKeyPresenceFlag is now true. I got the 0x16 error code (STSAFEA_INVALID_CMAC).

StSafeA_LVBuffer_t lv_buffer;
lv_buffer.Data = buf; // buffer to be sended
lv_buffer.Length = length;

StSafeA_Update(&_stsafe_handler,
STSAFEA_FLAG_FALSE,
STSAFEA_FLAG_FALSE,
STSAFEA_FLAG_FALSE,
STSAFEA_AC_ALWAYS,
zone_index,
0,
&lv_buffer,
STSAFEA_MAC_HOST_RMAC);

I am wondering if I can fix it and why did this happened. Let me know if you need more information on my setup / code.

0 REPLIES 0