<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: SRAM .data size issue?</title>
		<link>http://forums.leaflabs.com/topic.php?id=2069</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:24:29 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=2069" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "SRAM .data size issue?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2069#post-21348</link>
			<pubDate>Thu, 29 Nov 2012 19:25:32 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">21348@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;go61t - The number of times Flash can be rewritten is explained here:&#60;br /&#62;
&#60;a href=&#34;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00161566.pdf&#34; rel=&#34;nofollow&#34;&#62;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00161566.pdf&#60;/a&#62;&#60;br /&#62;
in the section titled &#34;5.3.9 Memory characteristics&#34;&#60;/p&#62;
&#60;p&#62;An STM32F103RBT6 doesn't not have an interface to external memory, so its RAM can't be extended.&#60;/p&#62;
&#60;p&#62;Maple Native described at &#60;a href=&#34;http://leaflabs.com/devices/&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/devices/&#60;/a&#62; has 64KB SRAM (on-chip), 1MB SRAM (external)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>go61t on "SRAM .data size issue?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2069#post-21344</link>
			<pubDate>Thu, 29 Nov 2012 18:52:18 +0000</pubDate>
			<dc:creator>go61t</dc:creator>
			<guid isPermaLink="false">21344@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi there,&#60;/p&#62;
&#60;p&#62;I always see a size of 13KB in total for the compiled code when using SRAM. even if the code is almost without any statements. why is the code that big? for projects using sd card or realtime the code is exceeding the availale space by far!&#60;/p&#62;
&#60;p&#62;what are the possibilities to extend the sram without to use flash instead. How often flash could be rewritten!&#60;/p&#62;
&#60;p&#62;Thanks, Sebastian - cu
&#60;/p&#62;</description>
		</item>
		<item>
			<title>beachbum on "SRAM .data size issue?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2069#post-11670</link>
			<pubDate>Tue, 10 Jul 2012 14:58:43 +0000</pubDate>
			<dc:creator>beachbum</dc:creator>
			<guid isPermaLink="false">11670@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Yep, yinz are right. My bad. Sorry. Whoops. Thanks for the help.&#60;/p&#62;
&#60;p&#62;After doing 20+ compiles last night, i verified that it was just a coincidence that my actual SRAM usage went over the 20KB (17KB) limit at the same compile as when the IDE reported the funnily calculated .data of (text+data), went over the 20KB limit.&#60;/p&#62;
&#60;p&#62;For info to others, for when uploading to flash, recommend calculating your SRAM usage by using arm-none-eabi-size on your &#38;lt;mysketch&#38;gt;.cpp.elf file, and making sure your (data+bss) is less than approximately the 15KB to 16KB range on a 20KB SRAM device. There's a bit of an area where one gets hard to debug program bombs before the compiler/linker catches that one is using too much SRAM and gives the red failure message. One needs to keep in mind that various overheads included in your sketch, as reported by &#34;blink&#34;, use 2KB+ of SRAM, and then there's the 3KB reserved for the bootloader (thanks, gbulmer!). The stuff that needs to be in SRAM include (data + bss + stack + alignments + maybe padding + space reserved for bootloader) if uploading to flash is selected. And, one needs to also add in the text section if uploading to SRAM is selected. &#60;/p&#62;
&#60;p&#62;That was a fun 4 days trying to solve this ;-)&#60;/p&#62;
&#60;p&#62;Again, love the Maple! Thanks for doing this project!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "SRAM .data size issue?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2069#post-11665</link>
			<pubDate>Tue, 10 Jul 2012 08:24:51 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">11665@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;beachbum - The bootloader consumes SRAM.&#60;br /&#62;
