Running KSDK examples on TWR-KM34Z50M

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

Running KSDK examples on TWR-KM34Z50M

990 Views
andrei_golovin
Contributor I

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!

Tags (3)
2 Replies

844 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Andrei Golovin 

I wouldn't recommend you to use SDK examples from TWR-KM34Z75 in the TWR-KM34Z50 board, there are some differences between these two devices.

You can download the "API reference manual for Kinetis M bare-metal drivers and software examples"  which uses support for the TWR-KM34Z50

TWR-KM34Z50M|Tower System Board|Kinetis MCUs|NXP 

You can find it under the documentation tab, in the Application Note part, it is named as KMSWDRVAPIRM_SW

Hope this helps

Best regards

844 Views
andrei_golovin
Contributor I

Thank you! It has been solved

0 Kudos
Reply