<?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; User Favorites: ahunter10@gmail.com</title>
		<link><a href='http://forums.leaflabs.com/profile.php?id=3890'>3890</a></link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:16:00 +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?profile=3890" rel="self" type="application/rss+xml" />

		<item>
			<title>Darth Maker on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5928</link>
			<pubDate>Sat, 06 Aug 2011 12:45:03 +0000</pubDate>
			<dc:creator>Darth Maker</dc:creator>
			<guid isPermaLink="false">5928@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;And some of us are even more familiar with mid-range 8-bit PICs, which have 14-bit instructions.  :D&#60;/p&#62;
&#60;p&#62;Although, the 18F series does use 16bit instructions.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5915</link>
			<pubDate>Fri, 05 Aug 2011 19:10:36 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">5915@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Darth Maker&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;It also should be noted that even with the exact same number of assembly lines, Maple/(most 32bit processors) compiled code will be larger, since the instructions themselves are larger (32bit vs 8-14bit).
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;Many people are familiar with the 8-bit ATmega often because of Arduino. &#60;/p&#62;
&#60;p&#62;The instruction size for that is mostly 16 bits with a few 32bits (a form of call, jump, load and store)&#60;br /&#62;
&#60;a href=&#34;http://en.wikipedia.org/wiki/Atmel_AVR&#34; rel=&#34;nofollow&#34;&#62;http://en.wikipedia.org/wiki/Atmel_AVR&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://www.atmel.com/dyn/resources/prod_documents/doc0856.pdf&#34; rel=&#34;nofollow&#34;&#62;http://www.atmel.com/dyn/resources/prod_documents/doc0856.pdf&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5907</link>
			<pubDate>Fri, 05 Aug 2011 17:01:27 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">5907@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Actually, that's not quite true -- Thumb 2 is a variable-length instruction set, so many instructions are 16 bits wide.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://en.wikipedia.org/wiki/ARM_architecture#Thumb-2&#34; rel=&#34;nofollow&#34;&#62;http://en.wikipedia.org/wiki/ARM_architecture#Thumb-2&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Darth Maker on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5895</link>
			<pubDate>Fri, 05 Aug 2011 02:15:37 +0000</pubDate>
			<dc:creator>Darth Maker</dc:creator>
			<guid isPermaLink="false">5895@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It also should be noted that even with the exact same number of assembly lines, Maple/(most 32bit processors) compiled code will be larger, since the instructions themselves are larger (32bit vs 8-14bit).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>robodude666 on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5872</link>
			<pubDate>Wed, 03 Aug 2011 16:25:44 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">5872@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I made my comment under the personal experience that commenting out the lines in the Makefile related to including libraries caused the total compiled size to decrease -- this was observed before I made a thread asking what the output of the size meant.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5870</link>
			<pubDate>Wed, 03 Aug 2011 11:06:59 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">5870@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;poslathian:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
However, AFAIK the build system should NOT include all the libs by default in the final binary. The linker ostensibly only links in what is referenced. I will check with mbolivar and iperry to correct me if I am wrong.
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;that should indeed be the case.  we call gcc with -ffunction-sections, -fdata-sections, and the linker with --gc-sections, so unused pieces of libmaple should get pruned out
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5866</link>
			<pubDate>Wed, 03 Aug 2011 10:05:07 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">5866@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I recommend using integer or fixed point math whenever possible!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5865</link>
			<pubDate>Wed, 03 Aug 2011 10:04:48 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">5865@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Oh, also, using floats will automagically pull in the float libs necessary to do floating point math (since there is no hardware for it). That is probably the source of most of your program code above whats used by the USB stack. AVR's software floating point support is admittedly better than what we have for stm32.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5864</link>
			<pubDate>Wed, 03 Aug 2011 10:03:10 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">5864@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The only *big* fixed cost is the SerialUSB interface, which is compiled in by default and eats up 12KB. This seems like a waste, but as robodude points out, you have plenty of memory. Once you run out of memory, there are ways ways to be thrifty with program size. &#60;/p&#62;
