Sending a task notification from core0 to core1 question

vvb333007
Posts: 71
Joined: Wed Jul 31, 2024 5:53 am
Location: Thailand
Contact:

Sending a task notification from core0 to core1 question

Postby vvb333007 » Mon Dec 01, 2025 12:03 pm

Hello,

Recently I found that if I send task notifications from one core to another (1 task is running on core 1 and second is on core0) it doesn't work.
When both task are on the same core (doesn't matter 0 or 1) they can send notifications and wait for them. But when these task are on different cores - it stops working.

Tasks are pinned to cores.

Is this expected behaviour or I did something wrong?
Thanks!
Slava.

Sprite
Espressif staff
Espressif staff
Posts: 10612
Joined: Thu Nov 26, 2015 4:08 am

Re: Sending a task notification from core0 to core1 question

Postby Sprite » Tue Dec 02, 2025 2:52 am

No, that's not expected behaviour. If you have example code that reliably reproduces this, you can file an issue and we'll take a look at it. If you're not sure, feel free to post your code here as well.

MicroController
Posts: 2669
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Sending a task notification from core0 to core1 question

Postby MicroController » Tue Dec 02, 2025 9:20 am

Make sure the sending task uses the correct task handle value to notify. Storing/reading it to/from a global variable for example can cause a race condition where the sending task does not see the most recent value.

vvb333007
Posts: 71
Joined: Wed Jul 31, 2024 5:53 am
Location: Thailand
Contact:

Re: Sending a task notification from core0 to core1 question

Postby vvb333007 » Tue Dec 02, 2025 5:49 pm

Oh I found the issue.

Notification are received but when I tried to printf() that printf() just disappeared.
Deeper search showed that output from core#0 in case of USB-CDC can be lost.
It is a known bug: if you initialize USB-CDC on Core#1, don't expect that your printfs on Core#0 will work.
Thanks!
Slava.

Who is online

Users browsing this forum: Qwantbot and 4 guests