876 views
in System Integration by

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

by
As an additional information: I haven't used a rtos, just bare metal.

1 Answer

0 votes
by
Hello,

difficult to find the root cause remotely...

It seems to me, that there happens some memory overwriting. Can you ensure that there are no activities ongoing during/after the deinitialization, e.g. some DMA or graphics accelerator operations?

What target are you using? Are you using the latest version of Embedded Wizard and the target Build Environment? Since version 9.30 we provide our own heap manager - there is no need for the third-party TLSF.

Best regads,

Manfred.

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...