Monday, December 11th 2017, 11:40pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

spk

Beginner

Date of registration: Jan 23rd 2016

Posts: 1

1

Monday, January 25th 2016, 5:29pm

Stm32f7 disco MEMDEV

Hello,

I was trying to make work example at Stemwin User Manuel page 332. My code is below.
If I use "WM_SetCreateFlags(WM_CF_MEMDEV);" , example doesnt work. If I dont use It works well. Why does It happen ?
Also I cannot use any MEMDEV function which is required WindowManager. ( Animation functions (Window Manager required) ). For instance ( GUI_MEMDEV_FadeInWindow() ) .What can I do for using them ?
I managed to make work almost all demos on stm32f7 disco kit. But for example "SKINNING_NestedModal" doesnt work. And It required Animation Functions( i.e GUI_MEMDEV_MoveInWindow() ). Im sure I'm missing someting but what ?
Any help is appriciated. Thx.

My LCD settings are:

#define XSIZE_PHYS 480
#define YSIZE_PHYS 272
#define NUM_BUFFERS 3 // Number of multiple buffers to be used (at least 1 buffer)
#define NUM_VSCREENS 1 // Number of virtual screens to be used (at least 1 screen)
#undef GUI_NUM_LAYERS
#define GUI_NUM_LAYERS 2
#define VRAM_ADDR 0xC0000000
#define DMA2D_BUFFER_ADDR 0x20000000
#define COLOR_MODE_0 COLOR_MODE_ARGB8888
#define XSIZE_0 480
#define YSIZE_0 272
#define ORIENTATION_0 ROTATION_0
#define COLOR_MODE_1 COLOR_MODE_ARGB8888
#define XSIZE_1 480
#define YSIZE_1 272
#define ORIENTATION_1 ROTATION_0
#define BK_COLOR GUI_DARKBLUE

//
// Define the available number of bytes available for the GUI
//
#define GUI_NUMBYTES 0x30000



int main(void)
{
WM_HWIN hWin;

MPU_Config();
//CPU_CACHE_Enable();
osKernelInitialize();
HAL_Init();
BSP_SDRAM_Init();
SystemClock_Config();
//WM_SetCreateFlags(WM_CF_MEMDEV);
GUI_Init();
BSP_TS_Init(480, 272);

osThreadCreate(osThread(GUIThread), NULL);
osTimer = osTimerCreate(osTimer(osTimer), osTimerPeriodic, (void *)0);

osKernelStart();
}

static void Timer_Callback(void const *n)
{

}

static void GUIThread(void const * argument)
{
GUI_HWIN hWin;

WM_SetDesktopColor(Convert565to8888(0x72A6));
GUI_SetLayerVisEx(1, 0);

GUI_CURSOR_Show();
osTimerStart(osTimer, 1000);

hWin = WM_CreateWindowAsChild(0,0,480,272, WM_HBKWIN, WM_CF_SHOW, _cbhWin, 0);

while(1)
{
tsState = TouchUpdate();
GUI_Exec();
osDelay(10);
}
}

static void _cbhWin(WM_MESSAGE * pMsg)
{
GUI_MEMDEV_Handle hMemSource;
GUI_MEMDEV_Handle hMemDest;

GUI_RECT RectSource = {0, 0, 69, 39};
GUI_RECT RectDest = {0, 0, 79, 79};

switch(pMsg->MsgId)
{
case WM_PAINT:
{
GUI_SetBkColor(GUI_RED);
GUI_Clear();
hMemSource = GUI_MEMDEV_CreateFixed(RectSource.x0, RectSource.y0,RectSource.x1 - RectSource.x0 + 1,RectSource.y1 - RectSource.y0 + 1,GUI_MEMDEV_NOTRANS,GUI_MEMDEV_APILIST_32, GUI_COLOR_CONV_888);
hMemDest = GUI_MEMDEV_CreateFixed(RectDest.x0, RectDest.y0,RectDest.x1 - RectDest.x0 + 1,RectDest.y1 - RectDest.y0 + 1,GUI_MEMDEV_NOTRANS,GUI_MEMDEV_APILIST_32, GUI_COLOR_CONV_888);
GUI_MEMDEV_Select(hMemSource);
GUI_SetBkColor(GUI_RED);
GUI_Clear();
GUI_DrawGradientV(RectSource.x0, RectSource.y0,RectSource.x1, RectSource.y1,GUI_WHITE, GUI_DARKGREEN);
GUI_SetColor(GUI_BLUE);
GUI_SetFont(&GUI_Font20B_ASCII);
GUI_SetTextMode(GUI_TM_TRANS);
GUI_DispStringInRect("emWin", &RectSource, GUI_TA_HCENTER | GUI_TA_VCENTER);
GUI_DrawRect(0, 0, RectSource.x1, RectSource.y1);
GUI_MEMDEV_Select(hMemDest);
GUI_SetBkColor(GUI_RED);
GUI_Clear();
GUI_MEMDEV_Select(0);
GUI_MEMDEV_RotateHQ(hMemSource, hMemDest,(RectDest.x1 - RectSource.x1) / 2,(RectDest.y1 - RectSource.y1) / 2,30 * 1000,1000);
GUI_MEMDEV_CopyToLCDAt(hMemSource, 10, (RectDest.y1 - RectSource.y1) / 2);
GUI_MEMDEV_CopyToLCDAt(hMemDest, 100, 0);
//GUI_MEMDEV_FadeInDevices(hMemSource, hMemDest, 3000);
break;
}
default:
{
WM_DefaultProc(pMsg);
}
}
}

SEGGER - Jörg

Super Moderator

Date of registration: Dec 20th 2007

Posts: 81

2

Tuesday, February 9th 2016, 10:11am

Hi,

the animation functions based on memory devices require more RAM than 0x30000 bytes in your case. For fading in a window a memory device (32bpp) for the window to be faded in is required, a working device for the animation and a background device is required.

Regards, Jörg