<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>AVR on mjgraf.net</title>
    <link>https://mjgraf.net/tags/avr/</link>
    <description>Recent content in AVR on mjgraf.net</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <copyright>Michael J. Graf</copyright>
    <lastBuildDate>Mon, 23 Jul 2018 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://mjgraf.net/tags/avr/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>What I learnt today...</title>
      <link>https://mjgraf.net/electronics/1807-avr-data-memory-usage/</link>
      <pubDate>Mon, 23 Jul 2018 00:00:00 +0000</pubDate>
      <guid>https://mjgraf.net/electronics/1807-avr-data-memory-usage/</guid>
      <description>&lt;p&gt;&amp;hellip; is that on the AVR, &lt;strong&gt;the &amp;ldquo;Data Memory Usage&amp;rdquo; information given by AVRGCC only&#xA;refers to memory allocated at compile time, and does not take the stack into&#xA;account.&lt;/strong&gt;&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt; The stack is not to be underestimated: it&#xA;holds not only the return addresses from function calls, but also &lt;em&gt;all local&#xA;variables&lt;/em&gt;&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt; of the function(s) called.&lt;/p&gt;&#xA;&lt;p&gt;So you might feel safe and sound reading something&#xA;like &amp;ldquo;Data Memory Usage : 66 bytes 51,6% Full&amp;rdquo;, thinking there&amp;rsquo;s plenty&#xA;of space left for future features; and then the stack still swoops down and&#xA;corrupts your precious data because of a couple of nested function&#xA;calls.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
