EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: rcbuck on April 12, 2022, 02:05:57 am

Title: Need Graphical Tool for 320 x 480 TFT display
Post by: rcbuck on April 12, 2022, 02:05:57 am
I purchased a Nextion 320 x 480 display. It took about 3 hours to write the code for the interface shown in photo one. Everything works as expected. All of the buttons send valid USART messages to the STM32F446  controller. The messages control various relays and perform other operations.

I also purchased a parallel 320 x 480 display as shown in photo two to experiment with. I have tested the parallel display by loading code into an Arduino to confirm it works. The display uses an ILI9488 driver.

I would like to duplicate the functions that were created for the Nextion display. Any suggestions as to a graphical tool (no cost) to use to create the button images and the progress bar and have them display on the screen? By using the parallel display it keeps me from being locked to the Nextion display. The parallel displays are available from multiple vendors/manufacturers.

I installed LVGL but didn't have any success with it. I am running Windows and LVGL requires an older version of Visual Studio and SDL to run the simulator. I installed Visual Studio which took over 30 minutes (ridiculous). When I tried to run a couple of the LVGL demos I get hundreds of errors about missing files. It appears that LVGL is a work in progress that is basically unusable.

If I can get the button images on the screen I can handle to touch screen code. STM32CubeIDE has the TouchGFX plug in and it works with a smaller screen. But they do not have a sample application for the STM32F4 with a 320 x 480 display.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: darkspr1te on April 12, 2022, 05:07:08 am
I purchased a Nextion 320 x 480 display. It took about 3 hours to write the code for the interface shown in photo one. Everything works as expected. All of the buttons send valid USART messages to the STM32F446  controller. The messages control various relays and perform other operations.

I also purchased a parallel 320 x 480 display as shown in photo two to experiment with. I have tested the parallel display by loading code into an Arduino to confirm it works. The display uses an ILI9488 driver.

I would like to duplicate the functions that were created for the Nextion display. Any suggestions as to a graphical tool (no cost) to use to create the button images and the progress bar and have them display on the screen? By using the parallel display it keeps me from being locked to the Nextion display. The parallel displays are available from multiple vendors/manufacturers.

I installed LVGL but didn't have any success with it. I am running Windows and LVGL requires an older version of Visual Studio and SDL to run the simulator. I installed Visual Studio which took over 30 minutes (ridiculous). When I tried to run a couple of the LVGL demos I get hundreds of errors about missing files. It appears that LVGL is a work in progress that is basically unusable.

If I can get the button images on the screen I can handle to touch screen code. STM32CubeIDE has the TouchGFX plug in and it works with a smaller screen. But they do not have a sample application for the STM32F4 with a 320 x 480 display.
Depending on your source for LVGL will depend on it's stability, example is the LVGL+adafruit FSMC drivers works great on any sized screen , i use it often with platformio+vscode+stm cube. 
see https://github.com/darkspr1te/adafruit_stm32_f407_mks35_ili9488_fsmc/tree/master/Drivers/LCD for examples,
or see https://github.com/darkspr1te/mksbootloader/tree/master/Src for raw lcd control.




in the end i have written most of my own tools to do progress bars etc as i found that lvgl was too heavy for my use case, touchgfx was too much stm code for me, i prefer to understand whats under the hood and writing your own drivers gives me that.


darkspr1te


Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: rcbuck on April 12, 2022, 05:11:51 pm
OK, thanks. I believe you are basically saying there are no tools available, everything has to be done manually.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: tooki on April 12, 2022, 10:25:05 pm
OK, thanks. I believe you are basically saying there are no tools available, everything has to be done manually.
I don’t think he said that at all.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: rcbuck on April 13, 2022, 01:47:16 am
Quote
I don’t think he said that at all.

Which graphical tool is he suggesting I use? I was looking for a tool that works similar to TouchGFX or a tool like the Nextion tool. One that has a drag and drop type of interface for creating the buttons and screens. And a simulator to give you a representation of what the screen looks like.

LVGL does not work that way. You have to manually create each button, screen, text, etc by calling the functions in the libraries. It will work but there is no simulation interface that will give you a WYSIWYG to confirm your layout is correct. All you can do is write the code and upload the code to the CPU to see if the result is what you want.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: darkspr1te on April 13, 2022, 08:40:32 am
Quote
I don’t think he said that at all.

