MK10DX256xxx7 start up problem with Kinetis Design Studio

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

MK10DX256xxx7 start up problem with Kinetis Design Studio

Jump to solution
904 Views
laluquethibaut
Contributor III

Hello,

 

I'm working under Kinetis Design Studio V1.1.1 and I'm trying to program a Kinetis MK10DX256VLK7 device with the PEmicro U-Multilink.

 

My project is compiling successfully and I can load the code on the target. But when I'm trying to run the code, the processor don't move out from the reset handler.

 

The start-up code is executing the reset_handler but when the instruction to branch program to the main function is executed (bl 0x440 <_start>) the processor restarts the reset_handler at the beginning.

 

When the reset handler is restarted I can see with my oscilloscope that the reset line of the MCU is pulled up and when device is trying to branch to 0x440 the reset line is pulled down.

 

When I import my source files under a CCS project, it's working correctly. The only differences between CCS and KDS project is the linker file and the startup code file.

 

Did someone already encounter this problem ? Any idea to solve this issue ?

 

Thanks for your help.

Labels (1)
0 Kudos
1 Solution
435 Views
laluquethibaut
Contributor III

Hi,

Thanks for your quick reply.

Indeed, this is a Watchdog problem. In the startup function, the processor is calling the SystemInit() function. For other processor as K70 this function disables the watchdog and initializes some clocks but for the MK10DX256VLK7 this function is empty.

I modified the system_MK10D7.c file and completed the SystemInit() function as follow :

#define DISABLE_WDOG     (1)

void SystemInit (void) {

#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))

  SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2));    /* set CP10, CP11 Full Access */

#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */

#if (DISABLE_WDOG)

  /* Disable the WDOG module */

  /* WDOG_UNLOCK: WDOGUNLOCK=0xC520 */

  WDOG->UNLOCK = (uint16_t)0xC520u;     /* Key 1 */

  /* WDOG_UNLOCK : WDOGUNLOCK=0xD928 */

  WDOG->UNLOCK  = (uint16_t)0xD928u;    /* Key 2 */

  /* WDOG_STCTRLH: ??=0,DISTESTWDOG=0,BYTESEL=0,TESTSEL=0,TESTWDOG=0,??=0,STNDBYEN=1,WAITEN=1,STOPEN=1,DBGEN=0,ALLOWUPDATE=1,WINEN=0,IRQRSTEN=0,CLKSRC=1,WDOGEN=0 */

  WDOG->STCTRLH = (uint16_t)0x01D2u;

#endif /* (DISABLE_WDOG) */

}

Now the program is working correctly.

Thanks for your help.

View solution in original post

0 Kudos
2 Replies
435 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi ,

Have you disabled the watch dog from start up?


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

436 Views
laluquethibaut
Contributor III

Hi,

Thanks for your quick reply.

Indeed, this is a Watchdog problem. In the startup function, the processor is calling the SystemInit() function. For other processor as K70 this function disables the watchdog and initializes some clocks but for the MK10DX256VLK7 this function is empty.

I modified the system_MK10D7.c file and completed the SystemInit() function as follow :

#define DISABLE_WDOG     (1)

void SystemInit (void) {

#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))

  SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2));    /* set CP10, CP11 Full Access */

#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */

#if (DISABLE_WDOG)

  /* Disable the WDOG module */

  /* WDOG_UNLOCK: WDOGUNLOCK=0xC520 */

  WDOG->UNLOCK = (uint16_t)0xC520u;     /* Key 1 */

  /* WDOG_UNLOCK : WDOGUNLOCK=0xD928 */

  WDOG->UNLOCK  = (uint16_t)0xD928u;    /* Key 2 */

  /* WDOG_STCTRLH: ??=0,DISTESTWDOG=0,BYTESEL=0,TESTSEL=0,TESTWDOG=0,??=0,STNDBYEN=1,WAITEN=1,STOPEN=1,DBGEN=0,ALLOWUPDATE=1,WINEN=0,IRQRSTEN=0,CLKSRC=1,WDOGEN=0 */

  WDOG->STCTRLH = (uint16_t)0x01D2u;

#endif /* (DISABLE_WDOG) */

}

Now the program is working correctly.

Thanks for your help.

0 Kudos