Other Parts Discussed in Thread: UNIFLASH
如图用uniflash设置了这个密码之后不知道怎么才能改变设置的密码或者清除这个密码,比如就是将密码12345678改为12345677怎么改呢
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.
如图用uniflash设置了这个密码之后不知道怎么才能改变设置的密码或者清除这个密码,比如就是将密码12345678改为12345677怎么改呢
你好,我差不对理解了dcsm模块,但是发现你上述的文档不够详细,比如
Z1_pswdlock Z1-crcDclock Z1 Bootctrl 如何设置表示使能
GRABRAM 如何对应RAM区域
Z1OTP-GPREG1这个表示什么寄存器
只是设置了密码但是ram和flash都设置为0xffffffff,uniflash读取到flash区域都是0000是否代表可以做到防读取代码的作用
等一些问题,是否有更加详细的文档说明帮助我解决这些问题
更详细的文档,请参考spruin7b_TMS320F28002x Real-Time Microcontrollers Technical Reference Manual (Rev. B)第121页开始的3.12 Dual Code Security Module (DCSM)
Dual Code Security Module (DCSM) and Functional Safety (FuSa)
流程供参考:
****************************************
连接LaunchPad,打开UNIFLASH,烧录软件会自动侦测到器件,点击‘Start’:
这个板子之前没有更改过DCSM的配置,所以LinkPointer和CSMPSWD都是初始值(0x1FFFFFFF(ZSB0)和0x47FFFFFF):
**************************************************************************
把B0-Z1-PSWD0(ZSB0)的最后一位改成‘E’,点击Program Password:
接着读取相应位置的数据:
可以看到B0-Z1-PSWD0(ZSB0)确实改了。
这个时候随便load一个image,可以烧录成功;但是把密码的最后一位改为原来的'F',会提示烧录失败。侧面印证了修改成功。
如果要更换密码:
先修改LinkPointer的最后1位为'E'(1/2/3都要改),点击Program LINKPOINTER:
之后密码就恢复成初始值了(因为现在使用的是B0-Z1-ZSB1):
接着修改B0-Z1-PSWD0(ZSB1)的最后一位为'C':
更换密码成功。
Lock和Unlock在这些流程里不需要用到。Lock和Unlock对应的是PMF中的流程。
你好,多谢解决密码更换问题,现在我根据他默认的安全配置加密后重新上电程序无法运行,能否再看一下
我需要做到的是能够通过密码把程序加密达到uniflash无法读取的地步即可,可以把所有ram和flash都用otp1保护
Zx-EXEONLYRAM |
用于使能RAM的Execute-only 保护 |
Zx-EXEONLYSECT |
用于使能FLASH的Execute-only 保护 |
Zx-GRABRAM |
用于配置RAM的所在分区 |
Zx-GRABSECT |
用于配置FLASH的所在分区 |
不知道是否是这四个寄存器没有配置正确导致现在加密后程序无法运行,把 Zx-LINKPOINTER1-3 这个指到其他地址,但是不programpassword,程序能够跑起来,但是这样的话又无法烧录新程序,报黄色错误。
修改下面两个寄存器,就点击了 program GRABSECT1按钮
我注意到你修改了相应的GRABSECT和GRABRAM,这是解决上一个问题的关键。secure器件之后,必须对sector和RAM进行分配。
操作后重新上电可以运行程序,但是我的XDS100V2ISO仿真器无法再连接我的硬件
能否详细描述一下再次连接时的操作流程?我这边复现不了你的问题。
能把你上述问题的链接发一下吗?
要想完全保护器件,只需要对PSWDLOCK编程即可。
针对不能重新连接仿真器debug,我也提了一个新问题来跟进:
就是point指了,然后设置了密码,我就程序跑不起来了,然后说改sect和ram,改了后我仿真器无法连接了
操作后重新上电可以运行程序,但是我的XDS100V2ISO仿真器无法再连接我的硬件
首先,请告诉我一下重新上电后你执行了什么操作导致Error弹出;
其次,请试一下在WAIT boot mode下重新连接。
一个需要注意的地方,分配RAM的编码不是0x55555555,而是只有第3、4位有效,即0x00005500。其它位是保留位,理论上来讲没什么影响,但还是严谨一些好。
我的需求是如何保护flash内的程序不被读取,在我有密码的时候可以正常的烧录程序,现在使用dcsm,定义Linkpointer,设置密码后程序无法运行,追加设置sect和ram为0x55555555后仿真器无法再连接芯片。
换了芯片以后还是一样的现象吗?
还是需要了解你的具体操作的步骤的,我才能做出进一步的判断。你的这些问题我这边复现不出来。
如我之前所述,如果是新片子,配置PSWD密码、分配SECT、RAM之后,器件仅仅处于‘半保护’的状态,OTP是可以被读取的;接着配置PSWDLOCK后,器件将被完全保护。
如果是配置过DCSM OTP的片子,仅仅需要将Linkpointer移到下一个ZSB就能使用新的OTP来配置保护选项。
简单来说就是这样。我建议你阅读一下TRM中的相关内容,了解原理之后更有助于你使用。
UNIFLASH的bug确实不少。
我falsh操作的代码就异常,无法正常擦除写入了
对被保护的FLASH区域执行擦写操作需要先解锁(unsecure),请看一下TRM的3.12.7 Incorporating Code Security in User Applications,相关的代码在3.12.7.3 C Code Example to Unsecure C28x Zone1以及3.12.7.4 C Code Example to Resecure C28x Zone1。
你好,现在就是我的程序里有一些操作对flash的擦除和写入,但是加了密码保护把整个flash和ram都保护起来后我的flash相关操作就失效了
我的boot端有这个flash初始化参数
然后内部有这些对flash操作的函数
请问下我具体该如何增加代码如下代码才能让我的内部程序正常操作falsh
这段代码是在flash初始化之前还是之后,然后我看里面的逻辑我也没有理解,我看是先读取密码放置在tmp变量,然后又把密码0x11111111222222给csm寄存器,没有理解他在干嘛
unsecure简单来说就是向CSM寄存器写入密码,然后芯片会将写入寄存器的密码与OTP中的密码相匹配,一致就解锁成功,不一致就失败。
这个代码仅仅是给出一个示例,主要是为了说明流程,更像是一个伪代码。Unsecure的操作放在擦写Flash前,Resecure的操作放在擦写完成之后。
可以把密码写在代码里,直接写入CSMPSWD寄存器。也就是去掉判断是否secure的流程。你说的这个:
先读取密码放置在tmp变量
就是判断的部分。