新闻中心

EEPW首页>嵌入式系统>设计应用> 加密系统调试_HCS12学习笔记(8)

加密系统调试_HCS12学习笔记(8)

作者: 时间:2016-11-24 来源:网络 收藏
最近搞了一下关于加密的调试,在此做个记录。

本文引用地址: //m.amcfsurvey.com/article/201611/321080.htm

其实很简单,只是对#FF0F进行操作一下就可以了,具体位操作详见S12FTS256KV2.PDF,寄存器FESC。

在MAIN.C的最后加上

const volatile unsigned char SecureReg @(0xFF0F)=0xFC;

即可,注意VOLATILE字样,如果没有的话,可能被DUBUG掉。

我对所有的程序进行了调试,一切正常,只有在涉及到FLASH擦写时,程序无法正常运行,或者把程序段放入FLASH分页时无法正常运行。查了N多资料,未果。

于是找了FREESCALE的技术支持,交流过后发现,是我芯片型号的问题,因为我的芯片的MASK是1K79X,比较老的型号,所以确实在这个方面是有问题的,如果换成了DT256或者高版本的MASK,即可解决问题。

这里是1K79X参错里的内容,描述了这个问题。

MUCts00603: FLASH
Program & erase blocked in normal single chip mode when secure
Description
In normal single chip mode, when security is enabled, it is not possible to launch the Program ($20), Sector-Erase ($40) and Erase-Verify ($05) commands in the Flash. The Mass-Erase ($41) command can be launched.


Workaround
To enable the Program ($20), Sector-Erase ($40) and Erase-Verify ($05) commands in the flash, security must be disabled via the backdoor key sequence. See Flash User Guide for details of the backdoor key operation.

至此问题解决。




评论


技术专区

关闭