I have confusion regarding Zi data + stack.
1. Why total ZI data has also stack size included in it. For example if 512 stack size is declared in code then total ZI data has 512 bytes in it.
Does that mean ZI data = bss section + stack size + heap size. That mean stack & heap are initialized to zero.
2. ALso what I think is that bss section which I think is (ZI data - stack) but in keil its ZI + stack.
I think that during startup ZI data will not be loaded. They took some location location in RAM. So on startup they won't let any watchdog reset problem .
Data loaded on startup is RW data. This is data whose values got load from flash into ram variable during startup. so they can cause problem in watchdog timer & rest them if RW daat is large.
Is it right or I got it wrong.
Question remains:
1. Why ZI data in keil also include stack & heap size. If ZI data has stack size included then that means stack size i.e. 512 bytes in my case are also init to zero???
2. My question is that I think ZI data does not get loaded on startup, it RW data which gets loaded on startup. I am right here?????
3. Since by default heap size is zero in my case, then why code containing malloc gets buildup. Shouldn't it show error. But also on debugging the code do not execute properly. Is it due to malloc ..
"But also on debugging the code do not execute properly. Is it due to malloc .."
So why debug an application that uses malloc() if you haven't allocated any heap?
That is like test-driving a car without first mounting the wheels - you'll get a very unsatisfactory result...