LISTVIEW_DeleteAllRows crashes system

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

  • LISTVIEW_DeleteAllRows crashes system

    Have a table that gets refreshed on a regular interval.
    Each refresh could contain more or less rows than before so I call LISTVIEW_DeleteAllRows.
    Then add the rows needed.

    Eventually LISTVIEW_DeleteAllRows causes an ISR Fault on the STM32F4xx.
    I have determine this because I set and clear a variable before and after call and the variable is set when the fault occurs.

    I have tried increasing GUI_NUMBYTES significantly with no tangible change.
    All other windows and widgets are working without problem, just having problem with the listview.


    I have read other posts about crashing and I am using an external SRAM but don't think that is the source of the problem since all other windows work.
    I have tried slowing down the refresh rate of the table so thatLISTVIEW_DeleteAllRows only gets called every 5 seconds and it still crashes.
    I am attempting to see if any registers on the STM32 give more insight but in the mean time thought I would post here.

    Any thoughts are appreciated.
    Thanks, rdecos

    The post was edited 1 time, last by Rdecos ().

  • Hi Adrian,

    Found out a little more insight:
    We believe we are running into a
    GUI memory problem.

    We are seeing intermittent Fault
    ISR.

    What GUI_Exec() is doing behind the scenes?

    Will it use and free memory all in the same call?

    If I call GUI_ALLOC_GetNumFreeBytes after the GUI_Exec call is it telling me
    the whole story?

    Is there a standard or rough guess of the overhead we
    should leave for GUI_Exec above what is returned with GUI_ALLOC_GetNumFreeBytes
    for operations (general operations described below)?


    What would happen if we don’t
    allocate enough memory for emWin?


    Will it continue to use memory past the allocated memory?


    Will it generate a fault ?


    Will it generate an error? (we have tried to use
    void GUI_X_ErrorOut(const char * s); void
    GUI_X_Warn(const char * s); void GUI_X_Log(const char * s); without success at GUI_DEBUG_LEVEL_LOG_ALL)

    We are using windowing and
    memory devices.

    We create 47 windows at start up
    with many different kinds and numbers of widgets.

    Most intensive GUI operations
    are believed to be deletion and creation of radio widgets and deleting and
    creating items in a listview.


    Below is the code that the
    uC/OS-III task that handles emWin execution.


    Thanks,
    Randy

    Code in while loop:

    guiTickBefore =
    OSTimeGet(&time_err);

    GUI_Exec();

    guiTickAfter = OSTimeGet(&time_err);

    if(guiTickAfter
    > guiTickBefore)


    {


    guiTickDiff = guiTickAfter - guiTickBefore;


    if(guiTickDiff > guiTickMaxDiff)


    {


    guiTickMaxDiff = guiTickDiff;


    }


    if(guiTickDiff > 5000)


    {


    message_ui_to_sequencer.ui_unique.flags.bit.gui_time_error = DEF_TRUE;


    }


    }


    guiFreeBytes = GUI_ALLOC_GetNumFreeBytes();


    guiUsedBytes = GUI_ALLOC_GetNumUsedBytes();


    if(guiUsedBytes > guiMaxUsedBytes)


    {


    guiMaxUsedBytes = guiUsedBytes;


    }


    if(guiFreeBytes < 5000)


    {


    message_ui_to_sequencer.ui_unique.flags.bit.gui_memory_error = DEF_TRUE;


    }



    OSTimeDlyHMSM(0u,


    0u,


    0u,

    3u,

    OS_OPT_TIME_PERIODIC,

    &err);

    The post was edited 1 time, last by Rdecos ().

  • Hello Randy,

    Memory usage strongly depends on the application. If a function requires a certain amount of memory to work, it usually returns an error value indicating it returned without success.

    Please refer to the descriptions of the functions GUI_Exec() and WM_Exec() for details about their function.

    Best regards,
    Adrian