Following the reference example, in the sample example of AUTOSAR_OS,
a task was added that required the LED light to be reversed once per second
The configuration of EB is shown in the figure
The configuration of EB is shown in the figure,
following the example of TASK1 given by LAB2
Solved! Go to Solution.
I see in your project:
- OsScheduleTableExpiryPoint3 is setup every 7500 ticks based on the counter of the Schedule Table:
- TaskCnt is setup in this expired point, so it should be called every 7500 ticks
- The OsAlarm_C is setting up incorrectly:
It's because Os_AlarmC is assigned to both TRUSTED_APP and TASK_APP, and only one application should be chosen:
The call of Os_Shutdown indicates that your application has run into a critical error, and OS needs to shutdown. Please check whether you have done incorrectly with the code/configuration.
Or can you configure a simple extended task routine on EB? There are always errors in the configuration on EB just now.
The file configuration has been compiled, and there is no right or wrong mark
Thank you very much
For scheduling a routine task you can do it by add this task to schedule table (like TASKCNT in the sample application) and specify the expire point:
I would recommend to implement just a simple process for a task, maybe a counter increase, instead of integrating MCAL configuration into it.
I have configured EB and project according to your general idea of configuring and adding tasks. However, it was entered once in TASK C, and never entered into my project in the future. Why is there any problem?
The task is the same, keep entering, change the pin of the mpc5748g thank you
I see in your project:
- OsScheduleTableExpiryPoint3 is setup every 7500 ticks based on the counter of the Schedule Table:
- TaskCnt is setup in this expired point, so it should be called every 7500 ticks
- The OsAlarm_C is setting up incorrectly:
It's because Os_AlarmC is assigned to both TRUSTED_APP and TASK_APP, and only one application should be chosen:
In the project, Task_C hasn't been added in Schedule Table/ activate in any alarm. I only see the OSCnt. Are you referring to the OSCnt?
Add task C to the project to activate the alarm, as shown in the figure.
The way you want to achieve this is to extend the activation event waiting for task C to trigger.
Now write the code, can use OsAlarm_C to activate.
But what you said about activation in the schedule table, I have added EB successfully and always got an error in configuration.
Extended task that activate the activated by scheduling table? In the scheduling OsScheduleTableExpiryPoint.
Which error you're getting with? Please describe your expectation also. I'm completely lost about what you're saying.
My final goal is to create an extended task C with the code "Status = WaitEvent(osEvent_c)" in the task;
Wait for an event to occur to activate task C. Simulation will find that it can enter task C at startup,
and then it will hang forever.I don't enter task C anymore,
and then I find that the previous code was incorrectly written as "Status = WaitEvent(OSTASK_C)", so the task hangs forever
.
Then you said that an extended task requires a schedule table or an event to be activated.
I understand event activation, but I don't understand schedule activation
Task activation by schedule table is like how you do with the TaskCnt. Is there any problem with TaskCnt function call?
Thank you very much for your patient reply.
In general, can a scheduled table activate an extended task like a taskCNT task
The difference between basic task and extended task is the wait state is available on in extended task. Otherwise, there would be no difference and theoretically, extended task can be scheduled in schedule table as basic task.
Thanks again for your patience. For the last question,
TaskCnt and TASK(TaskCnt) use status = incrementCounter (STCOUNTER).
This statement will not conflict
Are you referring to a same task, or two different tasks? As I see you are asking about "TaskCnt and TASK(TaskCnt)" which should be the same. Anyway, IncrementCounter() can be called in two separate tasks, as long as it doesn't violate the following rules (which are noted in Technical Reference):
- Insufficient access rights (if more than one OS-Application configured)
- The counter identifier is invalid or belongs to hardware counter.
- Call at not allowed context.
- Call when interrupts are disabled by OS services.
Sorry, different tasks Task (OSCcnt) and Task (TASKCNT)
Thank you for your patient reply
The TaskCnt function scheduler would have a ExpiryPoint that would be a context call for a basic task?
as shown in the figure
Status = incrementCounter (stCounter);
Task (TaskCNT)status = incrementCounter (stCounter) statement conflict in the official SAMLPE?
In the example, TASKCnt is not used in waiting for event context, so it should be basic task.
Hello,
Has your added task (OsTaskA, OsTaskB) are executed during runtime? Could you provide the SW call stack before entering Os_Shutdown?