This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to determine the actual usage for XDATA?

Hello,

I have a project with 512K flash for code and 64K SRAM for XDATA. After compiling with PK51, I got following infos about program size:
"data=188.0 xdata=51140 const=166971 code=203033".

My question is: does this mean the MAXIMUM usage for xdata is 51140? Or the actual space for xdata will increase when the code is up and running if there are pointer? How can I calculate the maximum/worst space requirement for xdata?

Any help is appreciated!

Thanks a lot
Henry

Parents
  • Thanks a lot, Dan.

    But how could I detemine if the remaining SRAM(64K - 51K) is enough for code to run? Or how could I determine if some strange issue is casued by the lack of SRAM? Are there tools or hints you could share for diagnosing this kind of issue?

    Why I am asking is becasue I am having some quite strange phenomena which I can not find the root cause. But I think the logical of my code is ok. There are some SRAM consuming protocols in my code.

    Best regards,
    Henry

Reply
  • Thanks a lot, Dan.

    But how could I detemine if the remaining SRAM(64K - 51K) is enough for code to run? Or how could I determine if some strange issue is casued by the lack of SRAM? Are there tools or hints you could share for diagnosing this kind of issue?

    Why I am asking is becasue I am having some quite strange phenomena which I can not find the root cause. But I think the logical of my code is ok. There are some SRAM consuming protocols in my code.

    Best regards,
    Henry

Children
  • "Are there tools or hints you could share for diagnosing this kind of issue?"

    Tools like lint (e.g., PC-Lint) come to mind.

    "Why I am asking is becasue I am having some quite strange phenomena which I can not find the root cause. But I think the logical of my code is ok. There are some SRAM consuming protocols in my code."

    200K is quite a bit of code for a '51. Why isn't your program's memory usage better understood? Are you the author? Was this program originally designed for an 8051 derivative? If not, the mere fact that an unusual and limited target processor architecture like the 8051 wasn't a design criterion could account for a lot of misbehavior.