anyone interested in port ucosii to 9s12 welcomed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

anyone interested in port ucosii to 9s12 welcomed

2,299 Views
RChapman
Contributor I
This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.
 
Posted: Mon Aug 15, 2005 4:46 am    
 
i'm porting ucosii to 9s12dp256.i used cw ide downloaded from metrowerks site,but now when i compile my sw,always a message which indicate my code exceed 1024 bytes.in fact,the license download from net is allowed to compile 32k bytes.i don't know what's problem in this.anyone can help me?!
Posted: Mon Aug 15, 2005 5:39 am    
 
Hello

Did you put the licens file the right place?

Posted: Mon Aug 15, 2005 5:51 am    
 
yes,i put the license at the end of license which is build while setuo cw .
 
Posted: Mon Aug 15, 2005 9:30 am    
 
another problem puzzled me is that some rutine such as OS_CPU_C.C should be placed by #pragma code_seg or not.if not, where these program is located.

thanks!
 
Posted: Mon Aug 15, 2005 12:59 pm    
 
Quote:
yes,i put the license at the end of license which is build while setuo cw .


You need to copy and paste the 32K license file over top of the original license not append it to the end of the file I believe. Or open the 1K license in notepad erase the entire contents and then open the 32K and copy the entire contents and paste it in the copy of notepad that used to have the 1K license and then save it.
 
Posted: Tue Aug 16, 2005 3:16 am    

thank for your reply,i compile and pass it.but i have nothing to do with it,maybe my pc have ever some problems.

Posted: Thu Aug 18, 2005 8:54 am    

i  download a rutine from www.ucosii.com.in this routine i learned that "Tasks do not have to be in NON-PAGED memory.That is why I added an extra byte in every task's stack to save the PPAGE register that locate the memory page where the task is located. If a context switch occurs, the proper page will be saved/restored by uC/OS-II. This done automatically by the hardware provided that we add the option -CpPPAGE=0x30 as a compiler argument."
i can't understand why this done automatically by the hardware provided that we add the option -CpPPAGE=0x30 as a compiler argument.i believe that if the option -CpPPAGE=0x30 as a compiler argument,the page switch do not switch automaticlly but page always at 0x30.
if add the option -CpPPAGE=RUNTIME as a compiler argument,the page switch automatically.
what is right?can you explain it for me in detail?
thank you very much1!

Posted: Thu Aug 18, 2005 9:30 am    

This compiler switch tells the compiler the address location of the PPAGE register and has nothing to do with the contents of the register. In other words this does not define a particular page to use.
The S12 has an opcode (CALL) that automatically loads the correct page for the subroutine and the matching RTC opcode switches back to the source page - read the description of these opcodes and this will help you understand how the part works. In fact for code usage the location of the PPAGE register is irrelevant because its value is included in the CALL opcode anyway.

Posted: Fri Aug 19, 2005 10:46 am    

1)what's difference between -CpPPAGE=RUNTIME and -CpPPAGE=0x30.
2)a project downloaded from ucosii website is a port of MicroC/OS-II targeted to the Motorola microcontroller MC9S12DP256 using Metrowerks Codewarrior. how do task level comtext switch in this project?any code about page switch can't find.
i have learned much from here!
thanks.

Code:

/******************************************************************************************************** ;******************************************************************************************************** ; TASK LEVEL CONTEXT SWITCH ; ; Description : This function is called when a task makes a higher priority task ready-to-run. ; ; Arguments : none ; ; Note(s) : 1) Upon entry, ; OSTCBCur points to the OS_TCB of the task to suspend ; OSTCBHighRdy points to the OS_TCB of the task to resume ; ; 2) The stack frame of the task to suspend looks as follows: ; ; SP + 0 --> PPAGE ; + 1 CCR ; + 2 B ; + 3 A ; + 4 X (H) ; + 5 X (L) ; + 6 Y (H) ; + 7 Y (L) ; + 8 PC(H) ; + 9 PC(L) ; ; 3) The stack frame of the task to resume looks as follows: ; ; OSTCBHighRdy->OSTCBStkPtr + 0 --> PPAGE ; + 1 CCR ; + 2 B ; + 3 A ; + 4 X (H) ; + 5 X (L) ; + 6 Y (H) ; + 7 Y (L) ; + 8 PC(H) ; + 9 PC(L) ;******************************************************************************************************** ;*********************************************************************************************************/ #pragma TRAP_PROC void OSCtxSw(void) { __asm{ ldx OSTCBCur ; 3~, OSTCBCur->OSTCBStkPtr = Stack Pointer sts 0,x ; 3~ } #if OS_CPU_HOOKS_EN > 0 OSTaskSwHook(); /* 4~, Invoke user defined context switch hook */ #endif __asm{ ldx OSTCBHighRdy ; 3~, OSTCBCur = OSTCBHighRdy stx OSTCBCur ; 3~ ldab OSPrioHighRdy ; 3~, OSPrioCur = OSPrioHighRdy stab OSPrioCur ; 3~ lds 0,x ; 3~, Load SP into 68HC12 } }

 


 Posted: Wed Aug 31, 2005 7:12 pm    

 

Does -CpPPAGE=RUNTIME work? You didn't quite say if it does. The reason to give the address of PPAGE is because some target might have PPAGE register at address 0x1030 or something like that. If RUNTIME works, then it must be assuming that the address is 0x30 for the register.


Labels (1)
0 Kudos
0 Replies