[Newbie] IAR, TWR-K60N512 and couldn't program the flash memory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[Newbie] IAR, TWR-K60N512 and couldn't program the flash memory

1,267 Views
pozz
Contributor III

I tried everything without success.

 

I can correcly compile example projects from Freescale (KINETIS_SC.zip) in IAR Workbench 6.30. I can compile RAM and FLASH projects and I can debug from inside IAR using P&E Micro OSJTAG embedded in TWR-K60N512.

 

After that, I tried to save the program to the flash memory, so the application run automatically after switching on, but without success. I compile a FLASH project (such as hello_workd_k60_tower - FLASH_512KB_PFLASH) and I put it in run with "Download and Debug". It works. Now I close IAR IDE, press the RESET button on the board, but the application seems don't start.

 

I also tried with Project->Download->Download active application without success.

 

This is the output log during programming:

 

Mon Jun 11, 2012 13:04:40: Loaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0 Evaluation\arm\config\flashloader\Freescale\FlashK60Xxxx.mac
Mon Jun 11, 2012 13:04:41: Windows NT detected.
Mon Jun 11, 2012 13:04:42: P&E Interface detected - Flash Version 30.21
Mon Jun 11, 2012 13:04:44: Device is KINETIS.
Mon Jun 11, 2012 13:04:44: Mode is In-Circuit Debug.
Mon Jun 11, 2012 13:04:46: CPU reset by debugger.
Mon Jun 11, 2012 13:04:46:  
Mon Jun 11, 2012 13:04:46: Software reset was performed
Mon Jun 11, 2012 13:04:46: ----- Prepare hardware for Flashloader -----
Mon Jun 11, 2012 13:04:46: 1536 bytes downloaded (3.85 Kbytes/sec)
Mon Jun 11, 2012 13:04:46: Loaded debugee: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0 Evaluation\arm\config\flashloader\Freescale\FlashK60Dxxx128K.out
Mon Jun 11, 2012 13:04:46: Target reset
Mon Jun 11, 2012 13:04:48: Skipping flash loading pass because there is no data in the designated range: 0x10000000-0x13FFFFFF.
Mon Jun 11, 2012 13:04:48: Downloaded C:\Temp\KINETIS512_SC\build\iar\hello_world\FLASH_512KB_PFLASH\Exe\hello_world_k60_tower.out to flash memory.

I searched for a solution on the web and in this forum, but I haven't found any.

 

0 Kudos
1 Reply

372 Views
pozz
Contributor III

I found an explanation, I don't know it is correct.

 

I compiled a project (that blinks a LED on TWR-K60N512) with Flash configuration and clicked on Download and Debug button in IAR environment. The LED starts blinking.

Now if I stop the debug from IAR, the LED stops blinking. I think IAR sets the OSBDM/OSJTAG (embedded on TWR) to keep stopped the main processor. The strange thing is that the program doesn't start even if I press the RESET button on the TWR board.

 

The only thing to do to see the program running, is to unplug and re-plug the USB cable. I imagine in such way, the OSBDM/OSJTAG re-starts in a normal mode where the main processor isn't keeped stopped.

 

Do you know if there is the possibility to unlock the OSBDM/OSJTAG from inside IAR, without disconnecting USB cable?

0 Kudos