MKW30Z hardware init

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

MKW30Z hardware init

Jump to solution
1,244 Views
lucianfiran
Contributor V

IAR 7.50;  KW40Z_Connectivity_Software_1.0.1 (KSDK_1.3.0)

 

as program start point is

\platform\devices\MKW30Z4\startup\iar\startup_MKW30Z4.s

Reset_Handler
        CPSID   I               ; Mask interrupts
        LDR     R0, =SystemInit
        BLX     R0
        LDR     R0, =init_data_bss
        BLX     R0
        CPSIE   I               ; Unmask interrupts
        LDR     R0, =__iar_program_start
        BX      R0

 

        PUBWEAK NMI_Handler
        SECTION .text:CODE:REORDER:NOROOT(1)
NMI_Handler
        B .

 

        PUBWEAK HardFault_Handler
        SECTION .text:CODE:REORDER:NOROOT(1)
HardFault_Handler
        B .

 

        PUBWEAK SVC_Handler
        SECTION .text:CODE:REORDER:NOROOT(1)

177619_177619.pngpastedImage_1.png

calling:

void SystemInit (void) {

#if (DISABLE_WDOG)
  /* SIM_COPC: COPT=0,COPCLKS=0,COPW=0 */
  SIM->COPC = (uint32_t)0x00u;
#endif /* (DISABLE_WDOG) */

#ifdef CLOCK_SETUP

why is there another hardware init needed in KSDK group: board.c board.h ?

Labels (1)
1 Solution
1,103 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Lucian,

If you check the code, you will see that code in board.c file is to configure the clock for core, flash and bus. But the SystemInit() is used to disable watchdog,

Hope it can help you

BR

Xiangjun Rong

View solution in original post

2 Replies
1,103 Views
lucianfiran
Contributor V

I see this issue was addressed in SDK 2.0


http://www.nxp.com/assets/documents/data/en/user-guides/KSDK20TUG.pdf

Kinetis SDK 2.0 Transition Guide

3.6 Startup
Kinetis SDK 2.0 has a somewhat different startup and initialization sequence. Code initially begins executing in the Reset_Handler found in \devices\<device>\<compiler>\startup_<device>.s.
The SystemInit() function is now found at \devices\<device> and is slightly different since it no longer provides an option to configure the clock at this point.
Its purpose is to enable cache (if available) and disable the watchdog timer.
The majority of the board initialization still occurs after reaching the main() function.
However the biggest change in how Kinetis SDK starts up is that there is no longer a hardware_init() function. Instead similar functions are called directly from main(). The following functions are typically called:
BOARD_InitPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();
Inside of these initialization functions, the method and API for initializing pins and clocks has also been changed from 1.x.

0 Kudos
Reply
1,104 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Lucian,

If you check the code, you will see that code in board.c file is to configure the clock for core, flash and bus. But the SystemInit() is used to disable watchdog,

Hope it can help you

BR

Xiangjun Rong