1 / 16

ucosii porting on pxa270

ucosii porting on pxa270. 粘家華 R96922041 林育佳 R96922062. Demo on PXA270. Application demo.c (DEMO_HUHU()). boot head.s ( Platform Specific Code ). Drivers driver.c driver.h (Platform Specific Code). Software. Hardware. CPU. Timer. 7- segment. head.s. .vector ResetHandler reset_irq

marina
Télécharger la présentation

ucosii porting on pxa270

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ucosii porting on pxa270 • 粘家華 R96922041 • 林育佳 R96922062

  2. Demo on PXA270 Application demo.c (DEMO_HUHU()) boothead.s(Platform Specific Code) Driversdriver.c driver.h(Platform Specific Code) Software Hardware CPU Timer 7-segment

  3. head.s • .vector • ResetHandler • reset_irq • Initial GPIO, Mmory_Controller • enable APD • Set up a stack [for calling C code] • Create MMU tables • Enable MMU • InitStacks (IRQMode, FIQMode, SVC_MODE) • bl main

  4. tools • Environment • Cygwin + WinXP • Compiler • GNU arm-elf-tools-cygwin v2.95.3 • Platform • PXA 270

  5. Ucosii on PXA270 Application demo.c ( task1() task2() ) OS-IIOS_CORE.C OS_MBOX.C OS_MEM.C OS_Q.COS_SEM.C OS_TASK.C OS_TIME.C … etc (Processor Independent Code) Driversdriver.c driver.h(Platform Specific Code) OS-II PortOS_CPU.h OS_CPU_A.s OS_CPU_C.c(Processor Specific Code) boothead.s(Platform Specific Code) Software Hardware CPU Timer Serial I/O

  6. Goal step • Step 1 : task1 can run correctly and display something on serial I/O. • OSTaskStkInit in OS_CPU_C.c • OSStartHighRdy in OS_CPU_A.s • Step 2 : task1 call delay function, task2 run • OS_TASK_SW in OS_CPU_A.s

  7. OS_CPU_C.c void *OSTaskStkInit (void (*task)(void *pd), void *pdata, void *ptos, INT16U opt) { unsigned int *stk ; opt = opt; /* 'opt' is not used, prevent warning */ stk = (unsigned int *)ptos; /* Load stack pointer */ /* build a context for the new task */ *stk = (unsigned int) task; /* PC */ *--stk = 0; /* lr */ *--stk = 0; /* r12 */ *--stk = 0; /* r11 */ *--stk = 0; /* r10 */ *--stk = 0; /* r9 */ *--stk = 0; /* r8 */ *--stk = 0; /* r7 */ *--stk = 0; /* r6 */ *--stk = 0; /* r5 */ *--stk = 0; /* r4 */ *--stk = 0; /* r3 */ *--stk = 0; /* r2 */ *--stk = 0; /* r1 */ *--stk = (unsigned int) pdata; /* r0 */ *--stk = SVC32MODE; /* spsr YYY+ */ *--stk = SVC32MODE; /* psr */ return ((void *)stk); }

  8. OS_CPU_A.s • OSStartHighRdy

  9. OS_CPU_A.s • OS_TASK_SW

  10. Goal step • Step 3 : interrupt handler can run correctly. • Initial_TIMER0 in driver.c • IrqHnd in head.s • Step 4 : task1 can resume • IrqHnd in head.s • OSIntCtxSw in OS_CPU_A.s • _IntCtxSw in OS_CPU_A.s

  11. driver.c void Initial_TIMER0(void) { tick_on = UM; tick_ms = 0; tick_sec = 0; tick_min = 0; tick_hour = 0; OIER = 0; /* disable any timer interrupts */ OSCR = LATCH*2; /* push OSCR out of the way */ OSMR0 = LATCH; /* set initial match */ OSSR = 0xf; /* clear status on all timers */ OIER = OIER_E0; /* enable match on timer 0 to cause interrupts */ OSCR = 0; /* initialize free-running timer */ }

  12. head.s • IrqHnd • bl Chandler

  13. OS_CPU_A.s • OSIntCtxSw • IntCtxSw

  14. head.s • IrqHnd • IrqHnd: • STMFD sp!,{r0-r3,r12,lr} • bl OSIntEnter • bl OSTimeTick • bl OSIntExit • LDR r0,=OSIntCtxSwFlag • LDR r1,[r0] • CMP r1,#1 • BEQ _IntCtxSw • LDMFD sp!, {r0-r3,r12,lr} • SUBS pc, lr, #4

  15. DEMO

  16. Thanks • 戴偉堯 • 涂堂訓 • EOS助教

More Related