Which graphical tool is he suggesting I use? I was looking for a tool that works similar to TouchGFX or a tool like the Nextion tool. One that has a drag and drop type of interface for creating the buttons and screens. And a simulator to give you a representation of what the screen looks like.

LVGL does not work that way. You have to manually create each button, screen, text, etc by calling the functions in the libraries. It will work but there is no simulation interface that will give you a WYSIWYG to confirm your layout is correct. All you can do is write the code and upload the code to the CPU to see if the result is what you want.
I didnt actually mention any GUI tools like lightwing, E-LittleVGL  or stem https://www.st.com/en/embedded-software/stemwin.html (https://www.st.com/en/embedded-software/stemwin.html) , there's alsohttps://www.embedded-wizard.de/] [url]https://www.embedded-wizard.de/ (http://[url)[/url] too but alas am not aware of any open source tools that cover GUI HMI  other than porting QT for micro's to your device. then you can use QTDesigner or QTEdit

hope those help,

darkspr1te






Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: Christe4nM on April 13, 2022, 03:10:32 pm
Quote
LVGL does not work that way. You have to manually create each button, screen, text, etc by calling the functions in the libraries. It will work but there is no simulation interface that will give you a WYSIWYG to confirm your layout is correct. All you can do is write the code and upload the code to the CPU to see if the result is what you want.

Perhaps this may be what you're looking for: https://squareline.io/ (https://squareline.io/) I came across it when I was looking into LVGL a week ago. It seems they created a seperate WYSIWYG editor for LVGL. It isn't free for commercial use, nor open source as far as I have seen, but I haven't looked into it other than making a mental note that it exists.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: rcbuck on April 13, 2022, 07:37:45 pm
Christe4nM, thanks for the link. I will download the Personal version and give it a test run. I only have 4 screens and 10 widgets so it should work for me.

This is a personal project so I don't need a full blown version. I also watched a YT video this morning by Controllers Tech. He used a Blue Pill board demonstrating how to get graphics onto the board I am using. There was no GUI as everything was hard coded similar to what LVGL does. If the SquareLine program doesn't work I will take the approach that the YT video did. He used a modified version of the mcufriend_kbv library.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: rcbuck on April 17, 2022, 08:19:08 pm
As a followup on my display venture, I have managed to make the LCD work by sending commands and data to the board.

I found code written for a MSP430 board here: https://luan.eng.br/index/electronic/19/using-the-35-inch-320x480-tft-lcd-ili9488 (https://luan.eng.br/index/electronic/19/using-the-35-inch-320x480-tft-lcd-ili9488)

I modified the code to work with the blue pill board that is available everywhere.

Zip file contains the source and header files, binary file, ioc file, and picture of I/O pin configuration.

The system clock is running at 72 MHz and all I/Os are set low and are set for low speed operation.

I did run into a strange issue that I have been unable to solve. After programming the board, it will not start working without a power down and power back up. Even pressing the reset button on the blue pill will not make it run. I don't know if this is just a problem with my board. It may have something to do with the LCD being connected to the I/O pins.

I tried powering the board and LCD from an external 5 volt power supply instead of the USB connector. That did not make a difference. I also put a 5 second delay in the startup code as a test. I kept the 5V off of the LCD board. When the blue pill got to the 5 second delay I then applied power to the LCD board. But the blue pill board did not continue to run. The only thing that makes it run is the power up and power down sequence. After that the board will restart and run when I press the reset button.

If someone uses the code with a blue pill and LCD they can report what happens after programming is complete.

I still haven't worked with any graphical software yet. I wanted to figure out how to manually talk to the LCD before proceeding. The less unknowns there are the easier it is to trouble shoot when problems occur.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: rteodor on April 17, 2022, 11:01:34 pm
Quote from: rcbuck
I installed LVGL but didn't have any success with it.
...
It appears that LVGL is a work in progress that is basically unusable.

I am not an LVGL whizz but I tried it two times for simple projects and I was amazed by how fast I had stuff working. The thing is, I went down on it: no pretty editors and no point and click..y.... Plain Makefiles and code.

The demos with v8 compile and work out of the box if you have the newer SDL. But v8 is newer, not that well documented and probably unstable in features.

