最近使用了微芯的ATSHA204A作为TBOX的安全加密认证芯片,发现调试代码时,I2C返回:0f 23 42。想求助各位大佬在使用这款芯片有没有碰到,是怎么解决的呢?
附上日志
[2000-01-01 00:03:57.766][TRAC][..\SHA204A\atsha204_i2c.c:36][write]:
>>>rewrite time/1 OK
[2000-01-01 00:03:57.785][TRAC][..\SHA204A\atsha204_i2c.c:67][sha204p_wakeup]:
>>>sha204p_wakeup : 1
Random Chal_Response r
[2000-01-01 00:03:57.815][TRAC][..\SHA204A\atsha204_i2c.c:81][sha204p_send]:
>>>sha204p_send :word_addr :3 count :27
[2000-01-01 00:03:57.842][TRAC][..\SHA204A\atsha204_i2c.c:90][sha204p_send]:
>>>send_write :count :28
03 1b 16 01 00 00 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 6a 06
[11:59:36.372]收←◆[2000-01-01 00:03:57.905][TRAC][..\SHA204A\atsha204_i2c.c:137][sha204p_receive_response]:
>>>rec_data_count : 23
[2000-01-01 00:03:57.932][TRAC][..\SHA204A\atsha204_i2c.c:144][sha204p_receive_response]:
>>>rec_response_count : 22
db c0 ed 0a 49 6a 91 06 65 b0 ce 48 f7 d1 78 57 11 78 85 89 9b 9e d3 e4 cc 06 d7 d8 48 dd 32 d3 0c 4d
[2000-01-01 00:03:58.982][TRAC][..\SHA204A\atsha204_i2c.c:81][sha204p_send]:
>>>sha204p_send :word_addr :3 count :7
[2000-01-01 00:03:58.007][TRAC][..\SHA204A\atsha204_i2c.c:90][sha204p_send]:
>>>send_write :count :8
03 07 08 01 0f 00 09 c7
[2000-01-01 00:03:58.047][TRAC][..\SHA204A\atsha204_i2c.c:137][sha204p_receive_response]:
>>>rec_data_count : 4
[2000-01-01 00:03:58.070][TRAC][..\SHA204A\atsha204_i2c.c:144][sha204p_receive_response]:
>>>rec_response_count : 3
0f 23 42
Mathine MACFAILED! |
移植的是gitcode上的源码:https://gitcode.com/nsood/sha204/tree/master