unstable project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

unstable project

1,294 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pcalton on Fri Aug 16 10:43:53 MST 2013
I have a simple emWin project that runs perfectly in the simulator. However, when I download it to my embedded system it hardfaults if I keep pressing buttons. The faults occur within GUI_ALLOC_UnlockH or GUI_ALLOC_LockH.

Could you give any pointers as to why these functions may fail in an embedded system but not in the simulation?
Labels (1)
0 Kudos
5 Replies

782 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by YOZHik on Thu Oct 24 07:31:14 MST 2013
I ran into the same problem when tried to change widget parameters from interrupts while GUI_Exec() function was running. It might be the same with your case as well.
0 Kudos

782 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pcalton on Tue Aug 20 12:58:55 MST 2013
Memory_B1 is the SDRAM at 0x28000000

The full linker script is now attached (renamed .txt so that I could upload)

The hardfault is a PRECISERR sometimes occurs within the GUI_ALLOC_LockH or GUI_ALLOC_UnlockH

e.g. PRECISERR with a BFAR of 0xa8040008 that occurs at 0x1a01fdb0 (within GUI_ALLOCK_UnlockH)

0xa8040008 is not a valid memory address
0 Kudos

782 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon Aug 19 22:02:06 MST 2013
Hi pcalton,
What is the value of MEMORY_B1? Using debugger you can check the type of fault. Let us know the details.

---------
Thanks,
MC
0 Kudos

782 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pcalton on Mon Aug 19 10:38:00 MST 2013
My memory is allocated as so:
#define GUI_NUMBYTES  (1024 * 1024) * 24 // x MByte
#define GUI_BLOCKSIZE 0x80
U32 static _aMemory[GUI_NUMBYTES / 4] __attribute__ ((section(".GUI_RAM")));

void GUI_X_Config(void) {
  //
  // Assign memory to emWin
  //
  GUI_ALLOC_AssignMemory(_aMemory, GUI_NUMBYTES);
  GUI_ALLOC_SetAvBlockSize(GUI_BLOCKSIZE);
}


Theframebuffers are allocated as so:

#define FB_XSIZE  480
#define FB_YSIZE  272
#define XSIZE_PHYS FB_XSIZE 
#define YSIZE_PHYS FB_YSIZE 

#define NUM_BUFFERS   3
#define NUM_VSCREENS  1
#define PIXEL_WIDTH  4

#define VRAM_ADDR_PHYS  (U32)&_aVRAM[0]

#define COLOR_CONVERSION GUICC_8888

static U32 _aVRAM[NUM_BUFFERS * FB_XSIZE * FB_YSIZE / (4 / PIXEL_WIDTH)] __attribute__ ((section (".VRAM")));

void LCD_X_Config(void)
{
GUI_MULTIBUF_Config(NUM_BUFFERS);
//
// Set display driver and color conversion for 1st layer
//
GUI_DEVICE_CreateAndLink(GUIDRV_LIN_32, COLOR_CONVERSION, 0, 0);

//
// Display driver configuration, required for Lin-driver
//
LCD_SetPosEx(0, 0, 0);
if (LCD_GetSwapXY())
{
LCD_SetSizeEx(0, YSIZE_PHYS, XSIZE_PHYS);
LCD_SetVSizeEx(0, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS);
}
else
{
LCD_SetSizeEx(0, XSIZE_PHYS, YSIZE_PHYS);
LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS);
}
LCD_SetVRAMAddrEx(0, (void *) VRAM_ADDR_PHYS);
}


They are assigned to the external SDRAM in the linker file as so:
.GUI_RAM (NOLOAD) : 
  {
    . = ALIGN(4);
    *(.GUI_RAM)
    *(.VRAM)
    . = ALIGN(4);
  } >MEMORY_B1


0 Kudos

782 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Fri Aug 16 19:06:22 MST 2013
Hi pcalton,
It may be possible that memory is not allocated correctly. Do you know how are you allocating memory?
0 Kudos