MKW30Z hardware init

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MKW30Z hardware init

跳至解决方案
1,247 次查看
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 ?

标签 (1)
1 解答
1,106 次查看
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

在原帖中查看解决方案

2 回复数
1,106 次查看
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 项奖励
回复
1,107 次查看
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