Errors using BT817 EVE4 display sample program from arduino to Teensy 4.1

walrus20

Member
Hello. I have this Riverdi 4.3" capacative display. Datasheet link. BT817 chip programming guide.

I have used the Riverdi ardunio uno shield with this riverdi sample app/program to start. This one is similar to the Rudolf library. I also was able to successfully make this sample program into one that works for my uno (adding a temp sensor, an external button, my own display lists of menus/touch options, etc).

I want to use this on my 4.1 so I can add more sensors/do more than how restricted I am using the uno and its add-on shield, but I get errors when I connect this display to my 4.1, and I do not really understand these errors.

I tried to follow this post here, but was unsuccessful in my attempts.

I used this 20pin display cable breakout board to connect it to my teensy.

This is how I connected it to my 4.1
display/breakout4.1
3 SPI_SCLK13
4 MISO12
5 MOSI11
6 CS10
relevant 3.3v logic/5vbacklights/gnds correctly connected to psu

For the 4.1, I cut the power line from the microUSB to usb and power the 4.1 (and any other periphereal) via my PSU.

The main errors I get when I connect this and try to compile this from the arduino IDE (new and old versions):
1. buffer and prog_uchar errors
2. GPIO_CS and GPIO_PD errors

Link to Gpu_Hal.h prog_uchar8_t and buffer error location
Link to the CS/PD error location
Link to the platform.h file (where the board specs are configured)
  • Gpu_Hal.h:309:65: error: 'prog_uchar8_t' has not been declared and Gpu_Hal.h:309:80: error: section attribute not allowed for 'buffer'
    • Code:
      void Gpu_Hal_WrCmdBufFromFlash(Gpu_Hal_Context_t *host, PROGMEM prog_uchar8_t *buffer,uint32_t count);
    • many errors involving the buffer "section attribute" and "prog_uchar8_t"
  • App_Common.cpp:253:9: error: 'prog_uchar8_t' does not name a type; did you mean 'prog_uchar'?
    253 |
    Code:
    PROGMEM prog_uchar8_t logo_graphics[6224] = {
    | ^~~~~~~~~~~~~
    | prog_uchar
    • ****** I don't use this logo/image map in my program. This is a default included one for the sample.
  • Gpu_Hal.cpp:49:11: error: 'GPIO_CS' was not declared in this scope
    49 |
    Code:
    pinMode(GPIO_CS, OUTPUT);
  • Gpu_Hal.cpp:52:11: error: 'GPIO_PD' was not declared in this scope
    52 |
    Code:
    pinMode(GPIO_PD, OUTPUT);

1. My plan is to tinker around with the erorrs and see if I can figure out how to intialize this program for my teensy 4.1; I think it's with the platform.h file.
2. Otherwise, I saw this GDSTx library often in the thread I linked above and will try to use my 4.1 with it.
3. There is another riverdi example for this display just for the esp32 so I can look up how to flash the program w/o relying on the arduino environment.

Thanks for any input in advance. Let me know if you need any more info.
 
Very good TFT you have achieved. Let's see if from a distance we can get it to work with that teensy 4.1.

Please, the first thing is to upload some photos of your TFT-teensy arrangement, to see how you want to connect it.

You must take great care of the flexible cable of that type of TFT. If possible, get a shorter cable, 10 cm, to improve connection speed and minimize communication errors. The cable that comes standard is long, it works, but the ideal is that we can squeeze as much as possible out of the BT817 chip, which is very fast.

Although GDSTx does not provide access to flash memory, it compensates for this limitation by allowing access to the teensy 4.1's ultra-fast microSD reader.

Calm down, we are going to get that TFT to work at full capacity!
 
Hey TFTLCDCyg,
I used your comment from here to set up the connections from my display to my 4.1. Like your pictures, I did a similar setup like you did here. I use the same 20pin cable that goes to a breakout board, which then is soldered onto a breadboard with the connections going to my teensy. My cable isn't more than 15cm.
 
Ok, apparently it must be something in the library. In the congif.h file, what configuration did you use? Did you modify any variables?

For teensy 4.1, this is what the library has when it is downloaded from the repository:

Code:
#ifdef TEENSYDUINO

    #define SizeEVE              74   // NHD: 7-7",  5-5", 43-4.3", 35-3.5", Riverdi: 51-5", 71-7", MO: 38-3.8"FT813, MO: 52-5"BT815, MO: 53-5"FT813, Riverdi: 54-5"  BT817, 0 Riverdi FT801/FT800 4.3", Riverdi: 100-10" BT817
                                     // 431-EVE3x-43 MO   Riverdi: 74-7"  BT817
    
    #define ORIENTACION          0   // 0, 1, 2, 3, FT81X/BT81X   0 normal 
    #define ROTACION             0   // 0,1         FT80x

    #define CS                     10   // general
    #define SetSPISpeed   36000000   // general
    #define NHDTouch              1   // 1 cargar rutinas panel táctil    0 NHD normal aparentemente no lo requiere?¿
    #define GameduinoX           0   // 1 gameduinox shield instalado  0 otros como NHD43 o FT843
        
#endif
 
The timing table on the 4.3" BT817 is different than the 5" BT817. I updated the GDSTx library with the table corresponding to the TFT that you have, it is in the datasheet. Since there are 14 parameters, of which 8 have a maximum, minimum and recommended value, I chose to assign the recommended parameter. These times table values determine that the RGB colors and pixel drawing order are appropriate.

To determine that the colors and shapes drawn on the TFT are correct, you should use this example:

Code:
#include <GDSTx.h>

void setup() {
  GD.begin();
}

void loop()
{
  GD.Clear();
  GD.cmd_testcard();
}

BT817-5.jpg

You should see an image similar to this, these are the correct colors and shapes that should be seen on each drawn widget. It is specific for the BT817 chip, other chips do not have this test such as the FT813 for example.

Do not modify anything in config.h, the constructor for your TFT, the 434 variant (4.3" BT817), is already defined.

Please make sure that the PD pin of the TFT is connected to pin 24 of the teensy 4.1 board, as it is needed for the software reset to clean the GRAM memory of the TFT, during the configuration of the screen registers that does the library.
 
Last edited:
Share some photos to see if the settings work as they should, and to be able to adjust something else in case something goes wrong. For the Riverdi 5" BT817 display. I used this bracket:
BT817 (1).png
BT817 (2).png
BT817 (3).png
 
Hello TFT,
Thanks for checking up.
I had to go away for work for a few weeks, but I am back to working on this. For my 4.1, I tried the riverdi sample linked above (fixed the code I think), the rudolph, and yours, but the screen never showed any power or anything working. The 4.1 is still working when I test it with the sample blink program.

I think I need to follow your example and add resistors to the SPI lines because the UNO shield attached to the UNO board all successfully works and shield's datasheet says each of the display pins that connect to the UNO are " Internally 47k Pull UP" and you also mentioned having to do the same thing with 10k resistors.

I am going to go solder up a breadboard like posted in the other thread and test it out with the 3 libraries.
 
Hey @TFTLCDCyg,
I added one end of the 10k resistors directly onto the 20pin display breakout board to the same pins as you did in your pics (miso/mosi/sck) with the other end of the resistors going to a 3.3v line, and the pins in the breakout go directly to my teensy 4.1 headers (CS pin 10, other spi pins in correct 4.1 pins).

I tried loading the helloworld_border example, but nothing shows up on my display, no backlight either. I didn't edit the config file and it still has the 434 eve variant for my riverdi 4.3" capacitive screen.

The display still works as I tested it by modifying the original program in the first post here, but that program must be re-uploaded anytime the teensy power is off/loses power.

I then tried tinkering with the IDE_MCU file, but no luck.

Any advice on how I can get the Helloworld_border program running?



disp2.jpg - Copy.jpeg


disp1.jpg - Copy.jpeg



edit:
In the sample program you shared ( I see why you shared it bc it's in the 817 programming guide, too)
Code:
#include <GDSTx.h>

void setup() {
  GD.begin();
}

void loop()
{
  GD.Clear();
  GD.cmd_testcard();
}
I keep getting the error code: "error: 'class GDClass' has no member named 'cmd_testcard'; did you mean 'cmd_dlstart'?
"
I think I have a problem of correctly configuring my 4.1 with the riverdi 4.3 capacitive screen. Likewise, I think the initialization/configuration problem is also why I couldn't get the rudolph sample working, either.
 
Last edited:
Got the cmd_testcard working in the riverdi example. Surprised how nice the display looks!
Now working on how to correct initialization timings(?) because the display lists don't load when I turn the power off and then back on.
 

Attachments

  • disp3.jpg - Copy.jpeg
    disp3.jpg - Copy.jpeg
    304.9 KB · Views: 9
Something I haven't mentioned before and I apologize for that.

Normally powering the teensy 4.1 via microUSB cable gave me problems a while ago. Not only did I see it on the T41, I saw it on an STM32F429 Disk-1 board and an Nucleo-STM32F767 board. When I tried to connect a 5" NHD FT813 screen it did not work well.

In the latest fixes, I have made a microUSB UsbC interface, like this:

UsbC.png


Screen instability issues have been eliminated. The BLVDD line of the TFT can be connected to 5V, directly from the VDD line of the UsbC cable
 
By the way I use a USB 3 port on the PC.

Now I am building the prototype of a fan controller that I will install on the PC to better regulate three pwm fans. I will use a 5" NHD FT813 screen
Control_02.png
 
I cut the power line from my micro USB cable and power my teensy/peripherals via an external PSU. I think I've narrowed down the issue to an initialization problem for the rudolph driver
 
If you allow me, I would like to take another approach. Let's think that you are the one who is going to guide me in connecting the parts of the project. Disconnect everything and tell me step by step how I should connect the screen to the teensy. Starting from all the parts that we are going to connect (teensy, screen, 20-pin breakout, etc.), and all the elements with which we are going to connect (jumpers, cables, breadboard) each component.

Tell me the pins you are going to use on the teensy to connect the TFT.

Then give me, in zip, the GDSTx library exactly as you are going to use it, with the settings you have considered using. And finally, give me the example that you are going to use to verify that the arrangement works

I would like to see things from your perspective. Maybe we are overlooking something. If possible, upload photos of the procedure step by step, to follow it to the letter
 
Back
Top