2025-02-18 12:11 PM
Hi,
I ported example projects from en.x-cube-safea1\project\NUCLEO-L476RG for MbedTLS cryptolib for use on my B-U585I-IOT02A Discovery Kit. The STSAFE-A110 is powered correctly and NRESET is pulled high. It never errors on writes to the device, but all reads that execute the StSafeA_Receive function in stsafea_service.c return STSAFEA_COMMUNICATION_ERROR. In fact, it's very specifically always happening here (code snippet below) where after calling StSafeA_ReceiveBytes and getting STSAFE_BUS_OK, it is masking the header value with the inverse of STSAFEA_CMD_HEADER_RMACEN which always turns STSAFE_BUS_OK (0x00) to 0x01 which is STSAFEA_COMMUNICATION_ERROR. Any idea what I could be doing so that I can get past this?
Thanks!
if (status_code != STSAFEA_BUFFER_LENGTH_EXCEEDED)
{
if (status_code == (StSafeA_ResponseCode_t)STSAFEA_BUS_OK)
{
status_code = (StSafeA_ResponseCode_t)(uint8_t)((uint8_t)pTLV_Buffer->Header &
~(uint8_t)STSAFEA_CMD_HEADER_RMACEN); <---- *** this is changing the STSAFEA_BUS_OK (0x00)
to 0x01 which is STSAFEA_COMMUNICATION_ERROR
}