连续签到天数:1天 | 签到总天数:2天 | 签到总奖励:10金币 |
|
楼主 |
发表于 2020-2-20 12:01:40
|
显示全部楼层
谢谢回复,用testengine可以锁SPI。
步骤是先将8670 set bootmode0, 然后调用test engine api 去锁SPI。
我 写了个简单的代码,供同样问题的人参考
#include "pch.h"
#include "testengine.h"
#include <windows.h>
#include <iostream>
#include <stdint.h>
/* key length is fixed 128 bits*/
uint8_t key[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};
int main()
{
int ret;
/* Get device handle */
uint32 deviceHandle = openTestEngine(USB, "\\\\.\\csr0", 0, 5000, 1000);
if (deviceHandle != 0)
{
/* Set secure key to chip */
ret = bccmdSetSpiLockCustomerKey(deviceHandle, (uint32*)key);
/* Lock SPI */
ret = bccmdSpiLockInitiateLock(deviceHandle);
}
std::cout << "Hello World!\n";
} |
|