GUI_Exec crashes when using touchscreen (STMF7 discovery)

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • GUI_Exec crashes when using touchscreen (STMF7 discovery)

    Hello,

    I got a stm f7 discovery board a few weeks ago and started using stemwin with it.
    ST provides a very basic example that just displays hello world. After a bit of messing around with it I got some basic GUI stuff to work.
    I wanted to use the touchscreen as the LCD on the discovery board has a nice capacitive touchscreen.
    As I don't need multitouch I implemented the generic touch screen api.
    The following code gets called ~100 times per second:

    C Source Code

    1. void BSP_Background(void)
    2. {
    3. TS_StateTypeDef TouchHandle;
    4. GUI_PID_STATE PidStage;
    5. BSP_TS_GetState(&TouchHandle);
    6. if(TouchHandle.touchDetected >= 1)
    7. {
    8. PidStage.Layer = 0;
    9. PidStage.Pressed = 1;
    10. PidStage.x = 480 - TouchHandle.touchX[0];
    11. PidStage.y = 272 - TouchHandle.touchY[0];
    12. GUI_TOUCH_StoreStateEx(&PidStage);
    13. WM_HandlePID();
    14. }
    15. else
    16. {
    17. PidStage.Layer = 0;
    18. PidStage.Pressed = 0;
    19. PidStage.x = -1;
    20. PidStage.y = -1;
    21. GUI_TOUCH_StoreStateEx(&PidStage);
    22. WM_HandlePID();
    23. }
    24. }
    Display All


    The code for the display is the graph example ( Graph widget 2 ) found here unchanged: segger.com/cms/admin/uploads/u…ples/src/WIDGET_GraphYT.c

    The touchscreen works as I can move the cursor without any problems but after I moved the cursor for the first time the screen freezes. GUI_Exec(); blocks and because of that the graph stops getting any data and nothing on the screen updates. Except the cursor. even after the screen froze and it never gets out of the GUI_Exec(); routine I can still move the cursor.

    What causes GUI_Exec(); to block?

    Best regards,

    Rik
  • Hi,

    The function WM_HandlePID() is not allowed to be called by the application. That may causes the problem.

    Regards, Jörg
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.