Page 1 of 1

MULTI_STACK configuration on PIC32

Posted: Thu Sep 05, 2013 12:04 pm
by nkigen
Hi,
I want to set MULTI_STACK to TRUE so that I can use EVENT synchronization primitives(WaitEvent() and SetEvent()) in my application but I get the following error error whenever I do so:

Code: Select all

eecfg.c:24:19: error: array type has incomplete element type
Below is part of the OIL file:

Code: Select all

 MULTI_STACK = {IRQ_STACK=FALSE;};
          KERNEL_TYPE=FP;
Any idea on what could be the problem.
Regards, Nelson

Re: MULTI_STACK configuration on PIC32

Posted: Thu Sep 05, 2013 12:35 pm
by paolo.gai
I was looking for a multistack example for PIC32, but i see there is not yet one published as default demo. We'll add one soon.

Could you please send us via e-mail at "info" at "evidence.eu.com" your OIL file with a minimal main(), and we'll check it out.

What is the board you are using?

Ciao,

PJ

Re: MULTI_STACK configuration on PIC32

Posted: Fri Sep 06, 2013 11:26 am
by outlawch
Hi Nelson,
I think your fault is that you want to use EVENT synchronization primitives (WaitEvent() and SetEvent()) with FP kernel that NOT SUPPORT them.

FP kernel supports Resources Management (Immediate Pioriorty Ceiling Protocol) and Semaphores ONLY!!!

If you want to use EVENT synchronization primitives, then you have to choose as KERNEL_TYPE one of OSEK/VDX Conformance Class (BCC1, BCC2, ECC1, ECC2).

Bye.

P.S.: Soon I'll write a simple demo to illustrate how to use an OSEK/VDX Conformance Class in Multi Stack Configuration using Event Synchronization Primitives. Stay tuned!!! ;-)

Re: MULTI_STACK configuration on PIC32

Posted: Wed Sep 18, 2013 11:45 am
by nkigen
Hi all,
@paolo.gai. I am using microchip's explore16 board with pic32mx795f512l. I'll send the email with my oil file. Thanks

@outlawch. I think if you use KERNEL_TYPE=FP and set MULTI_STACK=TRUE, the conformance class ECC2(which should support blocking primitives) is automatically used?

Re: MULTI_STACK configuration on PIC32

Posted: Wed Sep 18, 2013 3:33 pm
by outlawch
Hi Nelson,
in order to use OSEK/VDX ECC2 Comformance Class in ERIKA Enterprese you have to specify KERNEL_TYPE=ECC2 with MULTI_STACK=TRUE in your OIL file.

I suggest you to read the official ERIKA Enterprise documentation: http://erika.tuxfamily.org/drupal/documentation.html.

Bye.

Re: MULTI_STACK configuration on PIC32

Posted: Wed Sep 18, 2013 3:36 pm
by paolo.gai
Hi,

we tried the multi_stack configuration and it compiled withoput problems.

Note also that you need to explicitly set ECC2 and MULTI_STACK in the OIL file in order to use them...

Ciao,

PJ

Re: MULTI_STACK configuration on PIC32

Posted: Wed Sep 18, 2013 4:05 pm
by nkigen
Hi,
I just did that but I am still getting an error.

Code: Select all


ERROR > Some errors : Property not found:
counter_maxallowed
{counter_type=SOFTWARE, counter_id=0, counter_cpu_mapped_id=default_cpu}
Check and fill folder test/Debug
	test/Debug/make_launcher.bat	OK

Here is part of my OIL file :

Code: Select all

/* ###*B*###
 * 
 *  Nelson Kigen, 2013
 *
 * ###*E*### */


CPU mySystem {
  
  OS myOs {
    EE_OPT = "DEBUG";
    
    CPU_DATA = PIC32 {
      APP_SRC = "code.c";
     ...
....

 
      MULTI_STACK = TRUE{IRQ_STACK=FALSE;};
      
      /*  STATUS = EXTENDED; */
      ICD2 = TRUE;
    };
    MCU_DATA = PIC32 {
      MODEL = PIC32MX795F512L;
    };
    
    BOARD_DATA = MICROCHIP_EXPLORER16 {
      USELEDS = TRUE;
      USEBUTTONS = TRUE;
      USELCD = TRUE; 
    };
    
    KERNEL_TYPE = ECC2;
... 
...
...   
  };
  
  COUNTER myCounter;
 
  TASK TaskKitt {
    PRIORITY = 4; 
   STACK=PRIVATE{
   SYS_SIZE=64;
       };
    SCHEDULE = FULL;
  };
  
  TASK TaskDisplay {
    AUTOSTART=TRUE;
    PRIORITY = 3; 
         STACK=PRIVATE{
           SYS_SIZE=128;
        }; 
       EVENT= EventUpdate;
    SCHEDULE = FULL;
  }; 
  
  /*Synchronization between updates*/
  
     EVENT EventUpdate{
         MASK = AUTO;
       };
       
    TASK TaskTouch { 
      PRIORITY = 5; 
      STACK=PRIVATE{
	   SYS_SIZE=64;
      };
     EVENT=EventUpdate;
      SCHEDULE = FULL;
    };
    
    TASK TaskHWDetect{
      PRIORITY = 10; 
      STACK=PRIVATE{
	  SYS_SIZE=64;
      };
      SCHEDULE=FULL;
    };
    COUNTER myCounter;
  
    ALARM AlarmKitt {
      COUNTER = myCounter;
      ACTION = ACTIVATETASK { TASK = TaskKitt; };
    };
    
    ALARM AlarmDisplay {
      COUNTER = myCounter;
      ACTION = ACTIVATETASK { TASK = TaskDisplay; };
    };
    
    ALARM AlarmTouch {
      COUNTER = myCounter;
      ACTION = ACTIVATETASK { TASK = TaskTouch; };
    }; 
    
};

and here is part of my main file:

Code: Select all


TASK(TaskDisplay)
{ 
//  ActivateTask(TaskTouch);
//         ActivateTask(TaskKitt);
 EventMaskType mask;
 while(1){	
    if (GOLDraw()) 
    {
    WaitEvent(EventUpdate);
    GetEvent(TaskDisplay, &mask);
    // ActivateTask(TaskTouch);
    }         
    if(mask & EventUpdate){
    updateWidgets();
    ClearEvent(EventUpdate);
    }
}
}

TASK(TaskTouch)
{
    if(TouchGetX()!=-1){
    TouchGetMsg(&msg); // Get message from touch screen
	GOLMsg(&msg); // Process message
	SetEvent(TaskDisplay,EventUpdate);
     }
}


Re: MULTI_STACK configuration on PIC32

Posted: Wed Sep 18, 2013 4:37 pm
by outlawch
Hi Nelson,
now your fault is that you have not correctly defined the COUNTER object.

The OIL Object COUNTER has some mandatory ATTRUBUTES:

COUNTER myCounter {
MINCYCLE = 1; /* LEAVE THIS VALUE TO 1 */
MAXALLOWEDVALUE = 65535 ; /* Change this to choose the counter resolution. */
TICKSPERBASE = 1; /* LEAVE THIS VALUE TO 1 */
};

You have to specify these attibutes to let RT-Druid to generate the correct configuration.

Bye.

P.S.: Note that in your OIL file you have specified COUNTER=myCounter; two (2) times!!! ;-)