Thomas KINTZEL

MPC5xx: TurboOSEK - Question to resources + scheduling

Discussion created by Thomas KINTZEL on Oct 6, 2006
Latest reply on Oct 10, 2006 by Thomas KINTZEL
Hello,

I'm using CodeWarrior V8.1 / Turbo OSEK 2.3 for MPC 5xx. I 've got 2 questions from my current work. I guess that I do not understand something

1) Scheduling in Turbo OSEK

If I have a C - statement with a global integer "data1" like this

   data1 = data1 | 0x01;

The compiler generates from this C code at least 3 assembler operations something like

read data1 to register
modify register
write register to data1

Is it correct to assume that a task switch from OSEK can interrupt the read/modify/write operation?


2) Resources

I want to control the access to memory using a resource.

the access with the 1st and 2nd tasks works as expected. If a third task tries to call "GetResource()" the system crashs with Machine Check Exception 0x200. Is it possible that a ressource can be shared only between two tasks?

If this is helpful: The debuggers shows the current line as


    StatusType OSGetResource( ResourceType resId )
    {

    ...

    #endif /* defined(OSRESOURCEISR) */
    {
-->   if (OsRunning->taskId resId->prio )
      { /* or resource with lower priority */
        OSRETERROR( E_OS_ACCESS, OSServiceId_GetResource, resId );
      }

      ...


Thanks for your help
Thomas

Message Edited by Thomas Kintzel on 2006-10-0610:14 AM

Message Edited by CrasyCat on 2007-04-13 01:42 PM

Outcomes