cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 + ILI9341 16 bit + STemWin

Silas Valera
Senior
Posted on May 02, 2017 at 03:36

Hello,

I had this previous set up of STM32F4 + ILI9341 8 bit interface + STemWin - but that did not work for me after trying out for sometime (ref : 

https://community.st.com/0D50X00009XkY1ISAV

 ) 

Since actually I want my final project on L4 due to its low power feature, I thought let me use that and make that set up work with STemWin. So now I have Nucleo-L476RG + TFT LCD display with ILI9341. I am actually using GPIOB port as 16bit parallel port to write to display and other port pins for controls (WR, RD, CS, RST, RS). This set up works perfectly fine - I can fill the screen with colors.

Now to use STemWin - I moved these base functions to LCDConf.c - I have attached copy with this. Along with other files included into my project and with CRC enabled, after building and running the project, nothing shows up on the screen. Single stepping in debug mode, I found that when calling GUI_Init() it goes through functions LCD_X_Config(), LCD_X_DisplayDriver() and also does LCDInit(), but then it gets lost..  Anyone facing similar issue? I really need to get this setup working - any suggestion or pointer will be very much appreciated. 

Thanks in advance..

Silas

#16-bit-parallel-mode #stml4 #ili9341 #stemwin
12 REPLIES 12
Posted on May 02, 2017 at 05:50

static void LcdWriteDataMultiple(U16 * pData, int NumItems) {

while (NumItems--) { // need to decrement otherwise will be stuck in loop forever

// ... TBD by user

LcdWriteData((uint16_t)*pData++) ;

}

}
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 02, 2017 at 17:42

Thank you so much Clive One  

I updated the code and tried running on the board, now at least the program execution runs fine - I have an LED blinky code on timer interrupt, the LED does blink at the timer interval. But it seems that the following STemWin code lines have no effect on the screen. 

GUI_Init();

GUI_Clear();

GUI_SetBkColor(Red);

I am looking further using the oscilloscope and will try figure out.. 

Silas

Posted on May 03, 2017 at 12:21

Hi Silas,

I have

Nucleo-L476RG and

 am trying to use ILI9341 8 or 16 bit and STemWin library. I could not getting any progress. Can you help me for that? Maybe you can share with me a code or STM32CubeMX file?

Thanks...

A.SAKI

Posted on May 03, 2017 at 15:20

Hi,

You can refer to

the

/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fccc%2Fresource%2Ftechnical%2Fdocument%2Fapplication_note%2F54%2Fc9%2F95%2F42%2F8c%2F0b%2F43%2F69%2FDM000896pdf%2Ffiles%2FDM000896pdf%2Fjcr%3Acontent%2Ftranslations%2Fen.DM000896pdf

Getting started with STemWin Library and

I recommend you to run and have a look to the Stemwin example available in the STM32CubeL4 at this path:

STM32Cube_FW_L4_V1.7.0\Projects\STM32L476G_EVAL\Applications\STemWin

Thismay be helpful as a starting point.

Be sure to enable theCRC before usingany STemWin function or calling GUI_Init, if not STemWin will be not function.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on May 03, 2017 at 16:18

Hi Imen,

Thank you for reply. I looked that example but STemWin functions uses IO functions. I have SPI interface to TFT and I can not connect it. When I look IO functions example uses FMC peripheral I have STM32L476RGT thats mean I can not use FMC peripheral. Can you help me for that?

Posted on May 04, 2017 at 04:02

Hi A Saki, 

Your setup will use SPI comm link to LCD controller, that will be MOSI, MISO, SCK + GPIO_RST, GPIO_CS, GPIO_RS - these can be configured in STMCubeMX for whichever L4 device you are using.  You can check the following Segger page: 

https://www.segger.com/emwin-guidrv-slin.html

  - this shows all the details on how to implement this type of setup. You need to basically implement few functions using SPI - _LCDInit(), _LCDWriteA0 (write to register - when RS is low), _LCDWriteA1 (write to mem - when RS is high), _LCDwriteMA0 (write multiple). With higher SPI speed you may get better screen refresh times, I believe, I have not tested that setup with STML4 - but have done using other microcontrollers. But principally it is all similar implementation. Hope this helps.. 

happy coding!

Silas

Posted on May 05, 2017 at 21:30

When I read your message first I thought you tried and did something. I will try thanks...

Silas Valera
Senior
Posted on May 07, 2017 at 09:16

HI 

Here is the update: 

With my set up of using the port as 16bit bus read/write, I was having some issue on reading the port - by using simply GPIOB-->IDR, and I know the reason - need to configure port as 'input' when reading, and as 'output' when writing, and since these instructions are not 'atomic' when using the GPIO lib functions, it was kind of slow. 

So I again went back to using FSMC. But the 

board Nucleo F412ZG would not allow me to use 16bit FSMC since on the port pins PD9 and PD8 STLK_TX STLK_RX are assigned, I unsoldered the bridges on the board to disconnect PD9 and PD8 so that these would be available for 16bit FSMC. Then I configured the project to use CRC, FSMC, TIM6, other control pins like LCD_RST and LCD_BKLT, and then tested the LCDInit, LCDWriteReg, LCDWriteData, LCDReadData functions and tested the set up was working fine with filling screen with colors. And then finally integrate the STemWin lib into the project. 

At this point I can see that the GUI_Init() gives me black / dark screen - then when using the following lines, I see the red color characters 'Hello World'  

GUI_Init();

GUI_Clear();

GUI_SetFont(&GUI_Font20_1);

GUI_SetColor(GUI_RED);

GUI_DispString('Hello world!');

Now to the next step: I need to get all GUI screen with widgets 

thanks all for the help 

Silas

Posted on May 07, 2017 at 09:18

Hi A Saki,

I will send you some sample code - let me know how far you have gone..

Silas