Hello community,
the embedded wizard framework works properly in my example, but when I deinit and reinit (with the normal initialization routine) the framework, than I get the following error:
[ERROR in ewgfx.c:1721] Failed to start the update of the viewport 0x6017C558.
[FATAL ERROR in ewobject.c:651] Can not create an object. Out of memory.
assertion "!block_is_last(block)" failed: file "./inc/Misc/tlsf.c", line 248, function: block_next
The address 0x60000000, is the address of the external SDRAM.
the initialization routine looks like this:
EmbeddedWizzard_Driver_Status_t Init(void)
{
MemPool = 0;
viewport = 0;
EmbeddedWizzard_Driver_Status_t status;
EwBspConfigDisplay((uint32_t)FRAME_BUFFER_WIDTH, (uint32_t)FRAME_BUFFER_HEIGHT,(uint32_t) FRAME_BUFFER_ADDR);
MemPool = tlsf_create_with_pool( MEMORY_POOL_ADDR, MEMORY_POOL_SIZE );
/* initialize the Graphics Engine and Runtime Environment */
EwBspConfigSystemTick();
if (EwInitGraphicsEngine(NULL) == 0)
{
return status;
}
viewport = EwInitViewport( EwScreenSize, EwNewRect( 0, 0, FRAME_BUFFER_WIDTH, FRAME_BUFFER_HEIGHT ),
0, 255, (uint32_t*)FRAME_BUFFER_ADDR, (uint32_t*)DOUBLE_BUFFER_ADDR, 0, (XViewportProc)0 );
rootObject = (CoreRoot)EwNewObjectIndirect( EwApplicationClass, 0 );
EwLockObject( rootObject );
(void)CoreRoot__Initialize( rootObject, EwScreenSize ); //Return value can not be tested regarding its consistency
return 1;
}
and the deinit routine like this:
void DeInit(void)
{
EwDoneViewport( viewport );
EwUnlockObject( rootObject );
/* finished -> release unused resources and memory */
EwReclaimMemory();
/* ... and deinitialize the Graphics Engine */
EwDoneGraphicsEngine();
tlsf_destroy( MemPool );
}
The external SDRAM is emptied with the function "memset" before embedded wizard gets initialized.
Has anyone an idea why this error occurs?`
Best regards