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

Moderator: igrr

User avatar
By anotherjoe
#60753 After adding some new functionality to my application, my compiled bin file is now 391728 bytes in size. I'm able to build and upload it without any issue but since this recent round of changes I've started to see wdt resets when parts of my code access flash via EEPROM using functions that have previously worked fine.

At first I thought I was seeing a flash failure type of issue so I started stripping the flash access area of my code back into smaller chunks and testing each part in smaller applications. Doing this worked without issues which seems to suggest the flash is actually healthy and code is fine too and I'm experiencing some other type of problem.

It feels like I've hit some sort of limitation around program size / available flash but I really don't know how to go about diagnosing this problem. Pretty much all of the functions throughout all of my classes are attributed with ICACHE_FLASH_ATTR - could doing this somehow be flash memory overuse and the cause of this problem?

Perhaps this type of problem sounds familiar to someone here. Does anyone know how to go about gaining an insight into what might be going on here?
Last edited by anotherjoe on Mon Jan 09, 2017 5:13 pm, edited 2 times in total.
User avatar
By anotherjoe
#60756 These are the 'big numbers' output from the linker at build time:

section size addr
.data 1740 1073643520
.rodata 8156 1073645264
.bss 33600 1073653424
.irom0.text 347136 1075843088
.text 30547 1074790400
.debug_frame 79344 0
.debug_info 1561193 0
.debug_abbrev 166949 0
.debug_loc 567251 0
.debug_aranges 21016 0
.debug_ranges 51328 0
.debug_line 416169 0
.debug_str 275328 0
.comment 7067 0
.xtensa.info 56 0
User avatar
By anotherjoe
#60855 So I still have no exact diagnosis of what is causing this problem but I now know for sure that it's not hardware / flash failure. I flashed another spare device with my code as-is and saw exactly the same wdt crash.

I then took another look at my code to see what no longer needed functionality I could potentially remove, I removed support for logging to thingspeak along with removal of the include to the thingspeak library, I trimmed down my EEPROM usage a little removing config items relating to thingspeak and guess what..the application is now running flawlessly on my device again.

If this doesn't point to "program size / flash size problem" then I don't know what does. It's really quite annoying that I can't pinpoint exactly where the problem is however and if I can't find it then I guess I've pretty much reached the limit of what features I can introduce..