Segmentation fault using emWin with Ubuntu

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

  • Segmentation fault using emWin with Ubuntu

    Good morning,

    I am implementing a simple simulator for emWin (similar to the Windows one) on Ubuntu 16.04 x64.

    I call GUIConf is configured with

    Source Code

    1. #define GUI_NUMBYTES 0x400000
    2. void GUI_X_Config(void) {
    3. //
    4. // 32 bit aligned memory area
    5. //
    6. static U32 aMemory[GUI_NUMBYTES / 4];
    7. //
    8. // Assign memory to emWin
    9. //
    10. GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
    11. //
    12. // Set default font
    13. //
    14. GUI_SetDefaultFont(GUI_FONT_6X8);
    15. }
    Display All


    LDConf looks like

    Source Code

    1. void LCD_X_Config(void) {
    2. GUI_DEVICE_CreateAndLink(GUIDRV_LIN_8, GUICC_8666, 0, 0);
    3. }


    when tracing into

    GUI_DEVICE_CreateAndLink it segfaults in GUI_Alloc.c (line 898ff)[/size]

    Source Code

    1. //
    2. // Create linked list of empty blocks
    3. //
    4. for (i = 0; i < GUI_ALLOC__Context.NumBlocks - 1; i++) {
    5. (GUI_ALLOC__Context.pBlocks + i)->u.NextBlock = i + 1;
    6. }



    Am I missing something here or is it a bug? The crash happends even before any VRAM is assigned to emWin.

    Any ideas?

    Cheers,

    Markus