2017-05-15 07:14 AM
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 #stemwinSolved! Go to Solution.
2017-11-22 04:53 AM
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
2017-05-15 11:39 PM
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.
2017-05-17 06:52 AM
Hi
Hummel.Reiner
,I shared your issue and feedback internally for further check and investigation.
Thanks
Imen
2017-06-23 05:35 AM
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
2017-06-25 11:22 PM
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.
2017-06-25 11:56 PM
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
2017-11-22 04:53 AM
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