Static void Tasks(bool aInit, void * const aParam) , Question about the content of this function

What is ‘Controller_CPU0_errorStatus’ and where can I see its content? How does it behave when the code is in the target MCU (TI2000)? Where is the variable ‘aInit’ used?

Hello,

The errorStatus is used by our PIL framework for reporting errors back to the user. Essentially, if there is some sort of runtime error, we populate this value with error information. Right now (to my knowledge) our code doesn’t really use this to a meaningful extent.

aInit is used by the dispatcher to enable interrupts to trigger the base task on startup.

There are conditions in which the "_errorStatus” variable is set at runtime.

For example, by Assertion blocks, when they are configured to emit an error.

The circuit above will cause the model execution to halt and the message configured in the Assertion block will be reported via external mode.

Similarly, assertions related to mathematical operations (e.g., overflows) will be reported by means of this mechanism.

Note that such error conditions can only by cleared by an MCU reset.

Thanks for the quick reply. I find the behaviour in the event of errors interesting. This raises the question for me of what the behaviour is if I am not connected to the hardware in external mode but the software is running independently on the MCU.

I would consider such errors more as exceptions that should never happen unless you are actively developing (and connected to PLECS).

When they do occur, the control tasks are no longer executed and all PWM outputs are disabled (provided the model uses a Powerstage Protection block - look for the “PanicCallback” in the generated “_hal.c” code).

Hello Beat,
Thanks for pointing that out. We tested it and saw that the area is also affected by the error.
Since we changed the task cycle from 20KHz to 10 KHz and the error still occurred, it is probably not just a question of the processing time of the Basi task.

void DISPR_dispatcher()
.
.
.
if (obj->panicOccurred) {
obj->interruptNesting++;
return;
}
.
.
.