Nucleus uiPLUS启动流程
/*************************uiPLUS初始化简单流程********************************/
/* System Reset */
/* Hardware initialized */
/* INT_Initialize(In uiPLUS provided as the file called INT_XXX.YYY) */
/* INC_Initialize(The kernel executes Nucleus PLUS’s initialization process.) */
/* Application_Initialize(The kernel calls the initialization routine) */
/* Configurator calls uiPLUS’initialization routine in the Application_Initialize */ //When using μiPLUS,you always have to call mIP_Initialize in the top of Application_Initialize routine; however, by using the configurator, this process will be automatically created
/*************************uiPLUS初始化简单流程图******************************/
/*****************************Example****************************/
Ex.) Define task by Configuration File (system.cfg)
#define STACK_SIZE 2048
#define PRIORITY_DEF 1
CRE_TSK(TASK_MAIN, { TA_HLNG|TA_ACT, 1, task_main, PRIORITY_DEF,
STACK_SIZE, NULL });
The Configurator reads the configuration file and outputs kernel_cfg.c
#define STACK_SIZE 2048
#define PRIORITY_DEF 1
char __mip_tsk1_stack[STACK_SIZE];
T_CTSK __mip_tsk1_ctsk;
MIPTSK_DATA __mip_tsk1 = { TASK_MAIN, TA_HLNG|TA_ACT, 1, task_main,
PRIORITY_DEF, STACK_SIZE, __mip_tsk1_stack };
/*--- Kernel initialize ---*/
void Application_Initialize(VOID *first_available_memory)
{
ER errcd;
/* Initialize object management module */
errcd = mIP_Initialize(first_available_memory, TSZ_KERNEL_POOL_SIZE);
__mip_tsk1_ctsk.tskatr = __mip_tsk1.tskatr;
__mip_tsk1_ctsk.exinf = __mip_tsk1.exinf;
__mip_tsk1_ctsk.task = __mip_tsk1.task;
__mip_tsk1_ctsk.itskpri = __mip_tsk1.itskpri;
__mip_tsk1_ctsk.stksz = __mip_tsk1.stksz;
__mip_tsk1_ctsk.stk = __mip_tsk1.stk;
errcd = __cre_tsk(__mip_tsk1.tskid, &__mip_tsk1_ctsk);
_
kernel_cfg.c : The start-up code for creating TASK_MAIN, which has been specified by the static API
in the configuration file, is created. It has not been mentioned here, but kernel_cfg.c outputs the area
needed for the kernel to manage the object as well.

浙公网安备 33010602011771号