Erika and STM32

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
beam
Newbie
Posts: 4
Joined: Fri Jul 17, 2015 1:07 pm

Erika and STM32

Post by beam » Sat Jul 18, 2015 8:12 am

Hi All,

Please could any one help me

when I try to compile my project I get the following error

make all
Building file: ../code.c
Invoking: Cross GCC Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"code.d" -MT"code.d" -o "code.o" "../code.c"
../code.c:5:16: fatal error: ee.h: No such file or directory
compilation terminated.
make: *** [code.o] Error 1


here is the my oil and Code files:

Code: Select all


CPU mySystem {

    OS myOs {
 
        EE_OPT = "DEBUG";
        EE_OPT = "__OO_STARTOS_OLD__";
	EE_OPT = "__USE_CMSIS_ALL__";
        EE_OPT = "__USE_SPD_ALL__";
        EE_OPT = "__USE_SYSTICK__";
       
		CFLAGS = ""; //-std=c99
		
		}
            //CPU_CLOCK = 168.0; 
               CPU_DATA = CORTEX_MX {
	            MODEL = M4;
                APP_SRC = "code.c";
                //COMPILER_TYPE = KEIL;
                COMPILER_TYPE = GNU;

                MULTI_STACK = TRUE { 
                   IRQ_STACK = TRUE {
                   SYS_SIZE = 512;
                   };
             };
            };
        
        MCU_DATA = STM32 {
         MODEL = STM32F4xx;
        };
 
        
		STATUS = EXTENDED;
		STARTUPHOOK = FALSE;
		ERRORHOOK = FALSE;
		SHUTDOWNHOOK = FALSE;
		PRETASKHOOK = FALSE;
		POSTTASKHOOK = FALSE;
		USEGETSERVICEID = FALSE;
		USEPARAMETERACCESS = FALSE;
		USERESSCHEDULER = FALSE;
		
        KERNEL_TYPE = ECC2;
		
		EE_OPT = "__ADD_LIBS__";
		
        LIB = ENABLE {
           NAME = "ST_CMSIS";
         };
 
        LIB = ENABLE {
           NAME = "STM32F4XX_SPD";
               STM32F4XX_SPD = ENABLE {
               USETIM = TRUE; 
               USEI2C = TRUE;
               USEMISC = TRUE;
               USESPI = TRUE;
               USEUSART = TRUE;
			 };
        };
  
        LIB = ENABLE {
            NAME = "STM32F4_DISCOVERY";
        };
        
		
		EVENT recEvent {
              MASK = AUTO;
        };

        TASK setRecTask {
           PRIORITY = 0x01; /* high priority */
           AUTOSTART = FALSE;
           STACK = PRIVATE {
           SYS_SIZE = 512;
           };
           ACTIVATION = 1;  /* only one pending activation */
           SCHEDULE = FULL;
           EVENT = recEvent;
        };
		
   };
 
and for the code .c

Code: Select all


#include "ee.h"
#include "ee_api.h"
#include "kernel/oo/inc/ee_oo_api.h"
#include "stm32f4xx.h"
#include "stm32f4_discovery.h"



DeclareTask(setRecTask);
DeclareEvent(recEvent);

TASK(setRecTask) {
 EventMaskType current;
  while (1) {
    if(WaitEvent(recEvent) == E_OK){
    /* error handling */
  }
  getEvent(setRecTask, &current); /* save event */
  ClearEvent(recEvent);

  /* do some fancy task work */
  }
  TerminateTask(); // never reached
}


int main(void) {

/* Initialize Erika related stuff */
  EE_system_init();



  /*Initialize systick */
  	EE_systick_set_period(MILLISECONDS_TO_TICKS(1, SystemCoreClock));
  	EE_systick_enable_int();
  	EE_systick_start();


  while (1) {
    SetEvent(setRecTask, recEvent);
    Delay(MILLISECONDS_TO_TICKS(100, SystemCoreClock));
  }

}

Thanks in advance for your help,

Beam

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Erika and STM32

Post by paolo.gai » Sun Jul 19, 2015 3:53 pm

Dear beam,

Are you using the virtual machine we distribute on http://www.erika-enterprise.com ?

This should not happen with that one.

ee.h is one of the main include files of ERIKA... if it is missing it means that the makefile is pointing to a non-existing version of ERIKA... which is quite strange.

PJ

beam
Newbie
Posts: 4
Joined: Fri Jul 17, 2015 1:07 pm

Re: Erika and STM32

Post by beam » Sun Jul 19, 2015 7:03 pm

Dear Paolo,

yes I am using the VM for STM32

Thanks
beam

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Erika and STM32

Post by paolo.gai » Mon Jul 20, 2015 7:53 am

I have just restarted the VM and tried to compile... and it worked without problems.

It probably depends on some kind of changes you may have done to the default installation we provide in the VM.

Ciao,

Paolo

beam
Newbie
Posts: 4
Joined: Fri Jul 17, 2015 1:07 pm

Re: Erika and STM32

Post by beam » Tue Jul 21, 2015 1:46 am

Thanks Paolo, it works.

Ciao
Beam

Post Reply