Page 1 of 1

ESP32 dual cores application

Posted: Mon Feb 18, 2019 10:04 am
by tatulea
Hi,

I need to do a really fast acquisition system. I have an accelerometer and I am reading its FIFO 6 times per second. I am getting an interrupt when the FIFO is full and I check a flag boolean in while(1) in app_main. My problem is that I want to print a message every time I finish to read the FIFO, but sometimes the system reads just the first interrupt and then stops... I think that the fact that I am using printf may slow it down and I would like to know how I can do the printing from the second core only and leave the first one just with reading the FIFO using SPI. Then I will have to process the data a little bit and store it in a flash memory...

Regards,
Gabriel

Re: ESP32 dual cores application

Posted: Tue Feb 19, 2019 3:13 am
by ESP_Sprite
Yes, you can, but I don't think it may actually be necessary. Start reading up on FreeRTOS queues, and instead of setting a flag, dump your data in a queue (or into an ESP-IDF ringbuffer; it may be a bit more efficient). Chances are that the queue already can buffer enough for your printf to finish working without anything overflowing.