&#60;p&#62;However, AFAIK the build system should NOT include all the libs by default in the final binary. The linker ostensibly only links in what is referenced. I will check with mbolivar and iperry to correct me if I am wrong.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ahunter10@gmail.com on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5857</link>
			<pubDate>Tue, 02 Aug 2011 19:32:11 +0000</pubDate>
			<dc:creator>ahunter10@gmail.com</dc:creator>
			<guid isPermaLink="false">5857@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;OK, that makes sense.  Sounds like the libraries will amount to a constant overhead, i.e. double the program length won't double the compiled size.  &#60;/p&#62;
&#60;p&#62;Thanks for the explanation. I should play around with libmaple.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>robodude666 on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5856</link>
			<pubDate>Tue, 02 Aug 2011 19:12:27 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">5856@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;When libmaple compiles your sketch, at least on libmaple -- not sure about the MapleIDE -- it includes all of the libraries which seems to inflate the codebase. If you are using libmaple, you can go into the Makefile and comment out the libraries you don't need.&#60;/p&#62;
&#60;p&#62;The 19k you're seeing also includes all of libmaple's lower-level c functionality and C++ wirish classes, allowing you to do a lot of things so don't be too sad to see it go. The Maple has 120kB+ FLASH space, so it may be shocking at first to see 19k being used compared to what you'd see on an Arduino.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ahunter10@gmail.com on "large code size?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=953#post-5855</link>
			<pubDate>Tue, 02 Aug 2011 18:53:57 +0000</pubDate>
			<dc:creator>ahunter10@gmail.com</dc:creator>
			<guid isPermaLink="false">5855@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I jut started playing around with the maple IDE, and I'm surprised how big the compiled code size is.  This program below, which is mostly just floating point arithmetic, compiles to over 19k.  This seems very large, and I'm wondering why.  On the arduino, for comparison, the same code complies to 3.8k.&#60;/p&#62;
&#60;p&#62;I'm on mac os x, with maple IDE 0.0.11. Here's the code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;#define N  3

float A[N][N];
float B[N][N];

void setup(){

  pinMode(D0, OUTPUT);

}

void loop(){

  populateMatrix((float*)A,N);

  digitalWrite(D0,HIGH);
  invertMatrix3x3((float*)A, (float*)B);
  digitalWrite(D0,LOW);

  delay(100);

}

int invertMatrix3x3(float *A, float *B){

	float det;

	B[0] = (A[4] * A[8]) - (A[5] * A[7]);
	B[1] = (A[2] * A[7]) - (A[1] * A[8]);
	B[2] = (A[1] * A[5]) - (A[2] * A[4]);
	B[3] = (A[5] * A[6]) - (A[3] * A[8]);
	B[4] = (A[0] * A[8]) - (A[2] * A[6]);
	B[5] = (A[2] * A[3]) - (A[0] * A[5]);
	B[6] = (A[3] * A[7]) - (A[4] * A[6]);
	B[7] = (A[6] * A[1]) - (A[0] * A[7]);
	B[8] = (A[0] * A[4]) - (A[1] * A[3]); 

        //calculate determinant, using some already calculated values
	det = (A[0] * B[0]) +  (A[1] * B[3]) + (A[2] * B[6]);

        //check if determinant==0
	if ( abs(det) &#38;lt; .0001 ){
		return 0;
	}

	det = 1.0/det;

	for (int i=0; i&#38;lt;3; i++){
		for (int j=0; j&#38;lt;3; j++){
			B[i*3+j] *= det;
		}
	}
	return 1;
}

void populateMatrix(float *A, int n){

  for (int i=0; i&#38;lt;n; i++){
    for (int j=0; j&#38;lt;n; j++){
      A[i*n+j] = (float)random(100) / (float)random(1,100);
    }
  }
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
