5128|1

79

帖子

0

TA的资源

一粒金砂(中级)

如何在一个好的使用习惯下用freescale K60单片机 [复制链接]

很多人用K60的时候会出现K60程序无法下载的问题,写此文的目的是让大家能尽量避免K60锁死引起不必要的麻烦。

很多人使用IAR作为开发环境此处也以IAR为例谈:
文章摘自IAR技术报告
Problem
When you create a new project from scratch in Embedded Workbench for ARM version 6.30.3 and older, for a Freescale Kinetis K60Xxxx device, using Target -> Core: "Cortex-M4", or Device -> "Freescale K60Xxxx", the default linker configuration file "generic_cortex.icf" will be selected.
This linker configuration file may cause a permanent device secure (i.e. the device is made impossible to re-program), when you download your code to the board.
In Embedded Workbench for ARM version 6.30.4 and newer, another default linker configuration file (Freescale\MK60xxxx.icf) will automatically be selected, which prevents this issue.
Solution
EWARM 6.30.3 and older:
Use the following linker configuration file for K60Xxxx devices:
$TOOLKIT_DIR$\examples\Freescale\K60\
TWR-K60\GettingStarted\config\K60X_Flash.icf
EWARM 6.30.4 and newer:
Use the default linker configuration file (automatically selected) located in:
$TOOLKIT_DIR$\config\linker\Freescale
Background
The default linker configuration file for ARM Cortex in IAR Embedded Workbench IDE (version 6.30.3 and older) places code starting at location 0. The problem is that once the code grows to encompass address 0x40C, the NVFSEC register will be programmed.
There are two bits in the NVFSEC register that can permanently disable the mass erase functionality on the chip. These bits are called Mass Erase Enable Bits (MEEN). In this same register there are also two bits that controls the Flash security (SEC). When used in conjunction, they can permanently lock the device.
Note that when selecting Options -> Target -> Device: Freescale K60Xxxx in EWARM version 6.30.3 and older, the option Linker -> Config -> "Linker configuration file" is set to "generic_cortex.icf" by default.
To change the settings, see the attached pictures on the right hand side of this page.
Note 1:
All example projects included in the IAR K60N512 kit overrides the default linker configuration file with either "K60X_ram.icf" or "K60X_Flash.icf", and the device lock problem does not occur.
Note 2:
The example projects provided with Freescale MQX includes a vector table in "vector.c" that is extended to cover the flash config area and sets the proper values.
Note 3:
If the device has been locked with the Flash security bits only, you can unlock the device using the J-Link Commander (jlink.exe) command:
J-Link> unlock Kinetis


http://supp.iar.com/Support/?note=77989
[ 本帖最后由 aida66 于 2012-7-14 03:00 编辑 ]
此帖出自NXP MCU论坛

点评

这个是整理成的PDF文件:  详情 回复 发表于 2012-7-14 03:02

回复
举报

79

帖子

0

TA的资源

一粒金砂(中级)

回复 楼主 aida66 的帖子

这个是整理成的PDF文件:

K60 在secure 状态下的解锁办法.pdf

12.97 KB, 下载次数: 74

此帖出自NXP MCU论坛

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表