K60 启动过程分析

 

挺高兴的老师借了我一块K60的开发板,趁着暑假好好鼓捣鼓捣!

 

 

 

 

 

 

 

 

有了上图的过程分析我想心里大概有个低了吧!

下面看代码:

/* CodeWarrior ARM Runtime Support Library

 * Copyright �2012 Freescale Semiconductors. All rights reserved.

 *

 * $Date: 2013/02/08 07:14:44 $

 * $Revision: 1.6 $

 */


/*

 *	__arm_start.c	-	entry-point for ARM programs

 *

 */

#include <string.h>

#include <stdlib.h>

#include <runtime_configuration.h>



_EWL_BEGIN_EXTERN_C



#if SUPPORT_SEMIHOST_ARGC_ARGV

#define __MAX_CMDLINE_ARGS 10

static char *argv[__MAX_CMDLINE_ARGS] = { 0 };

#else

static char *argv[] = { 0 };

#endif



#if __GNUC__

#define __call_static_initializers __init_cpp

#endif

#if SUPPORT_SEMIHOST_ARGC_ARGV

extern int __argc_argv(int, char **);

#endif /* SUPPORT_SEMIHOST_ARGC_ARGV */



extern void __call_static_initializers(void);

extern int main(int, char **);



#ifdef __VFPV4__

extern void __fp_init(void);

#endif /* __VFPV4__ */



extern void __init_registers();

extern void __init_hardware();

extern void __init_user();



#if defined(__APCS_ROPI)

extern void __init_pic();

#endif



#if defined(__APCS_RWPI)

extern void __init_pid();

#endif



#if defined(__APCS_ROPI) || defined(__APCS_RWPI)

extern void __load_static_base();

#endif



#if defined(__SEMIHOSTING)

extern void __init_semihost(void) _EWL_WEAK;

#endif



#if SUPPORT_ROM_TO_RAM

extern void __copy_rom_sections_to_ram(void);

extern char __S_romp[];

#endif



static void zero_fill_bss(void)

{

	extern char __START_BSS[];

	extern char __END_BSS[];



	memset(__START_BSS, 0, (__END_BSS - __START_BSS));

}



#ifndef __thumb // Thumb version

#error Thumb startup

#endif



// To keep iar debugger happy

void __iar_program_start(void) _EWL_NAKED;

void __thumb_startup(void);

void __iar_program_start()

{

	__thumb_startup();

}





void __thumb_startup(void) _EWL_NAKED;

void __thumb_startup(void)

{

		// Setup registers

		__init_registers();



		// setup hardware

		__init_hardware();





#if defined(__APCS_ROPI) || defined(__APCS_RWPI)

		//	static base register initialization

		__load_static_base();

#endif

#if defined(__APCS_RWPI)

		//	-pid

		//	setup static base for SB relative position independent data

		//	perform runtime relocation

		__init_pid();

#endif

#if defined(__APCS_ROPI)

		//	-pic

		//	perform runtime relocation for position independent code

		__init_pic();

#endif

		//	zero-fill the .bss section

		zero_fill_bss();



#if SUPPORT_ROM_TO_RAM

		if (__S_romp != 0L)

			__copy_rom_sections_to_ram();

#endif





		//      initialize the floating-point library

#ifdef __VFPV4__

		__fp_init();

#endif



		//	call C++ static initializers

		__call_static_initializers();



		// initializations before main, user specific

		__init_user();



#if defined(__SEMIHOSTING)

		// semihost initializations

		__init_semihost();

#endif



		//	call main(argc, &argv)

#if SUPPORT_SEMIHOST_ARGC_ARGV

		exit(main(__argc_argv(__MAX_CMDLINE_ARGS, argv), argv));

#else

		exit(main(0, argv));

#endif



		//	should never get here

		while (1);



}



_EWL_END_EXTERN_C


 

封尘浪用的库为 苏州大学 的库这两天一直在移植,各种问题,总体来说苏州的库还是不错的,就是资料有点少,这个暑假准备拿下K60,(鸭梨山大)好了,有时间在把学习过程与大家共享!同时欢迎各位一起交流探讨,解决问题!
  • 5
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值