Bluetooth SPP Interrupts SPI Communications

hScorpio
Posts: 1
Joined: Tue Oct 06, 2020 3:00 pm

Bluetooth SPP Interrupts SPI Communications

Postby hScorpio » Tue Oct 06, 2020 3:16 pm

I am working with an ESP-Wrover-B using the ESP-IDF and Platform IO.

The ESP32 communicates over SPI-slave to a PIC microcontroller. This SPI communication is very critical and needs to be serviced immediately. I also want to be able to send some data over Bluetooth SPP (not as critical). I have been successfully able to use the SPI slave example to retrieve the data from the PIC and save it to an SD card. I am also able to use the Bluetooth SPP examples to retrieve the data off the SD card and send it via Bluetooth.

I load the two up as tasks using FreeRTOS. However when the two codes are run together there are packets of data on the SPI bus that are missed. It seems as though the Bluetooth is interrupting the SPI communications. Is there a way to completely separate my SPI thread from the Bluetooth thread? I have tried using RTOS pin to core when creating the tasks but have had no success. Running Bluetooth on core 1 through menu config helps reduce the number of dropped packets. Any advice would be appreciated.

Who is online

Users browsing this forum: Google [Bot] and 31 guests