AnsweredAssumed Answered

kl04 reset

Question asked by davidsun on May 9, 2014
Latest reply on Jun 5, 2014 by davidsun

this is the first time I use this Freescale chip, I feel the reset is very tricky.

I download this code to the chip, I guess it is successful.

with FRDM-02z, the reset is high. but after I power cycle and removed FRDM-02z the reset become strange, don't understand why, if my board have problem or some setup is wrong. the yellow trace is the reset signal

 

need help from who has gone through this problem

 

appreciate your help.

 

this is the program

 

/* ###################################################################

**     Filename    : ProcessorExpert.c

**     Project     : ProcessorExpert

**     Processor   : MKL04Z32VFK4

**     Version     : Driver 01.01

**     Compiler    : IAR ARM C Compiler

**     Date/Time   : 2014-05-09, 17:06, # CodeGen: 0

**     Abstract    :

**         Main module.

**         This module contains user's application code.

**     Settings    :

**     Contents    :

**         No public methods

**

** ###################################################################*/

/*!

** @file ProcessorExpert.c

** @version 01.01

** @brief

**         Main module.

**         This module contains user's application code.

*/      

/*!

**  @addtogroup ProcessorExpert_module ProcessorExpert module documentation

**  @{

*/      

/* MODULE ProcessorExpert */

 

 

/* Including needed modules to compile this module/procedure */

#include "Cpu.h"

#include "Events.h"

#include "GPIO1.h"

/* Including shared modules, which are used for whole project */

#include "PE_Types.h"

#include "PE_Error.h"

#include "PE_Const.h"

#include "IO_Map.h"

 

/* User includes (#include below this line is not maintained by Processor Expert) */

LDD_TDeviceData *MyGPIO1Ptr;

/*lint -save  -e970 Disable MISRA rule (6.3) checking. */

int main(void)

/*lint -restore Enable MISRA rule (6.3) checking. */

{

  /* Write your local variable definition here */

    unsigned int i,j;

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/

  PE_low_level_init();

  /*** End of Processor Expert internal initialization.                    ***/

  MyGPIO1Ptr = GPIO1_Init((LDD_TUserData *)NULL);

  /* Write your code here */

  /* For example: for(;;) { } */

  for(;;)

  {

    for(j=0;j<10;j++)for(i=0;i<65535;i++);

    GPIO1_ToggleFieldBits(MyGPIO1Ptr, RED, 0x1U);

  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/

  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/

  #ifdef PEX_RTOS_START

    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */

  #endif

  /*** End of RTOS startup code.  ***/

  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/

  for(;;){}

  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/

} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/

 

/* END ProcessorExpert */

/*!

** @}

*/

/*

** ###################################################################

**

**     This file was created by Processor Expert 10.4 [05.06]

**     for the Freescale Kinetis series of microcontrollers.

**

** ###################################################################

*/

 

 

 

 

this is debug log

 

Fri May 09, 2014 08:46:13: Windows NT detected.

Fri May 09, 2014 08:46:14: OpenSDA detected - Flash Version 1.05

Fri May 09, 2014 08:46:14: Device is KINETIS.

Fri May 09, 2014 08:46:14: Mode is In-Circuit Debug.

Fri May 09, 2014 08:46:14: CPU reset by debugger.

Fri May 09, 2014 08:46:14:

Fri May 09, 2014 08:46:14: Software reset was performed

Fri May 09, 2014 08:46:14: 936 bytes downloaded (11.72 Kbytes/sec)

Fri May 09, 2014 08:46:14: Loaded debugee: C:\Users\dsun\Downloads\KL04_TEST_24\Debug\Exe\KL04_TEST_24.out

Fri May 09, 2014 08:46:15: CPU reset by debugger.

Fri May 09, 2014 08:46:15:

Fri May 09, 2014 08:46:15: Software reset was performed

Fri May 09, 2014 08:46:15: Target reset MAP001.BMP.bmp

Outcomes