cancel
Showing results for 
Search instead for 
Did you mean: 

STemWin Swipelist exception

bbee
Associate III
Posted on May 15, 2017 at 16:14

Hello.

I'm using STM32CubeF4 1.14.0 with STemWin 5.32 and have setup a simulation of the GUI in Visual Studio where I link the STemWin532_WIN32.lib into the project.

I have found a severe problem with the SWIPELIST widget which throws an exception in the simulation each time when you populate the list and after that delete the swipelist or a the last item in the list like:

  WM_HWIN hSwipe = SWIPELIST_CreateEx(400, 290, 200, 120, hWin, WM_CF_HIDE, 0,

                                      GUI_ID_SWIPELIST0);

  SWIPELIST_AddItem(hSwipe,'Item 0',100);

  SWIPELIST_DeleteItem(hSwipe,0);

This throws an unhandled exception in the simulation. I checked the behaviour against the up to date simulation library from Segger (5.40) and found that the behaviour cannot be reproduced there. Also the code on the embedded target does not show that behaviour.

How can this be fixed? Unfortunately the new STM32CubeF4 (1.16) still has the old STemWin 5.32.

Additionally I found that the description of return value from SWIPELIST_AddItem in the manual is not correct. Instead to return 1 when an item has been added successfully it returns 0 on success and 1 on failure.

#stm32f4 #stemwin
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on November 22, 2017 at 12:53

Hello, 

I would inform you that the new release of STM32CubeF4 v1.17.0 is updated to use STemWin V5.40.

This will resolve the SWIPELIST issue.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

6 REPLIES 6
bbee
Associate III
Posted on May 16, 2017 at 08:39

I did some more debugging and now it is sure that this is NULL pointer exception in SWIPELIST_DeleteItem which only shows up in the simulation.

However the same NULL pointer access happens in the embedded target but reading from address 0 does not throw an exception because Flash memory is remapped to address 0.

Imen.D
ST Employee
Posted on May 17, 2017 at 15:52

Hi

Hummel.Reiner

,

I shared your issue and feedback internally for further check and investigation.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
marco239955_stm1_st
Associate II
Posted on June 23, 2017 at 14:35

Hello,

  we have the same issue here with SWIPELIST_DeleteItem() function.

Have you found out anything about it?

I suspect that the problem has been solved in emWin 5.34b, see the

https://www.segger.com/downloads/emwin/Release.html

for this version:

SWIPELIST widget:

 

Under certain circumstances SWIPELIST_DeleteItem() does not work right. Problem solved.

Are there any workarounds meanwhile stm32CubeF4 integrates a newer version of emWin? I mean, have you got any hints about how to avoid those circumstances?

Thanks and best regards,

 Marco Lazzaroni

bbee
Associate III
Posted on June 26, 2017 at 08:22

Unless you don't have the source code of a newer emwin version (to be able to override SWIPELIST_DeleteItem) the only way is to avoid to call the function or to delete the swipelist at all.

We now use a global instance of swipelist that is attached to the window which uses it on WM_INIT_DIALOG and detached on WM_DELETE thus avoiding that WM_DELETE is send to the swipelist.

marco239955_stm1_st
Associate II
Posted on June 26, 2017 at 08:56

We've already tested your workaround and it works!

Thank you very much, you've saved us some hours of work!

Anyway let's hope that Cube will soon integrate a more stable version of emWin.

Cheers

 Marco

Posted on November 22, 2017 at 12:53

Hello, 

I would inform you that the new release of STM32CubeF4 v1.17.0 is updated to use STemWin V5.40.

This will resolve the SWIPELIST issue.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen