Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

程式只有单独SPI读取并没有问题,但在另一个核心执行不同任务时,却会影响到SPI的读取 (IDFGH-12894) #13855

Closed
3 tasks done
zhaohaiyan75 opened this issue May 25, 2024 · 5 comments
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@zhaohaiyan75
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

esp-idf-v5.0.4

Espressif SoC revision.

ESP32S3

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32-S3-WROOM-1U-N4

Power Supply used.

USB

What is the expected behavior?

我使用FreeRTOS(xTaskCreatePinnedToCore)进行多核分工,core 1做SPI高速的读取不间断,core 0做WiFi的连结与传输。希望两个线程之间相互不影响

What is the actual behavior?

如果程式只有单独SPI读取并没有问题,但在另一个核心执行不同任务时,却会影响到SPI的读取,造成读的资料错误,这是什么原因呢?
明明是在不同核心下工作,怎么会互相影响到?尤其是在wifi连接瞬间,SPI读到错误值越多。

SPI是master,CLK速率40M
ESP32_CPU_Freq为240M,160M时错误更多

Steps to reproduce.

参见上面的说明

Debug Logs.

No response

More Information.

No response

@zhaohaiyan75 zhaohaiyan75 added the Type: Bug bugs in IDF label May 25, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label May 25, 2024
@github-actions github-actions bot changed the title 程式只有单独SPI读取并没有问题,但在另一个核心执行不同任务时,却会影响到SPI的读取 程式只有单独SPI读取并没有问题,但在另一个核心执行不同任务时,却会影响到SPI的读取 (IDFGH-12894) May 25, 2024
@nopnop2002
Copy link

nopnop2002 commented May 26, 2024

What happens if you adjust the priority of SPI reading tasks and other tasks?

What happens if you use xTaskCreate instead of xTaskCreatePinnedToCore?

@zhaohaiyan75
Copy link
Author

What happens if you adjust the priority of SPI reading tasks and other tasks?

What happens if you use xTaskCreate instead of xTaskCreatePinnedToCore?

Core 1 only one task, its function is read data by spi, its priority is the highest. I have used xTaskCreatePinnedToCore to create task to assign cpu core.

@nopnop2002
Copy link

nopnop2002 commented May 27, 2024

Core 1 only one task

Enabling WiFi will add a tiT task.

And note that the core number for this task is -1 (Not pinned).

Just by enabling WiFi, tasks running on core #1 will be affected.

main            X       1       1004    4       0
IDLE1           R       0       916     6       1
IDLE0           R       0       920     5       0
tiT             B       18      2104    8       -1
ipc0            S       24      480     1       0
Tmr Svc         B       1       1504    7       0
esp_timer       S       22      3312    3       0
wifi            B       23      656     10      0
ipc1            S       24      492     2       1
sys_evt         B       20      840     9       0

@zhaohaiyan75
Copy link
Author

zhaohaiyan75 commented Jun 3, 2024

Core 1 only one task

Enabling WiFi will add a tiT task.

And note that the core number for this task is -1 (Not pinned).

Just by enabling WiFi, tasks running on core #1 will be affected.

main            X       1       1004    4       0
IDLE1           R       0       916     6       1
IDLE0           R       0       920     5       0
tiT             B       18      2104    8       -1
ipc0            S       24      480     1       0
Tmr Svc         B       1       1504    7       0
esp_timer       S       22      3312    3       0
wifi            B       23      656     10      0
ipc1            S       24      492     2       1
sys_evt         B       20      840     9       0

thank you for your informatiom.
When I set read spi task priority high tiT, spi read is normal, This problem is solved

@Alvin1Zhang
Copy link
Collaborator

Thanks for reporting, glad to hear that the issue was resolved, feel free to reopen.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants