The debugging of algorithm transplant encryption chip includes 2 Parts of : Communication debugging and algorithm debugging . I talked about communication debugging skills before , Next, this article will analyze and summarize the problems in the algorithm debugging , To help customers successfully complete the debugging .
Common problems in algorithm debugging :
1、 Don't build your own projects
When customers migrate algorithms , There is no need for new projects , Open the existing routine directly for programming .
2、 Remember not to tune online
Encryption chip belongs to security chip , Online debugging is not supported , Only after downloading the algorithm , Verify whether the function is normal through the algorithm instruction .
3、 Understanding architecture is the premise
Encryption chip is divided into driver layer and application layer , user MCU The instructions sent will be parsed in the driver layer first , So the user should learn to locate the problem of driver layer . Chip returned 6D00、6E00 All belong to the status code of communication command error , When encountering this kind of error, we should check whether there is any problem in the instruction itself . When the chip returns 6A80 It belongs to the application layer algorithm exception . When code execution is complete return 1 after , Encryption chip will output 9000 The correct status code for , if return 0, The output 6A80 Error messages for .
4、 Exception first think big and small end
Both large and small end modes have , If the algorithm function is abnormal , Consider this as a starting point . Ensure that the storage mode of encryption chip is consistent with the original algorithm running platform .
5、 Make good use of the communication buffer
The user uses the output buffer in the algorithm routine , Fill in all kinds of process data generated in the operation of the algorithm , Print it out at the same time , By analyzing the data, we can find the cause of the abnormal algorithm .
The above are some common problems and debugging suggestions .