Stm32f407vet6 black board and ili9341 tft lcd display

Thanks, but it’s giving the same result.

I’m going to remove the mbed-os again and see if I can make something work. I know I can get mbed-os code to work with the simple blinky, but I’m going to try to eliminate as many variables as I can in this exercise to narrow down the problem.

the last read contains a copy error, it must be

dummy = RCC->AHB3ENR;

but it should not make a big difference.

OK. I tried that fix and it still didn’t work. :frowning: When I use my separate code (without mbed-os), the compiler complains about a missing file WProgram.h in the Adafruit code.

this is because the define __MBED__ is not set, I have modified the lib for using mbed, the missing stuff is from Arduino code.

OK. I guess I can’t get away from mbed. I’ll try importing it and see if I can make my code work.

you can set this define. Then compiler will complain about a DigitalOut for the reset pin, but you can remove this code. In this case, the reset pin is not connected and not used.
And the Adafruit_GFX class derives from mbed::stream, that allows cool stuff like ‘tft.printf()’. That needs to be removed also for a pure HAL implementation.
My son is using a Macbook, tomorrow I can try to compile on his machine. Can’t believe that the mbed stuff is not running with a Mac :slight_smile:

Go to sleep, man. I’ll keep at it since I’m in the USA (Texas). I just compiled it and it still doesn’t work. I’m going to work on it some more since it’s only 19:45 here.
Thanks

no problem, weekend :slight_smile:
ok, will continue later.

the default size in the Adafruit_GFX constructor has the wrong size for this display, it must be

Adafruit_TFTLCD_16bit_STM32 tft(NC, 240, 320);

but this should affect the controller setting only, my code worked also with the wrong default.
pushed the modifications to github. Good night.

Thanks. Still no luck. Good night.
I did notice that the blinking is a runtime error code from mbed-os.
Four fast blinks followed by four slow blinks.

The error occurs specifically on the constructor

 Adafruit_TFTLCD_16bit_STM32 tft(NC, 240, 320);

When I remove this line, the program works. When I add this line, even if I do not use the object, the run-time error occurs (blinking LED 4 fast 4 slow).

And when you comment out this line:

This is the mbed_die code, a signal that some call failed. It can happen when some function is called with wrong arguments, for example constructing a DigitalOut with a non existing hardware pin. But in the tft constructor, calling with NC (not connected) is a legal option. If a PinName <> NC is supplied, a 100 ms reset pulse is generated on this pin. In my environment this works fine. For testing, you can specify the LED as the reset pin. It should run and create a short blink after reset:

Adafruit_TFTLCD_16bit_STM32 tft(LED2, 240, 320);

when this test also fails, then please send me the main.cpp and the root contents of the BUILD dir. I can flash your binary, normally it should print some failure reason over the serial port. .
It seems that the problem is somewhere in the display init, I’m sure we can fix it. I have compiled now also with gcc 8.3.1, works fine.

OK - that didn’t work at all. - commenting out that line. It causes numerous errors during compile.

There it is. I think I put too much code up there. I’ve been building into

./BUILD/STM32F407VE_BLACK/GCC_ARM/mbedblinky2.bin

ok, I can start it with the debugger and the blinky is running. But the tft code is optimized out, there need to be at least c tft.begin(); tft.fillscreen(RED); in main().

How is this working on your board? I added the tft code and I’m still receiving the error code LED blinking and no colour change on my screen.

Also, if the tft code is optimized out, why does the code work if I comment out the constructor call?
I’ve updated the git repository with the new main.cpp and the new bin file.

ok, at first I made I mistake and loaded and checked mbedblinky, not mbedblinky2.
Now I can see the error and the source, but I don’t understand yet why it is an error. And why it is different, looks like the compiler librarys have different behaviour.
The error happens with the stream stuff, the cool printf… Try to remove the derivation from stream in AdafruitGFX.h:

#ifdef __MBED__
//class Adafruit_GFX : public Stream {
class Adafruit_GFX  {

If this works, I will open an issue in mbed.

about the eclipse compile problem: I see there is a makefile that the eclipse build system is using. But this stuff can be excluded from compiling by adding this line to the .mbedignore file in the project root dir:

mbed-os/features/frameworks/coap/*

After that, the ‘mbed export’ has to be called again to make this change effective.
It is also possible to ignore more features to speed up compiling, but there are some depencies and it is a tedious work to find a bare minimum.

That worked for the mbedblinky2, but the lvgl code still causes an error. For some strange reason, the compiler can’t find the lv_tutorial_hello_world() function even though I included the header and it doesn’t complain about not finding the header.

I’m going to try to build a minimal lvgl program with your modification to the Adafruit code and see if I can make it work.

Thanks again for your help. I’ll keep you posted.

-glyn

you need to define LV_USE_TUTORIALS