Wednesday, April 25th 2018, 12:43am UTC+2

You are not logged in.

  • Login
  • Register

crivelma

Beginner

Date of registration: Apr 17th 2015

Posts: 9

1

Monday, June 8th 2015, 9:09am

TIVA emWin RemoveFreeBlock

All,
I've integrated emWIN in my TIVA project with TI-RTOS.

I'm using windows manager with memdev option and my application consist of a semi-static screen with an update every one second (only text fields).

The issue I see is that after a random time of free running (from 30 sec to 31 h) an exception rise up on my TIVA C129 and in my exception call stack I see:
RemoveFreeBlock
AddFreeBlock
Gui_Alloc

The exception signalled by ARM is number 11 (SVCAll exception), and my debug version of the program let me see this message on my debug window:
Illegal memory operation in RemoveFreeBlock().

Is there a way to prevent the exception? Beside, is there a way to manage the exception (e.g. Gui-reinit, ...)

Thanks in advance,
Regards,
Marco Crivellari


PS:
I see this issue also in my simulator version of the GUI, but as I said before, it's very random.
For sure, I close every window before create new one, because I know I have to reduce RAM consumption.

Date of registration: May 26th 2009

Posts: 1,022

2

Monday, June 8th 2015, 10:18am

Hello Marco,

It seems your application tries to free an already freed memory block. Please make sure handles are set to 0 once they were used to delete an object.

Best regards,
Adrian

crivelma

Beginner

Date of registration: Apr 17th 2015

Posts: 9

3

Wednesday, June 10th 2015, 10:40am

Hi Adrian,
what do you mean as handlers?

Can you tell me an example of a clean procedure to do that.

Thanks in advance.

MC

crivelma

Beginner

Date of registration: Apr 17th 2015

Posts: 9

4

Wednesday, June 10th 2015, 11:38am

Honestly,
I don't understand which handler you mean.

I have a static page where I update with TEXT a timecounter. The only handler is the textbox.

Regards,
MC

Date of registration: May 26th 2009

Posts: 1,022

5

Thursday, June 11th 2015, 2:42pm

Hello,

In order to access a window or its properties, you will have to use its handle. Could you please tell me which functions you use to create or delete windows or Memory Devices? Thank you.

Best regards,
Adrian

crivelma

Beginner

Date of registration: Apr 17th 2015

Posts: 9

6

Monday, June 22nd 2015, 12:20pm

Hi Adrian.

Below my code, this is the sample that I call every 1 second.


HWinMain is the handle of foreground window.


if( hWinMain )


{

//

// Live display

//


hItem = WM_GetDialogItem(hWinMain, ID_TEXT_3);

strcpy( tmpString, appMain.config.message.general.live_display_1 );

strcat( tmpString, ": " );

AppDataGetTemperature( tmpValue, appData.test.control.t_current, 1 );


strcat( tmpString, tmpValue );

TEXT_GetText( hItem, tmpValue, 40 );

if( strcmp( tmpValue, tmpString) != 0 )


{

TEXT_SetText(hItem, tmpString );

}


hItem = WM_GetDialogItem(hWinMain, ID_TEXT_4);

strcpy( tmpString, appMain.config.message.general.live_display_2 );

strcat( tmpString, ": " );

AppDataGetTime( tmpValue, (appData.test.control.elapsedTime / OS_BASE_MILLISEC), 1 );


strcat( tmpString, tmpValue );

TEXT_GetText( hItem, tmpValue, 40 );

if( strcmp( tmpValue, tmpString) != 0 )


{

TEXT_SetText(hItem, tmpString );

}


//

// Stations

//

for( i=0; i<appData.test.setup.num_of_stations; i++ )


{

floatToStr( appData.test.station.displacement, tmpString, 3 );


AppDataGetLinearUnit( tmpUnit, tmpString );

TEXT_GetText( hTextDispl[i], tmpValue, 20 );

if( strcmp( tmpValue, tmpString) != 0 )


{

TEXT_SetText( hTextDispl[i], tmpString );

}


floatToStr( appData.test.station[i].temperature, tmpString, 2 );


AppDataGetTempUnit( tmpUnit, tmpString );

TEXT_GetText( hTextTemp[i], tmpValue, 20 );

if( strcmp( tmpValue, tmpString) != 0 )


{

TEXT_SetText( hTextTemp[i], tmpString );

}

}

}


Let me know.

MC

Date of registration: May 26th 2009

Posts: 1,022

7

Tuesday, June 23rd 2015, 9:38am

Hello,

The code should not cause a problem, although I am not sure about the AppData...() functions.

Best regards,
Adrian