I wrote a program that interrupts a core on DMA transfer complete and it works fine and I want to involve (so far) idle core.
Is it possible to interrupt both cores with the same event (like DMA transfer complete)? If so, how?
If not, what is the best way to interrupt one core from the other (and exchange data)?
Interrupting both cores on esp32 s3
Re: Interrupting both cores on esp32 s3
After some research I found xQueueSendFromISR and xQueueReceive which work, but the response of a second core is really slow. I send a message from within ISR on the first core and I have a code below started on a second core, I also set a pin high from within ISR and clear it on the second core after the message is received. The pulse width is around 10 us, which is terrible. I need the response to be below 1 us, order of magnitude slower. Any advices?
void secondCore(void *unused) {
int data;
for (;;){
delay(0);
xQueueReceive(queue, &data, portMAX_DELAY);
GPIO.out_w1tc = 1 << 11;
}
}
void secondCore(void *unused) {
int data;
for (;;){
delay(0);
xQueueReceive(queue, &data, portMAX_DELAY);
GPIO.out_w1tc = 1 << 11;
}
}
-
- Posts: 826
- Joined: Mon Jul 22, 2019 3:20 pm
Re: Interrupting both cores on esp32 s3
I can't guarantee that it will be any faster, since it is depending on FreeRTOS, but you could have a suspended task that you notify from the ISR.
-
- Posts: 1690
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Interrupting both cores on esp32 s3
Don't pin your task to a core. When an unpinned task becomes runnable, it will be scheduled to whichever core is available at that moment.and I want to involve (so far) idle core.
That's not going to happen. 10-15us is the normal time it takes to switch contexts, e.g. from ISR to a task's context; there's nothing you could do about that. You can do some things inside the ISR itself, which saves the 10us for the context switch, but even an ISR can have delay/jitter in the order of a microsecond or more.The pulse width is around 10 us, which is terrible. I need the response to be below 1 us, order of magnitude slower. Any advices?
Re: Interrupting both cores on esp32 s3
I managed to get 200 ns. I was cheating a bit, but I'm not getting guru meditation, so I consider it a win.
Who is online
Users browsing this forum: No registered users and 47 guests