Sorry if my request seems stupid but I may turn the problem in all directions, I can not find the solution.
I use the st7735 adafruit library with mbed v2 for a long time without problem. Unfortunately I will have to switch to v5 because it better controls threads and I will use the wav_player lib in parallel with my screen.
the problem that I meet is that mbed (in v5) seems to ignore my frequency request (blocked at 1 MHz). In v2, everything is fine, the images stored in flash as well as the possible text, are displayed very quickly. But in v5, I stay at 1 MHz. No way to speed up the display (without using the threads for the moment). the text is slow to display (1 to 2s for the whole screen against an instant display in v2).
Maybe it is not relevant but it will be the second frequency setting accepted by SPI interface, when it is already set 1Mhz? I see you have a SD card and the TFT on the same SPI and both objects are initialized with different frequency.
only the lib for use the sdcard is different : in v5, the lib is include with the os and I can’t set the spi frequency, or Iif I can, I don’t set it and I let it with default value.
so in v5 , I only set the frequency one time in st7735 lib …
I tried set the frequency ex: lcdPort.frequency(12000000); directly in the lib, which is working because I can set a very low frequency and it works, but it seems to be capped to 1Mhz or so.
edit: I forgot to say I tried on vscode also the generic stm32F103c8t6 with Mbed /Vscode and the spi is faster too:
Resuming:
F103RB Mbed Mbed Studio → slow
F103RB Mbed VSCode → fast
F103C8 MBed VSCode ->fast
I think I’m using the default port, at least on the board we can read MOSI/MISO/SCLK etc…
This is what I get compiled on Mbed Studio
setFrequency(x) | SCLK
-------------------------------------
1MHz 562KHz
2MHz 1.125MHz
4MHz 2.25 MHz
8MHz 4.49MHz
16MHz 9MHz
32MHz 18MHz
edit:
I think I found the problem, well partial problem. The delay between instructions is big on Mbed Studio.