AnsweredAssumed Answered

Running KSDK examples on TWR-KM34Z50M

Question asked by Andrei Golovin on Jul 26, 2018
Latest reply on Aug 16, 2018 by Andrei Golovin

Hi!

 

I'm trying to run KSDK examples on a TWR-KM34Z50M board. In fact there is no any helpful info about Z50M and the examples are for KM34Z75M. I've tried two examples "hello world" and "slcd_guessnum". Both of them were compiled and uploaded correctly without any warnings and errors in Kinetis Design Studio and also in Keil MDK (just to check uploading). But then nothing happens. For the "hello world" example there is nothing in PuTTY terminal (baudrate  115200 as specified in board.h). For the "slcd_guessnum" nothing appears on LCD.
Stepwise debugging after reset shows the following: the debug process always executes only three commands in a loop from startup_MKM34Z7.s (marked in bold)

 

Reset_Handler   PROC
                EXPORT  Reset_Handler             [WEAK]
                IMPORT  SystemInit
                IMPORT  init_data_bss
                IMPORT  __main

 

                IF      :LNOT::DEF:RAM_TARGET
                REQUIRE FlashConfig
                ENDIF

 

                CPSID   I               ; Mask interrupts
                LDR     R0, =SystemInit
                BLX     R0
                LDR     R0, =init_data_bss
                BLX     R0
                CPSIE   i               ; Unmask interrupts
                LDR     R0, =__main
                BX      R0
                ENDP

 

In a function SystemInit() only one line is executed (marked in bold)

 

void SystemInit (void) {

 

#if (DISABLE_WDOG)
  /* WDOG->UNLOCK: WDOGUNLOCK=0xC520 */
  WDOG->UNLOCK = WDOG_UNLOCK_WDOGUNLOCK(0xC520); /* Key 1 */
  /* WDOG->UNLOCK: WDOGUNLOCK=0xD928 */
  WDOG->UNLOCK = WDOG_UNLOCK_WDOGUNLOCK(0xD928); /* Key 2 */
  /* WDOG->STCTRLH: ?=0,DISTESTWDOG=0,BYTESEL=0,TESTSEL=0,TESTWDOG=0,?=0,?=1,STOPEN=1,DBGEN=0,ALLOWUPDATE=1,WINEN=0,IRQRSTEN=0,CLKSRC=1,WDOGEN=0 */
  WDOG->STCTRLH = WDOG_STCTRLH_BYTESEL(0x00) |
                 WDOG_STCTRLH_STOPEN_MASK |
                 WDOG_STCTRLH_ALLOWUPDATE_MASK |
                 WDOG_STCTRLH_CLKSRC_MASK |
                 0x0100U;
#endif /* (DISABLE_WDOG) */

 

If try to skip lines for SystemInit() obviously everything is stuck at the last line in Reset_Handler.

 

I guess the issue is connected to the difference between MKM34Z50 and MKM34Z75 but I have no idea what to change. I'd appreciate any suggestions. Thanks!

Outcomes