AnsweredAssumed Answered

K21 constantly reset after downloading code

Question asked by Phuc Le Dinh on May 26, 2015
Latest reply on May 27, 2015 by Phuc Le Dinh

Hi all,

 

This is a long story so bear with me a bit.

 

I received a K60 projects a year ago and now I'm trying to port it to a K21. I've done the pin change and project name change without any errors. The project is compiled OK.

 

The first time I debug the code, the IDE jumps to a Hardfault Handler when the code tries to declare some pointer variables after start up LED sequence finishes. Fixed that. However, the code only run from top to bottom in debug mode (JLink programmer attached and controlled via CodeWarrior 10.6). When I try a power reset, the K21 constantly resets (start up LED sequence continuously runs).

 

There are two questions that I want to ask:

  1. What are the differences between debug mode and run mode?
  2. Could this maybe a clock configuration problem? At the moment, my clock configs are: Core clock 100MHz, Bus 50 MHz, Ext Bus clk 25Mhz, Flash clk 25MHz

 

Appreciate any help. Thanks

Outcomes