Technical discussions about Freescale (Motorola) DSPs (including the DSP56000, DSP56300, DSP56600, 56800 DSPs).
Hello, I am trying to make the uCOS-II (v. 2.76) work on the dsp56807 with use of CodeWarrior 7.0. PE does not provide any example of using uCOS with this CPU so I have: - created a new project for dsp56807 - added the uCOS beam - added the uCOS files to the 'code' directory and to the project as 'user beams'. I also made some minor changes in them (changing to "" in #includes, otherwise it doesn't compile) - copied a code from a uCOS example (CPUUtil) to my main project file - compiled the project It was possible to compile the project, but after running it, CPU was behaving at least weird. After invoking OSStart() the programm was returning to the very beginning of main() (it looks like a CPU reset). Does anybody know the reason of these problems? Have any of you tried to run uCOS dsp56807 (i.e. dsp568xx) ? Any hints? Regards Bartek
Hello, You need to make sure that you save all of the registers in your interrupt service routines using #pragma alignsp save_all and also add uCOS-II support code to your interrupt service routines.? This code is: to the beginning of the routine add - ? // support uCOS??? ? OS_ENTER_CRITICAL();???????????????????????????????????????? ???? OSIntNesting++;?????????????????? /* Increment interrupt nesting */??? ? OS_EXIT_CRITICAL(); to the end of the routine add - ? uCOS1_OSIntExit();???????????// Decrement the nesting counter ?????????????????????????????????????? // and if 0 then determine if whether or not ?????????????????????????????????????? // a higher priority task has been awakened ?????????????????????????????????????? // by an ISR.??? lmf -----Original Message----- From: wicherba <w...@op.pl> To: m...@yahoogroups.com Sent: Tue, 11 Sep 2007 11:10 am Subject: [motoroladsp] uCOS for dsp56807 Hello, I am trying to make the uCOS-II (v. 2.76) work on the dsp56807 with use of CodeWarrior 7.0. PE does not provide any example of using uCOS with this CPU so I have: - created a new project for dsp56807 - added the uCOS beam - added the uCOS files to the 'code' directory and to the project as 'user beams'. I also made some minor changes in them (changing to "" in #includes, otherwise it doesn't compile) - copied a code from a uCOS example (CPUUtil) to my main project file - compiled the project It was possible to compile the project, but after running it, CPU was behaving at least weird. After invoking OSStart() the programm was returning to the very beginning of main() (it looks like a CPU reset). Does anybody know the reason of these problems? Have any of you tried to run uCOS dsp56807 (i.e. dsp568xx) ? Any hints? Regards Bartek
Thanks for response. The thing is, that I don't use any ISRs yet. The debug=
ger doesn't even step into a SystemTask (PE_SystemTask()). Following happen=
s when I debug:
void main(void)
{
PE_low_level_init();
RandomSem =3D uCOS1_OSSemCreate(1);
OSStart(); =
=20
}
void PE_low_level_init(void)
{
.....
Inhr1_Init(); //init timer for RTOS ticks
__EI();
OSInit();
OSTaskCreate(PE_SystemTask, NULL, (void *)&PE_SystemTaskStk[0], 0);=20
}
void OSStart (void)
{
INT8U y;
INT8U x;
if (OSRunning =3D=3D FALSE) {
y =3D OSUnMapTbl[OSRdyGrp];=20=20=20=20=20=20=20=20
x =3D OSUnMapTbl[OSRdyTbl[y]];
OSPrioHighRdy =3D (INT8U)((y << 3) + x);
OSPrioCur =3D OSPrioHighRdy;
OSTCBHighRdy =3D OSTCBPrioTbl[OSPrioHighRdy];=20
OSTCBCur =3D OSTCBHighRdy;
OSStartHighRdy(); // <=3D=3D=3D=3D debugger j=
umps from here to Inhr1_Init() and then back to the beginning of main.
}
}
It seems that there is some error in a port made by Processor Expert, or I =
do something wrong (more likely)...I will be really grateful for help.
Regards
Bartek
l...@netscape.net napisa=B3:
>Hello,
>
>You need to make sure that you save all of the registers in your interrupt=
service routines using=20
>
>#pragma alignsp save_all
>
>and also add uCOS-II support code to your interrupt service routines.? Thi=
s code is:
>
>to the beginning of the routine add -
>
>? // support uCOS???=20
>? OS_ENTER_CRITICAL();????????????????????????????????????????=20
>???? OSIntNesting++;?????????????????? /* Increment interrupt nesting */??=
?=20
>? OS_EXIT_CRITICAL();
>to the end of the routine add -
>
>? uCOS1_OSIntExit();???????????// Decrement the nesting counter
>?????????????????????????????????????? // and if 0 then determine if wheth=
er or not
>?????????????????????????????????????? // a higher priority task has been =
awakened
>?????????????????????????????????????? // by an ISR.???=20
>
>lmf
>-----Original Message-----
>From: wicherba <w...@op.pl>
>To: m...@yahoogroups.com
>Sent: Tue, 11 Sep 2007 11:10 am
>Subject: [motoroladsp] uCOS for dsp56807
>Hello,
>
>I am trying to make the uCOS-II (v. 2.76) work on the dsp56807 with=20
>use of CodeWarrior 7.0. PE does not provide any example of using uCOS=20
>with this CPU so I have:
>
>- created a new project for dsp56807
>- added the uCOS beam
>- added the uCOS files to the 'code' directory and to the project as=20
>'user beams'. I also made some minor changes in them (changing to ""=20
>in #includes, otherwise it doesn't compile)
>- copied a code from a uCOS example (CPUUtil) to my main project file
>- compiled the project
>
>It was possible to compile the project, but after running it, CPU was=20
>behaving at least weird. After invoking OSStart() the programm was=20
>returning to the very beginning of main() (it looks like a CPU=20
>reset). Does anybody know the reason of these problems? Have any of=20
>you tried to run uCOS dsp56807 (i.e. dsp568xx) ? Any hints?
>
>Regards
>
>Bartek
>
=20