Hello everybody,
I'm trying to use embOS on a Toshiba TMPA900CM (ARM926EJ-S Core). The problem is that as I enter the CREATETASK() function / macro OS_Error 163 is called. I debugged the application several times. Here are the functions which are called:
OS_CREATETASK() => OS_CreateTask_D => OS_AssertISROrTask => OS_GetCPUState. In fact OS_GetCPUState returns 0 and that results in Error Code 163 in OS_AssertISROrTask. I only have the Object-File Version so its difficult to Debug this problem. This is my main.c (as in the documentation)
Display All
My OS_InitHW() function I templated from the TMPA910 Board Support:
Display All
I'm not sure if I called the OS_IncDI() and OS_DecRI() functions in the right way, but I think so because it's the same as in the examples. I also don't understand why the OS want's to be in "ISR State" when I create a task. I would appreciate any help. If you need more source code that's no problem. I will post if necessary. Sorry for my English, I'm practising!
lowlevel
I'm trying to use embOS on a Toshiba TMPA900CM (ARM926EJ-S Core). The problem is that as I enter the CREATETASK() function / macro OS_Error 163 is called. I debugged the application several times. Here are the functions which are called:
OS_CREATETASK() => OS_CreateTask_D => OS_AssertISROrTask => OS_GetCPUState. In fact OS_GetCPUState returns 0 and that results in Error Code 163 in OS_AssertISROrTask. I only have the Object-File Version so its difficult to Debug this problem. This is my main.c (as in the documentation)
C Source Code
- #define OS_LIBMODE_D
- #include "RTOS.h"
- extern OS_GLOBAL OS_Global; // Only for Debugging
- OS_STACKPTR int StackHP[128], StackLP[128];
- OS_TASK TCBHP, TCBLP;
- static void HPTask(void)
- {
- while(1)
- {
- OS_Delay(10);
- }
- }
- static void LPTask(void)
- {
- while(1)
- {
- OS_Delay(50);
- }
- }
- int main()
- {
- OS_IncDI();
- OS_InitKern();
- OS_InitHW();
- OS_CREATETASK(&TCBHP, "HP Task", HPTask, 100, StackHP);
- OS_CREATETASK(&TCBLP, "LP Task", LPTask, 50, StackLP);
- OS_Start();
- return 0;
- }
My OS_InitHW() function I templated from the TMPA910 Board Support:
C Source Code
- void OS_InitHW(void) {
- OS_IncDI();
- // OS_ARM_CACHE_Sync(); // Ensure, caches are synchronized
- _OS_TIMER_CTRL = 0; // Stop timer
- // _OS_CLKCR5 |= 0x0F; // Default value after Reset = fHCLK / 2
- _OS_TIMER_LOAD = OS_TIMER_RELOAD; // Set timer interval
- _OS_TIMER_CTRL = (1 << 7)
- | (1 << 6)
- | (1 << 5)
- | (0 << 4)
- | (0 << 3)
- | (0 << 2)
- | (1 << 1)
- | (0 << 0)
- ;
- OS_ARM_InstallISRHandler(_OS_TIMER_INT_INDEX, _OS_ISR_Tick);
- OS_ARM_ISRSetPrio(_OS_TIMER_INT_INDEX, _INT_PRIORITY_LOWEST);
- OS_ARM_EnableISR(_OS_TIMER_INT_INDEX);
- //OS_COM_Init();
- OS_DecRI();
- }
I'm not sure if I called the OS_IncDI() and OS_DecRI() functions in the right way, but I think so because it's the same as in the examples. I also don't understand why the OS want's to be in "ISR State" when I create a task. I would appreciate any help. If you need more source code that's no problem. I will post if necessary. Sorry for my English, I'm practising!
lowlevel