Page 1 of 1

Pinning WiFi tasks to specific core possible ?

Posted: Wed Feb 13, 2019 6:53 am
by opcode_x64
Hello community,

is it possible to pin wifi tasks (creating, init, handle, data transfer) to a specific core ? For beginnig, I tried to modify the WiFi/Station example on github. I added the define

Code: Select all

CONFIG_ESP32_WIFI_PINNED_CORE_1 1 
in the sdkconfig.h file and deleted the define line containing CONFIG_......_CORE_0 1.

In the WiFi event handler function/task I read out the CoreID but I only get CoreID:0...

It is not possible to pin wifi tasks to specific core ?

Best regards,
opcode_x64

Re: Pinning WiFi tasks to specific core possible ?

Posted: Wed Feb 13, 2019 8:11 am
by ESP_igrr
Are you using Arduino IDE or ESP-IDF?

If Arduino IDE, then the short answer is no (but long answer is yes, if you use arduino-esp32 as an IDF component).

If you use ESP-IDF, you can set Wi-Fi task affinity in menuconfig ("make menuconfig", or "idf.py menuconfig" if you are using CMake based build system). Do not modify sdkconfig.h file manually, as it is an automatically generated file.

CONFIG_ESP32_WIFI_TASK_CORE_ID
CONFIG_TCPIP_TASK_AFFINITY

Note that the event task can not be moved to CPU1, yet, so Wi-Fi events will still be dispatched to CPU0.

Re: Pinning WiFi tasks to specific core possible ?

Posted: Wed Feb 13, 2019 8:46 am
by opcode_x64
Hello ESP_igrr,

thank you for the very quick reply. Sorry, I am using IDF. I am using the "ATOM IDE with platformIO" on Windows. So how can I call the menuconfig ?

I will clear up what my intention is:
I want to collect data via SPI (simple bit-banging) from an external ADC and send the data over WiFi (TCP/UDP....). My idea was to run the bitganging on core 0 and sending the data on core 1. The question is here if it is enough to put only the Sending-Data-Task on Core 1 and letting the wifi event handlers on core 0.

Best regards,
opcode_x64

Re: Pinning WiFi tasks to specific core possible ?

Posted: Wed Feb 13, 2019 9:19 am
by ESP_igrr
No clue about platformio, sorry. You may ask about invoking menuconfig in their support forums. In IDF this is usually done using 'make menuconfig' in the project directory.

Regarding using core 0 for bitbanging — have you considered doing it the other way around, pinning all the WiFi related tasks to core 0, and doing bitbanging on core 1? This should be achievable in the current version of IDF.