中级会员
- 积分
- 200
- 威望
- 157
- 贡献
- 31
- 兑换币
- 0
- 注册时间
- 2012-2-7
- 在线时间
- 6 小时
|
6#
楼主 |
发表于 2012-2-12 21:33:13
|
只看该作者
这两天一直调板子,第一块K60就被锁了,用usbdm,jlink,ulink都不行,都是target is secured,提示方法都是earse mass flash。CW,MDK,IAR都用了,没有解决呀,还参考了IAR的解决方法:
Technical Note 77989
Permanent Device Lock/Secure of Freescale Kinetis K60Xxxx
EW targets: ARM
EW component: General issues
Keywords: .icf file, linking
Last update: April 1, 2011
Problem
When you create a new project from scratch 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.
Solution
Use the following linker configuration file for K60Xxxx devices:
$TOOLKIT_DIR$\examples\Freescale\K60\
TWR-K60\GettingStarted\config\K60X_Flash.icf
Background
The default linker configuration file for ARM Cortex in IAR Embedded Workbench IDE 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, 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
都不好用,第一片K60就牺牲了,明天再换片吧。用过LPC111X,STM32,LM3S,都有锁片子的情况,FSL解决起来是最没数的,因为它没有ISP方式. |
|