欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 艺术 > AUTOSAR开源OS——Trampoline的编译与使用(二)

AUTOSAR开源OS——Trampoline的编译与使用(二)

2024/11/30 11:39:35 来源:https://blog.csdn.net/qq_44549690/article/details/142848677  浏览:    关键词:AUTOSAR开源OS——Trampoline的编译与使用(二)

环境准备

viper准备

如果没有viper配置的话,会出现如下报错:

Error: VIPER_PATH is not defined. Exiting
Exiting virtual platform.

因此需要正确配置viper,viper在trampoline中已经给了,就在源代码的根目录下面,需要执行如下命令进行配置

cd viper
make
export VIPER_PATH=`pwd`

此时再执行相关任务就不会出现上述报错了

任务配置

可以参考goil官方手册,这里贴一个案例demo作为参考,除了基础的applicatin和task等,还有一个IOC的案例

OIL_VERSION = "4.0";IMPLEMENTATION trampoline {/* This fix the default STACKSIZE of tasks */TASK {UINT32 STACKSIZE = 32768 ;} ;/* This fix the default STACKSIZE of ISRs */ISR {UINT32 STACKSIZE = 32768 ;} ;
};CPU only_one_periodic_task {OS config {NUMBER_OF_CORES = 1;STATUS = EXTENDED;BUILD = TRUE {APP_SRC = "ioc.c";TRAMPOLINE_BASE_PATH = "../../..";APP_NAME = "ioc_exe";LINKER = "gcc";SYSTEM = PYTHON;};};APPLICATION receiver_application {TASK = receiver;ALARM = check_every_seconds;COUNTER = SystemCounter_App0;};APPLICATION sender_application {TASK = sender;ALARM = please_send_a_message;COUNTER = SystemCounter_App1;};APPMODE std {};COUNTER SystemCounter_App0{};COUNTER SystemCounter_App1{};ALARM check_every_seconds {COUNTER = SystemCounter_App0;ACTION = ACTIVATETASK { TASK = receiver; };AUTOSTART = TRUE { APPMODE = std; ALARMTIME = 100; CYCLETIME = 100; };};ALARM please_send_a_message {COUNTER = SystemCounter_App1;ACTION = ACTIVATETASK { TASK = sender; };AUTOSTART = TRUE { APPMODE = std; ALARMTIME = 350; CYCLETIME = 300; };};TASK receiver {PRIORITY = 1;AUTOSTART = FALSE;ACTIVATION = 1;SCHEDULE = FULL;};TASK sender {PRIORITY = 2;AUTOSTART = FALSE;ACTIVATION = 1;SCHEDULE = FULL;};IOC my_ioc_name {DATATYPENAME uint32 {DATATYPEPROPERTY = DATA;};SEMANTICS = QUEUED {BUFFER_LENGTH = 5;};
//    SEMANTICS = LAST_IS_BEST {
//      INIT_VALUE_SYMBOL = AUTO;
//    };RECEIVER rcv {RCV_OSAPPLICATION = receiver_application;};SENDER snd {SND_OSAPPLICATION = sender_application;};};
};

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com