cancel
Showing results for 
Search instead for 
Did you mean: 

I am not sure if this community provides support for my case but i will ask since the target microcontroller is a STM32F429IGT6. In short i bought a dev kit and a TFT lcd and i cannot make the lcd work.

naftilos76
Associate II

Facts: I can program/debug very simple things so the problem is not there.

It is my first attempt to work with STM32cubeIDE and i find it somewhat challenging.

I have a STLinkV2 programmer/debugger that works fine.

The dev kit i bought is: https://www.waveshare.com/open429i-c-standard.htm

More info here: https://www.waveshare.com/wiki/Open429I-C

Schematic of the board here: https://www.waveshare.com/w/upload/8/8c/Open429I-C-Schematic.pdf

The LCD i bought is: https://www.waveshare.com/4.3inch-capacitive-touch-lcd.htm

Resources: https://www.waveshare.com/wiki/4.3inch_Capacitive_Touch_LCD

Sample code (for STM32cubeIDE): https://www.waveshare.com/wiki/File:4.3inch_Capacitive_Touch_LCD_code.7z

Datasheet: https://www.waveshare.com/w/upload/5/55/SH430HI50-43050L-C.pdf

Manual: https://www.waveshare.com/w/upload/0/00/4.3inch_Capacitive_Touch_LCD_user_manual_en.pdf

I tried to import the sample code but it imports only the ioc file. Replacing .c & .h files helped but there are still error during compilation.

I am not sure if i need to install some of the packages in Menu: Help->Embedded Software Packages Manager or in the ioc GUI under Middleware & Software Packes.

I installed X-CUBE-DISPLAY and X-CUBE-TOUCHGFX but without any success.

Can any one help me make the lcd work?

If i start from scratch (create a new STM32cube project) and therefore have to setup peripherals myself i end up where i can program & debug, toggle the dev kit leds which means that there is nothing wrong with the board. Later after searching a bit i saw that i have to setup FMC which i do not know exactly how to do it and finally use BSP to init LCD, draw lines, shapes etc.

So i need some guidance there. If anyone is willing to dedicate a few hours to provide code that works in STM32cubeIDE 1.12 i would be glad to pay up to $50.

Regards

Manos

15 REPLIES 15
JTP1
Lead

Steps to get it compiled (I use cubeIDE 1.11.0 but I think this works also with latest):

  • Open CubeIDE, select file -> new -> STM32 project from existing IOC file
  • Browse to downloaded project ioc file
  • Enter project name and set some convinient location
  • It asks to migrate to latest library versions, I answer migrate. Now latest librarys will be loaded
  • Finally new project should open to CubeIDE
  • Create manually two new source folder under your project (file -> new -> source folder or right click on the project name and then new -> source folder). Folders name 'user' and 'BSP' for example. There should be blue 'C' in the icon of thee folders.
  • Copy files and folders from downloaded project to these new folders
  • Press F5 to update content when BSP and user folder are selected if use windows file manager to copy files. If use CubeIDE paste, updating is not needed.
  • open main.c from downloaded project and copy manually all user code- parts (3 section maybe) to new project Core -> main.c file. (maybe the hole file could be replaced.)
  • Go project properties and set include path to everyone of those new subfolders.
    • /BSP
    • /user/Config
    • /user/Fonts
    • /user/GT911
    • /user/GUI
    • /user/image

Then it should compile OK , but it may need some adjustments to get working on the device :grinning_face_with_sweat:

AScha.3
Chief III

i got it compiled ...also . download an copy to your workspace...

https://link.storjshare.io/jvnke5tud46xyfqhdxaknozq6cbq/demo-bucket%2Flcd-test.zip

If you feel a post has answered your question, please click "Accept as Solution".
naftilos76
Associate II

Thanks to all of you!

I will characterize this thread as SOLVED.

I would like to thank you all for your time. What i was doing wrong is that i was not setting the imported folders as "source folder". I can now see on top of the imported folders a "c" sign just like JTP suggested.

After some tweaking it compiled. However the lcd is still not working. This is a matter of code now.

You cannot possibly help since you obviously do not have the related h/w.

Many thanks.

Stay safe.

Manos

JTP1
Lead

Good that it helped you forward :thumbs_up: It still may need to define symbol 'DATA_IN_ExtSDRAM' in project properties to get SDRAM initialized properly at system_stm32f4xx.c.

Then there seem to be also fputc- funtion at /src/usart.c. If you copy that from downloaded usart.c, the printf to Usart will probly work.

One other option is to copy all files to core/inc and core/src from downloaded project and test that also. But make backup of project before and use that for testing. For some reason it will then need to add '#include <stdio.h>' to usart.c. Then it compiles ok. Note that if you regenerate the code from CubeMx it will overwrite the inc and src files.

MM..1
Chief III

I repeat 7z file from waveshare is created for KEIL MDK ARM compiler. Ask waveshare why dont place builded bin in 7z. Other is your idea migrate code into CubeIDE .

Step by step create new empty project based on ioc, And try activate LTDC and init display only.

naftilos76
Associate II

Thanks MM..1,

After struggling a bit i was able to compile the sample code. It was mostly a matter of inexperience with STM32cubeIDE. Despite the fact that the sample code, as you suggest, is targeting Keil compiler the real issue is still here which doesn't let me work with the lcd.

I debugged the first few lines and noticed that the execution stops at Paint_DrawLine();

Didn't dig in there because using only the first 3 lines was still not enough for the lcd background to get the RED color as per Paint_Clear(RED); When i used the 3 first lines, the execution was able to reach the while() loop but the lcd was still showing nothing. I can see that the backlight is ON so i am guessing it is a matter of s/w setup. With all 4 lines in place the execution does not reach the while() loop because, as i said, it stops at Paint_DrawLine().

BSP_LCD_Init();
Paint_NewImage(LCD_WIDTH, LCD_HEIGHT, 0, WHITE);
Paint_Clear(RED);
Paint_DrawLine(300, 230, 200, 330, MAGENTA, LINE_STYLE_SOLID, DOT_PIXEL_2X2);

After debugging deeper i saw that the execution reaches the code:

void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code){
 
 /* Write data value to all SDRAM memory */
 
 if(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565){
 
    /* RGB565 format */
    /* EXECUTION STOPS ON THE NEXT LINE */
 
   *(__IO uint16_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos))) = (uint16_t)RGB_Code;
 
 }
 
 else {
 
   /* ARGB8888 format */
 
   *(__IO uint32_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) = RGB_Code;
 
 }
 
}
 
  

Not sure if there is anything i can do.

Maybe it is a matter of FMC or LTDC or DMA. No idea what to change...

I have contacted waveshare, hopefully they will share some working code for this lcd.

Manos