STM32 Transplant Uc/os-ii Records

Source: Internet
Author: User

#STM32移植uC/os-ii

tags (space delimited): ARM uc/os-ii

---# #移植前相关知识介绍 # # # # # # # # #目标板与uC/OS-II system frame Diagram! [] (http://images.cnitblog.com/blog/665192/201408/301617582511830.jpg) # # #搭建文件结构! [] (Http://images.cnitblog.com/blog/665192/201408/301619070633006.png) # # #配置uC/os-ii
 -Modify os_cfg.h Disable semaphore, coprime semaphore, mailbox, queue, semaphore set, timer, memory management, shutdown debug mode, application software hook function and multiple event control ' Cpp#define os_app_hooks_en          0#define os_debug_en              0    /* Enable (1 ) Debug variables*/#define Os_flag_en               0    /* Enable (1) or Dis Able (0) code generation for EVENT FLAGS    */#define OS_MBOX_EN             &NBSP ;  0    /* Enable (1) or Disable (0) code generation for mailboxes      */#define OS_MEM_EN &N Bsp               0    /* Enable (1) or Disable (0) code generation for MEMORY MA Nager */#define OS_MUTEX_EN               0  /* Enable (1) or Disable (0) code GE Neration for mutexes          */#define OS_Q_EN               &N Bsp   0    /* Enable (1) or Disable (0) code generation for QUEUES         */#define OS_SEM_EN     &NBSP ;           0  /* Enable (1) or Disable (0) code generation for semaphores     */#d Efine os_tmr_en                 0    /* Enable (1) or Disable (0) code G Eneration for timers         * * "$ Purpose: Reduce kernel volume for easy commissioning
-Modify OS_CPU_C.C
-Modify Os_cpu.h-Modify Os_cpu_a.asm-Modify Startup_stm32f10x_hd.s




# # #一个完整的uC Application core file for/os-ii
**main.c** "CPP Os_stk startup_task_stk[startup_task_stk_size];         Defines the stack int main (void) {bsp_init ();         Osinit ();         Ostaskcreate (Task_start, (void *) 0, &startup_task_stk[startup_task_stk_size-1], Startup_task_prio);         Osstart ();      return 0; } ' **bsp.c** * Function name: Bsp_init * Description: Clock initialization, hardware initialization
"' Cppvoid bsp_init (void) {systeminit ();    /* Configure the system clock to 72M */systick_init ();  /* Initialize and enable Systick timer */led_gpio_config (); /* LED Port initialization */}
"' **app.c** defines three tasks
-Main Task **task_start**-Task 2 **task_led2**-Task 3 **task_led3**
"' Os_stk task_led2_stk[task_led2_stk_size];        //definition stack    OS_STK task_led3_stk[task_led3_stk_size];        //definition stack      //main task  void task_start (void *p_arg)    {  & nbsp;    (void) P_arg;                          //' p_arg ' is not used to prevent the compiler from prompting the police               ostaskcreate (TASK_LED2, (void *) 0,          //Create Task 2                     &TASK_LED2_STK[TASK_LED2_STK_SIZE-1], TA Sk_led2_prio);                ostaskcreate (TASK_LED3, (void *) 0,          //Create Task 3                     &task_led3_stk[task_led3_st K_size-1], Task_led3_prio);                WHile (1)        {        LED1 (on);             OSTIMEDLYHMSM (0, 0,0,100);             led1 (OFF);                OSTIMEDLYHMSM (0, 0,0,100);              }     }           //task 2& Nbsp; void task_led2 (void *p_arg)     {         (void) P_arg;     & nbsp                                 &nbsp ;  while (1)         {            LED2 (on)   &NBSP ;         OSTIMEDLYHMSM (0, 0,0,200);             LED2 (OFF);             OSTIMEDLYHMSM (0, 0,0,200);           }     }        //task 3  void task_led3 (void *p_arg)     {   & nbsp     (void) P_arg;                        while (1)      &nbs P  {            LED3 (on),             OSTIMEDL YHMSM (0, 0,0,300);             LED3 (OFF);             OSTIMEDLYHMSM (0, 0,0,300);                 }    }
"' # # #整体运行流程! [] (Http://images.cnitblog.com/blog/665192/201408/301618096415648.jpg)

Cond...


From for notes (Wiz)

STM32 Transplant Uc/os-ii Records

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.