XTaskCreate Block

How this block appears in a Simulink model?

appearance.PNG

What can be configured?

Configuration Parameter Selectable Option/Value Description
Specify ESP32 core to use Check--Uncheck If the user, the user uncheck this the task will be automatically allocated by the FreeRTOS
Invoke from ISR Check--Uncheck Check if the task should be invoked using an ISR.
Run on core Protocol CPU (CPU 0)--Application CPU (CPU 1) Select the ESP32 core which the task should be assigned to.
Task name Enter the name of the task (10 characters or less)
Simulink task priority 0 to 255 Enter the task priority, 0 being the highest and 255 being the lowest.
Stack size Enter the stack size to be allocated to the task.

When to use this block?

xTaskCreate is a feature in FreeRTOS where a user can assign several tasks for parallel processing.

How does this block work?

The MCU will try to execute each task bound to this block to be executed in parallel. If the ‘Invoke from ISR’ is ‘Checked’, then the input of this block can be connected to an Interrupt block. Else the block can simply be invoked using ‘Function-Call Generator’ block available in Matlab Simulink.

Previous : HTTP POST Handler Block
Next : vTaskDelay Block