We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Micro: 80C32 C51 version: 5.20 I am currently working on a project where the head electrical engineer has asked how much stack our application uses. Our application has a serial message server, and so I wrote a quick routine to query the internal RAM. After looking at the .m51 file, I knew our stack starts at memory location 0x5D, so I started querying there. It appeared that our maximum stack usage topped out at address 0x85. Just for grins, I checked the values of each idata byte from that point all the way up to 0xFF -- the top of the internal RAM memory map, right? I got expected values (0x00) at each location up to 0xFB. From location 0xFC to 0xFF, I got values other than expected, as if something wrote those values there. I can not find anything in our C-code that indicates a write to idata at these locations, so my question is this -- is there something that is normally written to the top of idata that I am unaware of -- something part of Keil, or 8051 derivatives, etc.?
Check whether you use any reentrant functions and have IBPSTACK set nonzero in startup.a51. The reentrant stack area (with default settings if IBPSTACK is enabled) grows downward in memory from 0xFF.
Just in case you haven't read this: http://www.keil.com/support/docs/192.htm