Autosar_os runs for a while and then stops. What happened

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autosar_os runs for a while and then stops. What happened

Jump to solution
3,686 Views
lubo_NEW
Contributor III

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 LAB2QQ图片20210315133449.png

0 Kudos
1 Solution
3,528 Views
namnguyenviet
NXP Employee
NXP Employee

I see in your project:

- OsScheduleTableExpiryPoint3 is setup every 7500 ticks based on the counter of the Schedule Table:

namnguyenviet_1-1616395040620.png

- TaskCnt is setup in this expired point, so it should be called every 7500 ticks

namnguyenviet_0-1616394909534.png

- The OsAlarm_C is setting up incorrectly:

namnguyenviet_2-1616395144736.png

It's because Os_AlarmC is assigned to both TRUSTED_APP and TASK_APP, and only one application should be chosen:

namnguyenviet_3-1616395284371.png

 

 

View solution in original post

0 Kudos
26 Replies
3,117 Views
namnguyenviet
NXP Employee
NXP Employee

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.

0 Kudos
3,088 Views
lubo_NEW
Contributor III

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

0 Kudos
3,067 Views
namnguyenviet
NXP Employee
NXP Employee

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:

namnguyenviet_0-1616149358388.png

namnguyenviet_1-1616149404893.png

I would recommend to implement just a simple process for a task, maybe a counter increase, instead of integrating MCAL configuration into it. 

 

0 Kudos
3,036 Views
lubo_NEW
Contributor III

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

QQ图片20210322141344.pngQQ图片20210322132704.pngQQ图片20210322141551.png

0 Kudos
3,529 Views
namnguyenviet
NXP Employee
NXP Employee

I see in your project:

- OsScheduleTableExpiryPoint3 is setup every 7500 ticks based on the counter of the Schedule Table:

namnguyenviet_1-1616395040620.png

- TaskCnt is setup in this expired point, so it should be called every 7500 ticks

namnguyenviet_0-1616394909534.png

- The OsAlarm_C is setting up incorrectly:

namnguyenviet_2-1616395144736.png

It's because Os_AlarmC is assigned to both TRUSTED_APP and TASK_APP, and only one application should be chosen:

namnguyenviet_3-1616395284371.png

 

 

0 Kudos
3,028 Views
lubo_NEW
Contributor III

Sorry, the error is that the project was not saved well. Now upload it again

0 Kudos
3,004 Views
namnguyenviet
NXP Employee
NXP Employee

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?

0 Kudos
2,990 Views
lubo_NEW
Contributor III

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.QQ图片20210323090000.png

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.

 

 

0 Kudos
2,986 Views
namnguyenviet
NXP Employee
NXP Employee

Which error you're getting with? Please describe your expectation also. I'm completely lost about what you're saying.

0 Kudos
2,980 Views
lubo_NEW
Contributor III

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

0 Kudos
2,975 Views
namnguyenviet
NXP Employee
NXP Employee

Task activation by schedule table is like how you do with the TaskCnt. Is there any problem with TaskCnt function call?

0 Kudos
2,964 Views
lubo_NEW
Contributor III

Thank you very much for your patient reply.
In general, can a scheduled table activate an extended task like a taskCNT task

0 Kudos
2,955 Views
namnguyenviet
NXP Employee
NXP Employee

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. 

0 Kudos
2,938 Views
lubo_NEW
Contributor III


Thanks again for your patience. For the last question,
TaskCnt and TASK(TaskCnt) use status = incrementCounter (STCOUNTER).
This statement will not conflict

0 Kudos
2,935 Views
namnguyenviet
NXP Employee
NXP Employee

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.

0 Kudos
2,931 Views
lubo_NEW
Contributor III

Sorry, different tasks Task (OSCcnt) and Task (TASKCNT)
Thank you for your patient reply

0 Kudos
2,971 Views
lubo_NEW
Contributor III

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?QQ图片20210323112507.png

0 Kudos
2,967 Views
namnguyenviet
NXP Employee
NXP Employee

In the example, TASKCnt is not used in waiting for event context, so it should be basic task.

0 Kudos
3,107 Views
lubo_NEW
Contributor III


The code in the project looks like this, task A does reverse task B does nothing, rightQQ图片20210316212530.png


The attachment is my EB configuration OS project. Could you please help me to see the reason? Thank you

0 Kudos
3,172 Views
namnguyenviet
NXP Employee
NXP Employee

Hello,

Has your added task (OsTaskA, OsTaskB) are executed during runtime? Could you provide the SW call stack before entering Os_Shutdown?

 

0 Kudos