一目了然
- 1 Erika Enterprise RTOS簡介
-
- 1.1 主要特性
- 1.2 Erika Enterprise下載下傳
- 2 開發環境
-
- 2.1 開發環境配置及使用
- 2.2 開發環境簡介
- 2.3 工程檔案介紹
- 2.4 Erika Enterprise文檔資料下載下傳
1 Erika Enterprise RTOS簡介
Erika Enterprise是一個免專利的汽車OSEK/VDX認證的硬實時作業系統(RTOS)。官網連結:http://www.erika-enterprise.com/
1.1 主要特性
最新版本介紹:
注意:雖然Erika Enterprise的V2和V3版本都支援多核晶片處理,但是V2版本需要在每一個核上各自運作一份Erika RTOS代碼,這和FreeRTOS的多核應用是類似的;而V3版本則支援晶片内所有核共用一份Erika RTOS代碼。
1.2 Erika Enterprise下載下傳
Erika Enterprise下載下傳連結位址:http://www.erika-enterprise.com/index.php/download/erika-v3-download.html,界面如下圖所示:
選中其中的三個“Accept”選項後點選“Submit Form”按鍵進入到如下圖所示界面:
開發人員可根據需要下載下傳對應版本的開發環境。
2 開發環境
2.1 開發環境配置及使用
有關Erika Enterprise開發環境的配置和使用可參考官網提供的資料進行。
Quick start guide:
http://www.erika-enterprise.com/wiki/index.php?title=Quick_start_guide
Application example:
http://www.erika-enterprise.com/wiki/index.php?title=AVR8_-_Arduino_application_build_on_Windows
2.2 開發環境簡介
按照官方提供Quick start guide完成配置後會在桌面生成IDE圖示:
- Eclipse系IDE,基于Workspace進行Project開發
- 根據選用晶片直接生成工程例程
- 與OSEK系統的使用類似,IDE中提供OIL(OSEK Implementation Language)檔案設定界面
- 系統的使用,包括CPU設定、任務建立、異步通信設定等在OIL檔案中設定,通過IDE生成源碼檔案
ERIKA3 OIL specification連結:
http://www.erika-enterprise.com/wiki/index.php?title=ERIKA3_OIL_specification
2.3 工程檔案介紹
以Infineon TC297晶片建立工程為例,工程檔案目錄如下圖所示:
工程OIL檔案(conf.oil)舉例說明:
/* ###*B*###
* Erika Enterprise, version 3
*
* Copyright (C) 2017 - 2019 Evidence s.r.l.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License, version 2, for more details.
*
* You should have received a copy of the GNU General Public License,
* version 2, along with this program; if not, see
* <www.gnu.org/licenses/old-licenses/gpl-2.0.html >.
*
* This program is distributed to you subject to the following
* clarifications and special exceptions to the GNU General Public
* License, version 2.
*
* THIRD PARTIES' MATERIALS
*
* Certain materials included in this library are provided by third
* parties under licenses other than the GNU General Public License. You
* may only use, copy, link to, modify and redistribute this library
* following the terms of license indicated below for third parties'
* materials.
*
* In case you make modified versions of this library which still include
* said third parties' materials, you are obligated to grant this special
* exception.
*
* The complete list of Third party materials allowed with ERIKA
* Enterprise version 3, together with the terms and conditions of each
* license, is present in the file THIRDPARTY.TXT in the root of the
* project.
* ###*E*### */
CPU test_application {
OS EE {
/* EE_OPT = "OS_EE_VERBOSE"; */
EE_OPT = "OSEE_DEBUG";
EE_OPT = "OSEE_ASSERT";
EE_OPT = "OS_EE_APPL_BUILD_DEBUG";
EE_OPT = "OS_EE_BUILD_DEBUG";
//EE_OPT = "OSEE_TC_CLONE_OS";
CPU_DATA = TRICORE {
ID = 0x0;
CPU_CLOCK = 200.0;
COMPILER = GCC;
IDLEHOOK = TRUE {
HOOKNAME = "idle_hook_core0";
};
};
CPU_DATA = TRICORE {
ID = 0x1;
MULTI_STACK = TRUE;
IDLEHOOK = TRUE {
HOOKNAME = "idle_hook_core1";
};
};
CPU_DATA = TRICORE {
ID = 0x2;
IDLEHOOK = TRUE {
HOOKNAME = "idle_hook_core2";
};
};
MCU_DATA = TC27X {
DERIVATIVE = "tc277tf";
REVISION = "DC";
};
STATUS = EXTENDED;
ERRORHOOK = TRUE;
USERESSCHEDULER = FALSE;
USEORTI = TRUE;
KERNEL_TYPE = OSEK {
CLASS = ECC1;
// RQ = MQ;
};
};
APPDATA tricore_mc {
APP_SRC="master.c";
APP_SRC="slave1.c";
APP_SRC="slave2.c";
};
TASK TaskMaster {
CPU_ID = 0x0;
PRIORITY = 1;
};
TASK TaskCpu0Remote {
CPU_ID = 0x0;
PRIORITY = 2;
};
TASK TaskSlave1 {
CPU_ID = 0x1;
PRIORITY = 1;
AUTOSTART = TRUE;
STACK = PRIVATE {
SIZE = 256;
};
ACTIVATION = 1;
SCHEDULE = FULL;
EVENT = RemoteEvent;
};
TASK TaskSlave2 {
CPU_ID = 0x2;
PRIORITY = 1;
};
EVENT RemoteEvent { MASK = AUTO; };
COUNTER system_timer_master {
CPU_ID = 0x0;
MINCYCLE = 1;
MAXALLOWEDVALUE = 2147483647;
TICKSPERBASE = 1;
TYPE = HARDWARE {
DEVICE = "STM_SR0";
SYSTEM_TIMER = TRUE;
PRIORITY = 2;
};
SECONDSPERTICK = 0.01;
};
COUNTER system_timer_slave2 {
CPU_ID = 0x2;
MINCYCLE = 1;
MAXALLOWEDVALUE = 2147483647;
TICKSPERBASE = 1;
TYPE = HARDWARE {
DEVICE = "STM_SR0";
SYSTEM_TIMER = TRUE;
PRIORITY = 2;
};
SECONDSPERTICK = 0.01;
};
ALARM AlarmMaster_1s {
COUNTER = system_timer_master;
ACTION = ACTIVATETASK { TASK = TaskMaster; };
AUTOSTART = TRUE { ALARMTIME = 100; CYCLETIME = 100; };
};
ALARM AlarmSlave2RemoteCPU0 {
COUNTER = system_timer_slave2;
ACTION = ACTIVATETASK { TASK = TaskCpu0Remote; };
};
};
當配置使用晶片的多個核時,需在oil檔案中對多個核進行設定:
CPU_DATA = TRICORE {
ID = 0x0;
CPU_CLOCK = 200.0;
COMPILER = GCC;
IDLEHOOK = TRUE {
HOOKNAME = "idle_hook_core0";
};
};
CPU_DATA = TRICORE {
ID = 0x1;
MULTI_STACK = TRUE;
IDLEHOOK = TRUE {
HOOKNAME = "idle_hook_core1";
};
};
CPU_DATA = TRICORE {
ID = 0x2;
IDLEHOOK = TRUE {
HOOKNAME = "idle_hook_core2";
};
};
2.4 Erika Enterprise文檔資料下載下傳
收集的Erika Enterprise RTOS的文檔資料包連結:
https://download.csdn.net/download/weixin_43986229/12881761