This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

请教一个关于芯片加密的问题

Other Parts Discussed in Thread: UNIFLASH

使用芯片为c2000

在DSP2802x_CSMPasswords.asm 中写入密码,将.out文件烧入芯片对芯片加密,之后可以在uniflash输入密码,对已经加密的芯片进行烧写。

我想请教的问题是:对已经加密的芯片,是否可以不输入密码进行烧写,因为后续的烧写是由工厂进行的,为了防止别人读取我们的程序,不想告诉别人密码。

另外看到TI 的代码里有一个Unlock()函数,不知道有什么作用

非常感谢

  • 已经加密的     应该必须输入密码才能操作吧  

  • 你好,我在http://www.deyisupport.com/question_answer/microcontrollers/c2000/f/56/t/29034.aspx?pi2132219853=1这个帖子里看到:

    解密2种途径:

    1. 密码伴随.out文件烧入;

    2. 单独操作F28xx On-Chip Programer解密。

    我的理解第一种方法估计就是把密码写入程序里,生成.OUT,不需要告诉别人密码,别人只烧.OUT就行,不知道理解对不对,也不知道怎么实现?

  • 如果你是使用通过的软件,如CCS, Uniflash, C2prog进行烧写,是需要输入密码的。

    但是如果你们自己编写上位机和bootloader代码,是可以通过bootloader写算法解密的。但比较麻烦。

    Eric

  • 明白你的意思了,自己编上位机软件是不太可能了,从没搞过。

    以后只能告诉别人密码 或者自己烧程序了。

    非常感谢!

  • 现在终于明白了,“1. 密码伴随.out文件烧入” ,这句话的意思是在程序中加入这个函数Uint16 CsmUnlock(),可以对芯片解密,之前我理解错了,
    多谢
    //---------------------------------------------------------------------------
    // Example: CsmUnlock:
    //---------------------------------------------------------------------------
    // This function unlocks the CSM. User must replace 0xFFFF's with current
    // password for the DSP. Returns 1 if unlock is successful.
    #define STATUS_FAIL          0
    #define STATUS_SUCCESS       1
     
    Uint16 CsmUnlock()
    {
        volatile Uint16 temp;
     
        // Load the key registers with the current password. The 0xFFFF's are dummy
    // passwords.  User should replace them with the correct password for the DSP.
     
        EALLOW;
        CsmRegs.KEY0 = 0xFFFF;
        CsmRegs.KEY1 = 0xFFFF;
        CsmRegs.KEY2 = 0xFFFF;
        CsmRegs.KEY3 = 0xFFFF;
        CsmRegs.KEY4 = 0xFFFF;
        CsmRegs.KEY5 = 0xFFFF;
        CsmRegs.KEY6 = 0xFFFF;
        CsmRegs.KEY7 = 0xFFFF;
        EDIS;
     
        // Perform a dummy read of the password locations
        // if they match the key values, the CSM will unlock
     
        temp = CsmPwl.PSWD0;
        temp = CsmPwl.PSWD1;
        temp = CsmPwl.PSWD2;
        temp = CsmPwl.PSWD3;
        temp = CsmPwl.PSWD4;
        temp = CsmPwl.PSWD5;
        temp = CsmPwl.PSWD6;
        temp = CsmPwl.PSWD7;
     
        // If the CSM unlocked, return succes, otherwise return
        // failure.
        if (CsmRegs.CSMSCR.bit.SECURE == 0) return STATUS_SUCCESS;
        else return STATUS_FAIL;
     
    }
  • 请问在Uint16 CsmUnlock() 填好了密码,在哪里调用一下呢,才能通过生成.out文件解密呢?

  • 我是这么理解的

    步骤

    1、CsmUnlock() 填好密码,初始化时调用该函数,编译生成.OUT

    2、在uniflash输入之前设置的密码,烧写程序.OUT

    3、烧写完成后,程序开始运行,代码跑到CsmUnlock() 时,解密

    不知道对不对