Hardware fault when in loop for longer time

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

    • Hardware fault when in loop for longer time

      Hi,
      I'm using emWin with an STM32F7. I noticed that the system crashes with a hard fault when the program executes a longer loop.
      Is there anything I have to do to keep emWin alive? Until now I have called GUI_Exec() in some loops but it doesn't help in this case.

      Regards
      Jan
    • Hi,

      a loop like this keeps emWin alive:

      C Source Code

      1. while (1) {
      2. GUI_Delay(100);
      3. }
      I hope this solved your problem.

      Best regards,

      Florian
      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.
    • Thank you for your quick answer, Florian.
      My loop is not empty, a lot of calculations are done there which must not be delayed.
      And wouldn't GUI_Exec do the same as GUI_Delay?
      Can there be a hardware fault at all when not refreshing emWin?

      Regards
      Jan
    • Hi Jan,

      GUI_Delay() calls GUI_Exec() and delays the application, so both functions basically do the same (except for the delay).

      When not calling any of these two functions, nothing should happen, meaning emWin shouldn't break either.

      I'm not really sure why you're landing in HardFault then. It could be that not enough memory was assigned to emWin or something different not related to emWin.

      Best regards,

      Florian
      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.