The first thread I found is this from September 2010: &#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=157#post-996&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=157#post-996&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;which says 3KiB are reserved. I do not believe the Maple bootloader has been updated to use less SRAM since then.&#60;br /&#62;
So the SRAM limit is 17KiB&#60;/p&#62;
&#60;p&#62;Are the large-ish data arrays constant or not? If they are constant, they can be stored in Flash, and won't consume any RAM.&#60;br /&#62;
This post gives an example: &#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=1009#post-6210&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=1009#post-6210&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;(Full disclosure: I am not a member of LeafLabs staff.)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>beachbum on "SRAM .data size issue?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2069#post-11657</link>
			<pubDate>Mon, 09 Jul 2012 15:42:47 +0000</pubDate>
			<dc:creator>beachbum</dc:creator>
			<guid isPermaLink="false">11657@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks, crenn. The data arrays were larger in previous version of my code prior to reducing them in half. I'll spend the evening trying the code in another 10 different ways to isolate further. There is a chance that, by coincidence, the IDE compile reported .data of (text+data) went over the 20KB SRAM limit at the exact same time that the (data+bss+stack+alignments+padding) went over the 20KB limit. &#60;/p&#62;
&#60;p&#62;It took me a while to figure out to run arm-none-eabi-size on the &#38;lt;myprogram&#38;gt;.cpp.elf file to get the necessary info. Stack/memory overflows are fun! ;-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "SRAM .data size issue?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2069#post-11646</link>
			<pubDate>Mon, 09 Jul 2012 02:44:44 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">11646@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Do you have a large non-constant data array by chance? Could you post your code in pastebin for us to see?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>beachbum on "SRAM .data size issue?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2069#post-11636</link>
			<pubDate>Sun, 08 Jul 2012 23:49:46 +0000</pubDate>
			<dc:creator>beachbum</dc:creator>
			<guid isPermaLink="false">11636@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The solution perhaps may be in a linker script, which may be somewhere in the downloaded arm tools tree, and be editable. Does anyone know which .ld or armelf.x? linker script is called for the Maple R3+ going to flash? Thanks in advance.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>beachbum on "SRAM .data size issue?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2069#post-11628</link>
			<pubDate>Sun, 08 Jul 2012 18:42:09 +0000</pubDate>
			<dc:creator>beachbum</dc:creator>
			<guid isPermaLink="false">11628@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi, love the Maple! Thanks, LeafLabs, for doing this!&#60;/p&#62;
&#60;p&#62;I'm doing a LED lights project, and running into a hard problem with the SRAM usage though on my Maple R5. I'm using the IDE (v0.0.12) on Winblows XP, compiling for a Maple R3+ uploading the program to flash. My program bombs and the LED sometimes throbs when .data, as reported on IDE compilation, goes over the Maple's 20KB (20,480 bytes) of SRAM. &#60;/p&#62;
&#60;p&#62;Prob is, when the IDE compilation reports a .data size right at 20,480 bytes, i then run arm-none-eabi-size on my lights12.cpp.elf file, which reports text=17564 data=2912 bss=7400 dec=27876 (the bss is large because of two big arrays). It seems that the .data size is reported, and thus the size that tried to be loaded into the SRAM, consists of (text=17564 + data=2912) to get to 20,476. Shouldn't the .data size that gets loaded into SRAM instead be (data + bss + space for the stack) since text only gets loaded into ROM/flash?&#60;/p&#62;
&#60;p&#62;As a comparison, i compiled &#34;blink&#34;, and the IDE compilation reports a .data size of 12840. Then running 'size' on blink.cpp.elf reports text=11215 data=1624 bss=416 dec=13255). Note that blink's text + data = 12839, resulting in the reported .data of 12840.&#60;/p&#62;
&#60;p&#62;Could a bug be in the compilation process resulting in this? I checked the flash.ld config file that gets called, and it does indeed try to load &#34;REGION_TEXT&#34; to rom, and &#34;REGION_DATA&#34; to ram.&#60;/p&#62;
&#60;p&#62;Is there anything i could do to get around this? I would strongly prefer not to buy another computer to load Linux and setup the UNIX tool chain to then tweak the Makefile. My preferences are if a config file somewhere could be changed, or download a .exe or .dll that makes this correction, or barring that, unsolder the normal RBT chip and try to solder in a RET6 chip. &#60;/p&#62;
&#60;p&#62;As always, i could have been doing something stupid, but i don't see it if i am. I have run my program numerous times, and the problem occurs right when the reported .data goes over 20,480 bytes, despite numerous changes i made to functions in the program, so it's not related to any specific 'C' code. &#60;/p&#62;
&#60;p&#62;Any suggestions or ideas?&#60;/p&#62;
&#60;p&#62;Thanks in advance!!!!!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
