cancel
Showing results for 
Search instead for 
Did you mean: 

LCD Settings on STM32F429I-Disco

STConfused
Associate
Posted on December 23, 2013 at 10:51

Hello together,

I try to get to work the STM32F4-Discovery-Board with the LCD-Display. I have the code of the graphic-workshop from ST. In this code the STemWin-Library of segger is used without the source code, only the library.

In the example application the external SDRAM is used as frame buffer at the memory location 0xD0000000. This example works fine so far.

So I want now for my application to use the internal memory as frame buffer on 0x20000000 I put the default variables to 0x10000000 (64k) but than there is noc picture on the LCD any more. The programm goes to a hard fault after the call of the function GUI_Init(), there is a meory access error.

In the GUIConf.c-File following initializations were made:

#define GUI_NUMBYTES  (1024 * 136)    // x KByte

#if defined ( __CC_ARM   ) 

  U32 HeapMem[1024 * 1024] __attribute__((at(0xD0100000)));

#elif defined ( __ICCARM__ ) 

  #pragma location=0xD0100000

  static __no_init U32 HeapMem[1024 * 1024];

#elif defined   (  __GNUC__  ) 

  U32 HeapMem[1024 * 1024] __attribute__((section(''.HeapMemSection'')));

#endif

U32 extMem[GUI_NUMBYTES / 4];

I changed no memory location in the conf-file and the external SDRAM is still there, I only change the definition of the framebuffer from 0xD0000000 to 0x20000000.

The problem is, that if I comment out the GUI_Init()-function there is no picture on the LCD. My intension is to use the internal memory as frame-buffer I only want to use the LCD in 565-format, so the internal SRAM should be enough.

A second thing in the example application is, that format odf the LCD is portrait but I want to use it in landscape-format.

What changes do I have to do?

Thanks

2 REPLIES 2
STConfused
Associate
Posted on January 03, 2014 at 20:50

Hello together again,

as there is no answer to my questions so far, I want to minimize my question to the one who deals with the orientation of the LCD.

Thje Disco-Board is delivered with the display in portrait mode 240x320, so my application needs the LCD arranged in landscape mode. Ok so far so good, first I tried to turn the pictures at the generation of the pixel-data and displyed it, and it worked.

Advantage, I don't have to change the configuration of the display-driver (ILI9341).

Next try I changed the the Memory Access Control Register of the ILI9341 from 0xC8 to 0xA8 and I change the static defines in Software:

 /* Timing configuration */  

//  /* Configure horizontal synchronization width */     

//  LTDC_InitStruct.LTDC_HorizontalSync = 9;

//  /* Configure vertical synchronization height */

//  LTDC_InitStruct.LTDC_VerticalSync = 1;

//  /* Configure accumulated horizontal back porch */

//  LTDC_InitStruct.LTDC_AccumulatedHBP = 29; 

//  /* Configure accumulated vertical back porch */

//  LTDC_InitStruct.LTDC_AccumulatedVBP = 3;  

//  /* Configure accumulated active width */  

//  LTDC_InitStruct.LTDC_AccumulatedActiveW = 269;

//  /* Configure accumulated active height */

//  LTDC_InitStruct.LTDC_AccumulatedActiveH = 323;

//  /* Configure total width */

//  LTDC_InitStruct.LTDC_TotalWidth = 279; 

//  /* Configure total height */

//  LTDC_InitStruct.LTDC_TotalHeigh = 327;

 

  /* Configure horizontal synchronization width */     

  LTDC_InitStruct.LTDC_HorizontalSync = 1;

  /* Configure vertical synchronization height */

  LTDC_InitStruct.LTDC_VerticalSync = 9;

  /* Configure accumulated horizontal back porch */

  LTDC_InitStruct.LTDC_AccumulatedHBP = 3; 

  /* Configure accumulated vertical back porch */

  LTDC_InitStruct.LTDC_AccumulatedVBP = 29;  

  /* Configure accumulated active width */  

  LTDC_InitStruct.LTDC_AccumulatedActiveW = 323;

  /* Configure accumulated active height */

  LTDC_InitStruct.LTDC_AccumulatedActiveH = 269;

  /* Configure total width */

  LTDC_InitStruct.LTDC_TotalWidth = 327; 

  /* Configure total height */

  LTDC_InitStruct.LTDC_TotalHeigh = 279;

and

#define  LCD_PIXEL_WIDTH    ((uint16_t)320)

#define  LCD_PIXEL_HEIGHT   ((uint16_t)240)

//#define  LCD_PIXEL_WIDTH    ((uint16_t)240)

//#define  LCD_PIXEL_HEIGHT   ((uint16_t)320)

So the orientation of the picture changes but the picture is cut at about the 1/4 before the end

of the display (like in portrait mode).

Then I changed the values of the registers 0x2A and 0x2B (0x00EF and 0x013F) the picture is only shown in pieces on a small part of the display.

I changed some other things in different registers of the display-driver but I had no success.

Is there someone who knows how to do the change without spending a lot of memory (framebuffer only in the internal RAM), what do I have to do?

Or is it not possible with the driver to change the orientation?

Thanks for your help

Daniel

xacc
Associate II
Posted on January 06, 2014 at 11:49

Link to previous discussion:

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/STM32F429-Discovery%20landscape%20display&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=18...

Also, this chap has written some stuff to handle landscape, but I think he handles it manually in his own libraries:

http://mikrocontroller.bplaced.net/wordpress/

(probably have to go to second page, but he has some nice stuff for this board :p)