There are two cpu cores in esp32.I have a few questions about esp-idf task.
1.when two task running by each core calling uart_write_bytes() at the same time,will it cause data disorder or loss? Is uart_write_bytes() task/thread safe?
2. A while(1){ do something} loop in app_main,is this loop running by pro core or both core ?
3. Callback funtion set by esp_wifi_set_promiscuous_rx_cb() running by pro core or both core ?
Thanks.
Esp32 Task concurrent problems
Re: Esp32 Task concurrent problems
uart_write_bytes is thread safe, but however if you see any issue with it you could also wrap the call to this function in a mutex.huang.yan wrote: 1.when two task running by each core calling uart_write_bytes() at the same time,will it cause data disorder or loss? Is uart_write_bytes() task/thread safe?
app_main runs from the "main" task, which is pinned to CPU 0 (PRO CPU)huang.yan wrote: 2. A while(1){ do something} loop in app_main,is this loop running by pro core or both core ?
This callback gets dispatched from the wifi task. It is possible to configure Wi-Fi task affinity in menuconfig (CONFIG_ESP32_WIFI_TASK_CORE_ID): either CPU0, or CPU1, or no affinity.huang.yan wrote: 3. Callback funtion set by esp_wifi_set_promiscuous_rx_cb() running by pro core or both core ?
Re: Esp32 Task concurrent problems
Thanks,these answers help me a lot.
Who is online
Users browsing this forum: No registered users and 116 guests