Hi ZhangJennie,
Thanks for your reply, at least now I'm able to build the project (a simple hello world ) without any error but (there's always a BUT), now the function GUI_Init() is generating an HardFault... I followed the disassembly and I noticed that the function LCD_Init() is generating it! Any idea?
what I've done is following:
- within the main() I'm initialising the custom board HW and the LCD controller (LCD_CONFIG_T)
- then I call the GUI_Init(), which calls: GUI_X_Config(), LCD_X_Config() and LCD_X_DisplayDriver() then after these, within the disassembly view, I can see the hard fault is generated within the LCD_Init after a simple compare instruction (cmp r0,#0)....
this is my GUIConf.c file:
----------------------------------------------------------------------
File : GUIConf.c
Purpose : Display controller initialization
---------------------------END-OF-HEADER------------------------------
*/
#include "GUI.h"
#include "GUIDRV_Lin.h"
#include "LCDConf.h"
#include "LCD_Config.h"
/*********************************************************************
*
* 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);
}
/*******************************************************************************
* Application implemented functions required by emWin library
******************************************************************************/
void LCD_X_Config(void)
{
#if (NUM_BUFFERS > 1)
GUI_MULTIBUF_Config(NUM_BUFFERS);
#endif
U32 a=GUI_DEVICE_CreateAndLink(GUIDRV_LIN_16, GUICC_565, 0, 0);
LCD_SetSizeEx(0, LCD_WIDTH, LCD_HEIGHT);
LCD_SetVSizeEx(0, LCD_WIDTH, LCD_HEIGHT);
LCD_SetVRAMAddrEx(0, &frame_buf);//(void *)VRAM_ADDR);
}
int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void *pData)
{
return 0;
}
void GUI_X_Init(void)
{
}
/* Dummy RTOS stub required by emWin */
void GUI_X_InitOS(void)
{
}
/* Dummy RTOS stub required by emWin */
void GUI_X_Lock(void)
{
}
/* Dummy RTOS stub required by emWin */
void GUI_X_Unlock(void)
{
}
/* Dummy RTOS stub required by emWin */
U32 GUI_X_GetTaskId(void)
{
return 0;
}
void GUI_X_ExecIdle(void)
{
}
GUI_TIMER_TIME GUI_X_GetTime(void)
{
return 0;
}
void GUI_X_Delay(int Period)
{
}
void GUI_X_ErrorOut(char const *s)
{
}
/*************************** End of file ****************************/