Need help tp find Bodmers TFT_eSPI SPI parameters

Dear all,
I have a code that has been working for more than 2 years.
However, I made cosmetic changes to the code and it does not work anymore.
The setup uses an nRF24L01, a TFT display runing on an ESP32 Dev kit rev1 board.
I have tried diderent earlier revisions dating back one year and none of them works.
There have been updates in the library used ( RF24 by thmr20 and TFT_eSPI by Bodmer) as well as in the expressif ESP32 board files.

The compiler shows this messages:

[  2547][E][esp32-hal-cpu.c:121] addApbChangeCallback(): duplicate func=0x400d79ac arg=0x3ffbdba4
[  2564][D][esp32-hal-spi.c:185] spiDetachBus(): Stopping SPI bus

So I am thing of using the instructions spibegintransactionS()/ spiendtransactions() at the beginning/end of each devices acessing the SPI bus.

I could find the RF24 libray parameters, wich are:

 SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));

But I could not find the values to use for Bodmers TFT_eSPI library, since I have no training in C++ or Phyton.

Can anyone help please?
Thank you.

It sounds like the API has changed, roll back the library to when it last worked, you may also need to roll back the boards entry.
In the future, show all code in code tags and error log in code tags.

Thank you for your reply,
However, since I intend to keep using this code on the place where it is installed (it has been working for 3 years), I am looking for a solution that could be used in future revisions.
Rolling back seem a risky solution for a code wich is in "production" not development.

Not risky at all, if the working code was developed at for instance rel 5.6.7 and now the library is rel 8.4.6 then some changes between those two rel may break your code. Reverting to 5.6.7 is guaranteed to work.

Recent changes to the ESP32 core by Expressif seem to have broken quite a few libraries, maybe contact them about the issues.

It could be a (long) while before Arduino authors get round to changing their libraries to be compatible with recent ESP32 cores.

The solution is to make it work again as in Post #2. If you chose, after solving, make a copy and "improve" the copy.

not sure if this is what you are looking for
in my setup for the LI9341 display on the ESP32 in file
Documents\Arduino\libraries\TFT_eSPI\User_Setup_Select.h
I uncommented the line

#include <User_Setups/Setup42_ILI9341_ESP32.h>           // Setup file for ESP32 and SPI ILI9341 240x320

the file Setup42_ILI9341_ESP32.h specifies the SPI pins etc

I am using ESP32 core V3.0.7

Hi horace,
The parameters listed above are the ones needed in the instruction,

In my code the radio and tft woks but there are these issues listed ....
And the serial monitor keeps printing only 3 lines of the more than 100 lines that should be printed when the debug option is active.
More curious, these lines are located around 50% of the total of lines that are supposed to be printed.

And they are printed repeatedly because the debug printing command are in a loop.
The other lines keep being ommited

It never happened to me before.
Have no idea of what is happening and how to fix it.

not sure why you are calling low level SPI functions
thought you were using TFT and NRF24 libraries etc

Hi Horace,
I am doing this because of this message, that appears in the serial monitor when I restart the ESP32.

[ 2547][E][esp32-hal-cpu.c:121] addApbChangeCallback(): duplicate func=0x400d79ac arg=0x3ffbdba4
[ 2564][D][esp32-hal-spi.c:185] spiDetachBus():Stopping SPI bus

AND the strange behavior of the serial monitor that only prints two lines (in a loop) of the total of about 100 lines expected when the "sketch debug option" is active.

I made some changes to your test sketch (since I do not have the other device code) AND the messages are printed OK in the serial monitor.
One difference between the two codes is that in the modified test sketch I am using delay() to make it simpler and on my sketch I use non blocking timers.
Is this important?

assuming you are implementing the timers correctly it should work
perhaps replace the delays with your non-blocking timers and see if it still works OK

I was hoping it was not necessary.... rsrsrs
I will do that and return
Thank you

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.