cancel
Showing results for 
Search instead for 
Did you mean: 

Define and use data sections in the Touchgfx simulator?

awiernie
Senior II

Can I use memory data sections in the SIMULATOR of TouchGFX?

 

I want to add something like

{
    setError(1); // 1 will be replaced by an unique constant (enum) 
    #if USE_ADD_INFO_FOR_ERROR
    ADD_INFO_FOR_ERROR(1, "some explanation for error 1");
    #endif
}

add various places in the source code and print them in the simulator in the main() function w/o calling ADD_INFO_FOR_ERROR before. 

This would work with:

#define ADD_INFO_FOR_ERROR(INTEGERVALUE, CONSTANTTEXT) \
    static const struct { \
        int index; \
        const char *text; \
    } entry_##INTEGERVALUE __attribute__((section(".add_info_section"), used)) = {INTEGERVALUE, CONSTANTTEXT};

 This compiles with the productive system but with the simulator, it is not possible or I do not know how to access the data section. 

0 REPLIES 0