2018-05-25 10:15 AM
Hello to everyone,
let me please ask a question.
I'm using
STemWinonSTM32F777ZIcontroller for GUI development on a custom board.The board has SDRAM (MT48LC32M16A2, 512 Mbit) connected to the controller throughFMC Bank1(start address is0xC0000000).The 10.4 inch display (1024x768) is connected to the controller through LTDC.I'm using Atollic True Studio IDE.
Some configuration options in
LCDConf.c:...#define COLOR_CONVERSION_0 GUICC_M565#define DISPLAY_DRIVER_0 GUIDRV_LIN_16#define GUI_NUM_LAYERS 1...#define LCD_LAYER0_FRAME_BUFFER 0xC0400000#define LCD_LAYER1_FRAME_BUFFER 0xC0800000...In
CUIConf.c:...#define GUI_NUMBYTES 0x0400000...// in
GUI_X_Init():...static U32aMemory[GUI_NUMBYTES / 4] __attribute__ ((section(''.sdram_data'')));...As we can see
aMemoryassigned to ''.sdram_data'' section configured in linker *.ld file. It has a start address at0xC0000000and a size of0x0400000, so it wouldn't conflict with a frame buffer memory for layer 0 which has a start address at0xC0400000. Watch window in IDE shows these correct addresses (aMemoryshows0xC0000000andlayer_prop[0].addressshows0xC0400000).I've also read the LTDC manual from ST (AN4861) attentively and configured all the recommendations that described in this manual (SDRAM and LTDC clock restrictions and MPU regions configuration on SDRAM and internal RAM). SDRAM clock is
100MHz, and LTDC clock is50MHz.I'm successfully configured and initialized
STemWin(''Hello, world'' etc... basical drawing functions from 2D graphical library...)After that I made a simple 1024x768 BMP picture in GIMP (Green text ''This is a BMP'' on the yellow background), then I optimized it using Bitmap Converter, then converted it to C-array using Bin2C for GUI_BMP_Draw() function and finally got it on the screen:
Next I made a same GIF picture (''This is a GIF''), unoptimized it as described in emWin manual (exactly in emWin
UM03001, not in StemWin manualStemWin532.pdf) then again used Bitmap Converter and converted the GIF to C-array for using withGUI_GIF_Draw().And got this one:
Seems that only few first lines of the GIF displayed.
GUI_GIF_Draw()returned 1. That is error.
Next in function
GUI_X_Config()I reconfiguredaMemorylocation to its default address in internal RAM.static U32 aMemory[GUI_NUMBYTES / 4]; // __attribute__ ... deleted. Watch window shows 0x20001308 address.Had to reduce the size of aMemory to
300 KBas internal RAM is only512 KBon the chip:#define GUI_NUMBYTES(300 * 1024)...Frame buffer location for layer 0 remains unchanged:
#define LCD_LAYER0_FRAME_BUFFER 0xC0400000 //in SDRAMC-array containing GIF data also remains unchanged. The only change is
aMemory relocation from SDRAM to internal RAM.And got it:GUI_GIF_Draw()
returned 0. Works fine.
Can anyone suggest what is wrong with the drawing a GIF with
aMemoryallocated in SDRAM? First I thought that problem is in SDRAM, butGUI_BMP_Draw()andGUI_DrawBitmap()works properly regardless ofaMemoryallocation. May be I missed some options when I configured STemWin? Or while peripheral configuration (DMA2D, FMC, MPU regions...)?
It is critical for my development to use GIFs as they have compact size and the board has only internal flash on the chip (2 MB).
In addition, I'm going to use Window Manager and use GIFs as background images with different widgets over it. So I need to use Memory Devices for fast painting when invalidating windows and I should have sufficient RAM for that purposes as internal RAM is not enough.I can provide a code sections if it is needed.
Thanks for your time.
2018-06-01 02:57 PM
I'm sorry, at first with inexperience I've been making a mess with dublicate threads.
Now that is the only thread:
https://community.st.com/0D50X00009XkWIXSA3
Thanks to all.
2018-06-01 09:41 PM
Posted on June 02, 2018 at 04:41
<LINK NO LONGER ACTIVE>