libero PolarFire soc SPI-DirectC 实战 dp_G5M_check_cycle_count

读取编程 次数 

 

首先 isc_enable
0x B 0x 1 0x 0 0x 0 0x29

发送指令 G5M_SPI_READ_DEBUG_INFO = 0xE7 , 

 
读取 6个 block  ,  每个 block  16 个字节  , 共计 96个字节 
 
单独 读取 1个  block , 方式如下
 
1、 发送指令  G5M_SPI_READ_BUFFER = 0xF2 , 第二个字节位 block 编号 , 15个字节 0x00 ,  共计 17个字节;
2、 第一个字节  G5M_SPI_READ_DATA = 0x01 , 16个字节 0x00 , 共计 17个字节
 
// 编程 次数 存放 在   61和 60 , 下标 从 0 , 开始 , 存放在 block 编号 = 3 信息 里 ;
cycle_count = ((G5M_shared_buf[61] << 8u) | (G5M_shared_buf[60]));
 
没有打印 0x01 0x00 0x00 共计 17个字节
e_fsm_read_id tx_buff,len:5.
0x F 0xFF 0xFF 0xFF 0xFF 
end.
e_fsm_read_id rx_buff,len:5.
0x 0 0x 0 0x 0 0x 0 0x 0 
end.
e_fsm_read_id tx_buff,len:5.
0x F 0xFF 0xFF 0xFF 0xFF 
end.
e_fsm_read_id rx_buff,len:5.
0x 2 0xCF 0xA1 0x81 0x1F 
end.
polarfire soc id:0xCFA1811F.
e_fsm_isc_enable tx_buff,len:5.  // 使能很重要
0x B 0x 1 0x 0 0x 0 0x29 
end.
e_fsm_buff_cmd tx_buff,len:1.
0xE7 
end.
e_fsm_buff_read tx_buff,len:17.
0xF2 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 
end.
e_fsm_buff_data rx_buff,len:17.
0x 2 0x 0 0x 0 0x 0 0xD4 0x35 0x 0 0x17 0x 0 0x22 0x 0 0xD7 0x 9 0xA8 0x 9 0xC3 0x 9   // 这里 和 JTAG 读取 的一样, 顺序颠倒
end.
e_fsm_buff_read tx_buff,len:17.
0xF2 0x 1 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 
end.
e_fsm_buff_data rx_buff,len:17.
0x 2 0xFB 0x 6 0x4B 0x 2 0xCC 0x19 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 
end.
e_fsm_buff_read tx_buff,len:17.
0xF2 0x 2 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 
end.
e_fsm_buff_data rx_buff,len:17.
0x 2 0x 1 0x 0 0x 0 0x29 0x 3 0xF6 0x59 0x17 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 
end.
e_fsm_buff_read tx_buff,len:17.
0xF2 0x 3 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 
end.
e_fsm_buff_data rx_buff,len:17.
0x 2 0x 0 0x 3 0x 0 0x 0 0xCA 0x 0 0x 0 0x 0 0x44 0x 4 0x 0 0x 0 0x1F 0x 0 0x 0 0x 0 // 这里 编程 次数
end.
e_fsm_buff_read tx_buff,len:17.
0xF2 0x 4 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 
end.
e_fsm_buff_data rx_buff,len:17.
0x 2 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 1 0x 0 0x10 
end.
e_fsm_buff_read tx_buff,len:17.
0xF2 0x 5 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 
end.
e_fsm_buff_data rx_buff,len:17.
0x 2 0xFF 0x3F 0x 0 0x 0 0x7E 0x 1 0x 3 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 
end.
read state ready max tick=1.
test isp end.

使用 JTAG  读取的 日志

 

programmer 'S200AN6ZQU' : device 'MPFS250T' : ---------------------------------------

programmer 'S200AN6ZQU' : device 'MPFS250T' : EXPORT DEBUG_INFO[784] = 000000000000000000000003017e00003fff100001000000000000000000000000000000001f00000444000000ca0000030000000000000000001759f603290000010000000000000000000019cc024b06fb09c309a809d7002200170035d4000000

programmer 'S200AN6ZQU' : device 'MPFS250T' : System controller suspend mode is disabled

programmer 'S200AN6ZQU' : device 'MPFS250T' : CYCLE COUNT: 31=0x1F

programmer 'S200AN6ZQU' : device 'MPFS250T' : Programming Mode: SPI_SLAVE

programmer 'S200AN6ZQU' : device 'MPFS250T' : Algorithm Version: 1

programmer 'S200AN6ZQU' : device 'MPFS250T' : Programmer:

programmer 'S200AN6ZQU' : device 'MPFS250T' : Software Version:

programmer 'S200AN6ZQU' : device 'MPFS250T' : Programming Software: Direct C

programmer 'S200AN6ZQU' : device 'MPFS250T' : Programming File Type: PPD

 

 

posted on 2026-02-26 14:38  所长  阅读(5)  评论(0)    收藏  举报

导航