My recommendation is to give LvGL another try.
There is also uGFx https://wiki.ugfx.io/index.php/Main_Page but this one I could not make it to work and so I turned to LvGL.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: cdev on April 18, 2022, 03:10:12 pm
That looks quite useful. The ability to convert and use ones own fonts is intriguing. By doing that I see it as potentially mucmore useful, as one can often make custom fonts' graphics tell a story better than text alone.

I hope that I am getting this GUI toolkit situation -and am not clueless on it. I'd love to become proficient at this.

On the times I needed to build an interface to electronic stuff I have used middleware programs,and CGI to do this kind of thing because thats what I know. But it requires a lot of overhead (web server and other programs, etc.) So its not well suited to many things. I know there are much better ways to interface to hardware.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: cdev on April 18, 2022, 03:32:18 pm
No, he's just saying you have to devote some quality time into learning how to make the affordable basic display display what you want, without using the expensive custom proprietary screen. It seems there still are some useful tools out there to make your time more productive. So why not give it a shot?

The blue pill board is so cheap, its hard to argue with this solution. If it lends itself to making an embedded board more usable.

At least thats my interpretation.
Title: Re: Need Graphical Tool for 320 x 480 TFT display
Post by: darkspr1te on April 24, 2022, 07:00:42 am
As a followup on my display venture, I have managed to make the LCD work by sending commands and data to the board.

I found code written for a MSP430 board here: https://luan.eng.br/index/electronic/19/using-the-35-inch-320x480-tft-lcd-ili9488 (https://luan.eng.br/index/electronic/19/using-the-35-inch-320x480-tft-lcd-ili9488)

I modified the code to work with the blue pill board that is available everywhere.

Zip file contains the source and header files, binary file, ioc file, and picture of I/O pin configuration.

The system clock is running at 72 MHz and all I/Os are set low and are set for low speed operation.

I did run into a strange issue that I have been unable to solve. After programming the board, it will not start working without a power down and power back up. Even pressing the reset button on the blue pill will not make it run. I don't know if this is just a problem with my board. It may have something to do with the LCD being connected to the I/O pins.

I tried powering the board and LCD from an external 5 volt power supply instead of the USB connector. That did not make a difference. I also put a 5 second delay in the startup code as a test. I kept the 5V off of the LCD board. When the blue pill got to the 5 second delay I then applied power to the LCD board. But the blue pill board did not continue to run. The only thing that makes it run is the power up and power down sequence. After that the board will restart and run when I press the reset button.

If someone uses the code with a blue pill and LCD they can report what happens after programming is complete.

I still haven't worked with any graphical software yet. I wanted to figure out how to manually talk to the LCD before proceeding. The less unknowns there are the easier it is to trouble shoot when problems occur.
On the topic of strange issue, what programmer are you using, what environment are you using ? what steps do you use to flash ? 
I mention this as some systems will program the device then wait for you to click run (it will then take the device out hold or SWD reset) or debug, so disconnecting the  programmer after you have written the bin file might work, proving that theory at least. Some code bases required boot from cold flag to operate in a defined manner, in mbedos for example it's boot path is different depending on cold boot, warm boot, reset or vector table IRQ all of which the stm32 core supports.  |O that had me stumped for days until i found some random reference to it, it was so long ago i cant even remember why i was using mbedos , how ever i did learn how to write my own vector code from that and now all my projects with stm code use the same file (it does nice things like when it crashes it dumps the core to the serial port)

You have not posed code so we cant say if there is a issue in the code either (a watchdog for example or stray irq setup) , this is where having the right dev environment setup helps, if done right you have a batch of tools like openocd, gdb available that allows you to see into the cpu and it's operations. I also dont know if you are on windows or linux, i use both so it's no difference to me but i do feel my linux tools work better for me like gdb (yes i know it's available under WSL/2 but serial ports have permissions issues i dont want to fight and wsl2 uses a old gdb with no gdb-gui )

to be fair writing code for ili9xxx devices is quite simple, my repos show many examples from full blown lvgl setup to simple text only, no gfx support.
but basics is this,

in 8 bit mode bitbash style,
Code: [Select]
assert _CS low
assert Command pin Low
send 8 bit command to port
de-assert command high
send 8 bit colour data
deassert _CS high


spi models are different in that the spi decoder has a extra bit for command pin so you send two lots of 8 bits data and in the first it sets the command pin
i wont go into that here, it gives me a headache , but it you want a tl;dr then i will post a link to rasberyypi based lcd hacks.


darkspr1te