Hi,
I wanted to do just a simple LCD driver that only prints data into ram, there is no actual LCD connected to the MCU, my MCU is STM32F103RBT6 and here is the content of my GUIConf and LCDConf files, the main program would do ok, after I call the GUI_Init(); function if I set the #define GUI_NUMBYTES 0x400, but when I increase it to something more, the program just crash, with the 0x400 stack also if I use any drawing functions the program would crash again. do you have any Idea what might be wrong?
the guiconf file
#include "GUI.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
//
// Define the available number of bytes available for the GUI
//
#define GUI_NUMBYTES 0x400
//
// Define the average block size
//
#define GUI_BLOCKSIZE 0x80
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* GUI_X_Config
*
* Purpose:
* Called during the initialization process in order to set up the
* available memory for the GUI.
*/
void GUI_X_Config(void) {
//
// 32 bit aligned memory area
//
static U32 aMemory[GUI_NUMBYTES / 4];
//
// Assign memory to emWin
//
GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
GUI_ALLOC_SetAvBlockSize(GUI_BLOCKSIZE);
}
the lcdconf file
#include "GUI.h"
#include "GUIDRV_Lin.h"
#define XSIZE_PHYS 128
#define YSIZE_PHYS 32
//
// Color conversion
//
#define COLOR_CONVERSION GUICC_1
//
// Display driver
//
#define DISPLAY_DRIVER GUIDRV_LIN_1
/*********************************************************************
*
* Configuration checking
*
**********************************************************************
*/
#ifndef XSIZE_PHYS
#error Physical X size of display is not defined!
#endif
#ifndef YSIZE_PHYS
#error Physical Y size of display is not defined!
#endif
#ifndef COLOR_CONVERSION
#error Color conversion not defined!
#endif
#ifndef DISPLAY_DRIVER
#error No display driver defined!
#endif
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* LCD_X_Config
*
* Function description
* Called during the initialization process in order to set up the
* display driver configuration.
*/
void LCD_X_Config(void) {
//
// Set display driver and color conversion for 1st layer
//
GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
//
// Display driver configuration
//
LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);// Physical display size in pixels
LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS );// Virtual display size in pixels
}
/*********************************************************************
*
* LCD_X_DisplayDriver
*
* Function description
* Display driver callback function. This function is called by the
* Display driver for certain purposes. Using GUIDRV_Win32 it is not
* required to react to any command.
*/
int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
GUI_USE_PARA(LayerIndex);
GUI_USE_PARA(Cmd);
GUI_USE_PARA(pData);
return 0;
}