当前位置: 首页 > news >正文

libero PolarFire soc SPI-DirectC 实战 dp_G5M_verify_digest_action

libero PolarFire soc SPI-DirectC 实战 dp_G5M_verify_digest_action

 

校验,  编程是否正确 , 使用  摘文  digest  , 能 快速 的校验!

 

spi_input_buffer[0] = 0x1u;
 
    #define G5MSOC_CHECK_DIGESTS        0xD7u
            spi_command_buffer = G5MSOC_CHECK_DIGESTS; 
            G5M_SPI_SCAN_out(32u,32u);

 

先查询忙闲

先发送 指令 5个字节 , 0xD7  0x01 0x00 0x00 0x00 

再次查询忙闲

再发送指令 5个字节  0x01 0x00 0x00 0x00 0x00

#define G5M_SPI_READ_DATA           0x01u
    spi_command_buffer = G5M_SPI_READ_DATA;
    do_SPI_SCAN_out(SPI_COMMAND_BIT_SIZE, &spi_command_buffer,total_dat_bits_out,spi_output_buffer);
 
读回来 4个字节 ,  第三个字节 = 0x 40  ,  则 校验失败! 不知这里是 校验过程失败 ,  还是 校验不通过 的意思?
 
        else if ((device_family == G5SOC_DEVICE_FAMILY) && (spi_output_buffer[3] == 0x40u))
        {
            #ifdef ENABLE_DISPLAY
            dp_display_text("\r\nFailed to verify digest.");
            #endif
            error_code = DPE_VERIFY_DIGEST_ERROR;
        }
 
 
Fabric digest verification: PASS
((spi_output_buffer[0] & 0x1u )== 0x1u)
 
Fabric Configuration digest verification: PASS
((spi_output_buffer[0] & 0x2u )== 0x2u)
 
sNVM digest verification: PASS
((spi_output_buffer[0] & 0x4u )== 0x4u)
 
eNVM digest verification: PASS
((spi_output_buffer[1] & 0x40u )== 0x4u)
。。。。。。。。。。后面还有好多