logo elektroda
logo elektroda
X
logo elektroda

ESP32-S3-DEV-KIT-N8R8 w Arduino IDE - jak podzielić zadania na 2 rdzenie?

Midlle 321 2
ADVERTISEMENT
This content has been translated flag-pl » flag-en View the original version here
  • #1 21911533
    Midlle
    Level 1  
    Posts: 1
    Hello colleagues,

    i recently encountered a problem with computing power when programming the ESP32.

    I found out that the basic Arduino IDE only uses one of the two available CPU cores, so I tried to work around this using the freeRTOS libraries, but with poor results. Does anyone have a way to distribute tasks well in the program and "unlock" the second CPU core?
    What exact ESP32 module/board do you have and what version of the Arduino IDE and "ESP32 by Espressif" package are you using?
    ESP32-S3-DEV-KIT-N8R8
    What specific tasks do you want to distribute between cores and what exactly do you mean by "poor performance" - do you have any bugs, resets/watchdogs, or just a lack of performance improvement?
    No performance improvement or even a decrease in performance.
  • ADVERTISEMENT
  • #2 21916841
    efi222
    Level 22  
    Posts: 761
    Help: 12
    Rate: 1199
    Midlle wrote:
    I have tried to work around this using the freeRTOS libraries, but with poor results

    What do you mean "poor results"?
    I sometimes use two cores and it works rather well.
  • #3 21917849
    capacitynmw
    Level 2  
    Posts: 2
    Why You're Not Seeing Performance Improvement

    Wrong API — xTaskCreate() doesn't pin to a core. Use xTaskCreatePinnedToCore() and explicitly assign core 0 or 1.

    Shared resource contention — If both cores access the same variable, I2C, SPI, or Serial without a mutex/semaphore, they block each other → slower than single core.

    Oversized critical sections — portENTER_CRITICAL() or taskENTER_CRITICAL() disables interrupts on both cores. Keep them tiny.

    Too fine-grained tasks — If each task runs for <1ms then yields, context-switch overhead kills parallelism.

    delay() in tasks — Use vTaskDelay() instead; delay() busy-waits.
ADVERTISEMENT