Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By philbowles
#68996 Does anyone know how to view the output from this system call? My project is working "fine"...except that after hours on end of working perfectly it appears to "freeze up" (i.e I can't see any debug output, and it can take several power cycles to get it running again). My own debug output shows the heap size is constant for hours and hours - when i return the next morning, it has frozen up as above. I'm using several libraries that use arduino Strings and I suspect heap fragmentation as I have spent several days checking my own code for memory leaks etc - my output shows that there are none immediately apparent after sometimes 10, 12+ hrs of continuous running. Anyway, I'd like to see the state of memory periodically in the log.

I found system_print_meminfo(); but for the life of me I can't work out how to get the ouput into the COM window of the arduino IDE (or anywhere else!). I have even hacked the core files and put it in the init_done section straight after a system_set_os_print (1)

I know it's definitely getting called, as I call it in my main code just after another system_ function:

Code: Select all    Serial.printf("CAN CALL OS FN %d\n",system_get_free_heap_size()); // shows correct value
    system_print_meminfo(); // shows nothing


Any ideas? Is this even going to help me identify the suspected heap fragmentation?
User avatar
By philbowles
#69027 UPDATE: I finally tracked down the problem to a bug in the Arduino String class library (see: https://github.com/esp8266/Arduino/issues/3516 but as the situation in which that bug arises is caused by memory fragmentation...I still want to know how to see the meminfo output!