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  ,  执行该指令 , PS 程序会 暂停运行。

再次查询忙闲

再发送指令 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)
。。。。。。。。。。后面还有好多
 
 
 交给 AI 总结

image

 

image

 

image

 

 0x 2 0x F 0xD8 0x 1 0x 0 
 
0x0F  对应 

image

 

D8 对应: 对应  eNVM  =  1,  表示 eNVM PASS

       if (device_family == G5SOC_DEVICE_FAMILY)
            {
                if ((spi_output_buffer[1] & 0x40u )== 0x4u)
                {
                    dp_display_text("\r\n --- eNVM digest verification: PASS");
                }
                else
                {
                    dp_display_text("\r\nWarning: --- eNVM digest verification: FAIL");
                }
            }
 
 
擦除后 再次 读取 校验

image

 

06 表示  FPGA FABRIC 校验失败!

但是  0XD8 表示  eNVM 校验成功,  难道 擦除  不能擦除  eNVM 的数据?  有待验证!

image

 

posted on 2026-02-11 15:36  所长  阅读(15)  评论(0)    收藏  举报

导航