I have been happily developing my prototype on the TWR-K60N512 using IAR Embedded Workbench V6.30 for a few weeks now. Suddenly a few days ago workbench started reporting an error when uploading to the board via the OSJTAG. This is a copy of the IAR debug log:
Thu Feb 09, 2012 21:46:49: Loaded macro file: C:\Program Files\IAR Systems\Embedded Workbench 6.0\arm\config\flashloader\Freescale\FlashK60Xxxx.mac
Thu Feb 09, 2012 21:46:50: Windows NT detected.
Thu Feb 09, 2012 21:46:51: P&E Interface detected - Flash Version 28.02
Thu Feb 09, 2012 21:46:52: Device is KINETIS.
Thu Feb 09, 2012 21:46:52: Mode is In-Circuit Debug.
Thu Feb 09, 2012 21:46:52: CPU reset by debugger.
Thu Feb 09, 2012 21:46:52:
Thu Feb 09, 2012 21:46:52: Software reset was performed
Thu Feb 09, 2012 21:46:52: ----- Prepare hardware for Flashloader -----
Thu Feb 09, 2012 21:46:53: 1536 bytes downloaded and verified (2.53 Kbytes/sec)
Thu Feb 09, 2012 21:46:53: Loaded debugee: C:\Program Files\IAR Systems\Embedded Workbench 6.0\arm\config\flashloader\Freescale\FlashK60Xxxx.out
Thu Feb 09, 2012 21:46:53: Target reset
Thu Feb 09, 2012 21:46:53: The flash loader program reported an error.
I'm not sure if I have added to the problem, but I have reloaded the OSJTAG firmware using the P&E utlity and the Windows drivers, but still no joy. My prototype deadline is looming !!! Any ideas.
Allan
Any luck with this?
After digging through most of this forum and the K60 reference manual I have discovered that I have screwed up the Ptotection registered and managed to secure most of the chip. There appears to be no way out as I have tried the IAJ-Link unsecure command and the PE Micro utility as well.
My friends at Avnet have helped me out by rushing a replacement board so that I can continue my development. Thanks Avnet!!
Checked the flash protection area and try to unlock it in a RAM based project. It will work after your trying, it is not anything that will lock the chip forever.
The reason flash writing is locked maybe caused by overwriting this protected section of memory:
define block CFMPROTROM with size = 20 { section .cfmconfig };
define block FLASHX_POOL with alignment = __FLASHX_SECT_SIZE { section .flashx };
define block TEXTSECTION with alignment = 4 { section .text };
keep { section .cfmconfig };
keep { section .flashx };
in the icf file, there was a 20 words of CFMPROTROM reserved for flash protection.
For whatever reason, these positions were written over (wrong) and locked the flash. So out board could not be programed.
Since a RAM based program can still be downloaded and run, we tried to modify the registers and unlock the protection. I'm not exactly 100% sure what we dit but the chip is now recovered.
I want to look into this a bit more to understand what is going on..
Hey , i think i also have the same problem . i locked my flash and now whenever i program it says flash loader reported an error. Could someone please tell , how can we unlock it and make it working?