How to split tasks in CPU

Hi there FreeRTOS team,

I’m working on a FreeRTOS app in ESP32 which has 2 CPUs.

I’ve several tasks: gpio, wifi, mqtt, ota, display, motor, flash.

My question is: how to correctly split these tasks into the 2 CPUs? from the architecture point of view

Thanks a lot in advance

First question would be, is this processor symmetric enough to use SMP well, at which point you may not need to decide that. If not, it becomes very application specific (and processor details) on what to do. You want to look at the most processor stressing tasks first and base your allocations on that.

Of the list, the thing that might be the most processor stressing is the motor, depending on how detailed the processor needs to be in controlling it. I have had processor need near 50% of the processing to control a motor (and others were it is almost nothing, for different types of motors in different applications).

If you do need to split the processors because it isn’t symmetric enough, keeping most of the network stuff together might make sense to minimize communication lags.

ESp32 is symmetric and uses SMP. As @richard-damon mentioned, you do not need to assign tasks to core explicitly - the scheduler will schedule tasks on both the cores.