Error Setting Text

Hi Team,
when i try to set text from other function Getting Error for both lv_arc_set_value(); and lv_arc_set_text();
Error: lv_label_set_text (lv_label.c #182 lv_label_set_text())
Error: NULL pointer (0x00000000) (lv_debug.c #127 lv_debug_log_error())

Code

int handleDimmerLevelMessage(char *message){
    printf("### Message Arrived From Dimmer[level]: %s",message);
    int value;
    sscanf(message,"%d",&value);
    printf("###Printing Value:%d",value);
    lv_arc_set_value(dimmer,value);
    lv_label_set_text(level,message);
    return 0;
}

And this error not occurring all the time. sometimes this lv_arc_set_value(); and lv_arc_set_text(); working fine.

Can you please help me with this. why this error coming?

Thanks in Advance.

Print out the values of dimmer and level to make sure they’re never null when the crash happens.

They are not null i am getting values for both dimmer and level
when i set values to arc or text getting error

Assuming message is not null my only guess would be memory corruption.

Can you use a debugger to see where it halts?

Hi kisvegabor,
Please find the error below
Error: lv_label_set_text (lv_label.c #182 lv_label_set_text())
Error: NULL pointer (0x00000000) (lv_debug.c #127 lv_debug_log_error())

this lv_label_set_text and lv_arc_set_text sometimes working fine.

Please use a debugger to find the exact spot where the NULL pointer is detected.

HI Team,
this showing error at lv_label_set_text()

still don’t know why this issue not coming all the time.
some times its working fine and some times its not working

and i tried to set text manually i.e lv_label_set_text(name,“Office”); and lv_arc_set_value(arc,75);. this function also showing null pointer errors sometimes

I think you will need to do some more debugging to find the issue; we don’t really have enough information to help you further.