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

		<item>
			<title>go61t on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21364</link>
			<pubDate>Fri, 30 Nov 2012 10:55:53 +0000</pubDate>
			<dc:creator>go61t</dc:creator>
			<guid isPermaLink="false">21364@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks vor Your post!&#60;/p&#62;
&#60;p&#62;RAM / flash&#60;br /&#62;
 I did mentioned in the opening Post saying. (I could have flash used... )&#60;br /&#62;
 What implies that i know the behaviour of flash it. It's working.&#60;br /&#62;
Sorry for Not making me clear, but i intended to ask for  the size.&#60;br /&#62;
 If You think it's Not Too big i proceed. I just thought that two&#60;br /&#62;
objects and two Lines couldn't make the difference. Cheers&#60;br /&#62;
I' ll Swap to maple native maybe.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21346</link>
			<pubDate>Thu, 29 Nov 2012 19:06:21 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">21346@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;go61t - I asked &#60;em&#62;&#34;this may be a silly question, but are compiling and loading the program into Flash or RAM?&#34;&#60;/em&#62;&#60;/p&#62;
&#60;p&#62;you replied &#60;em&#62;&#34;hi gbulmer - as posted I tried both ...&#34;&#60;/em&#62;&#60;br /&#62;
Where did you say that? I've reread your post, and can't find an explanation about which you tried.&#60;/p&#62;
&#60;p&#62;You went on to say &#60;em&#62;&#34;...  and had problems in case i use the RAM solely. (20kb)&#34;&#60;/em&#62;&#60;br /&#62;
So when you compile and load the program and all of its data into RAM, it exceeds RAM?&#60;/p&#62;
&#60;p&#62;Then compile and load the program into Flash. &#60;/p&#62;
&#60;p&#62;An Arduino runs the original SdFat library in 32kB Flash and 2kB of RAM. If you try to load the entire thing into 20kB RAM, along with the Maples USB libraries and buffers, plus the RAM used by the Maple bootloader, it might overflow RAM. No surprises, that's not unreasonable.&#60;/p&#62;
&#60;p&#62;&#60;em&#62;&#34;the question remains. why is the script that big!&#60;/em&#62;&#60;br /&#62;
BECAUSE YOU ARE LOADING BOTH THE PROGRAM AND DATA INTO RAM?&#60;/p&#62;
&#60;p&#62;The boot environment only uses a couple of kB of RAM, so there should be plenty if you compile and load the code into Flash.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>go61t on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21342</link>
			<pubDate>Thu, 29 Nov 2012 18:14:59 +0000</pubDate>
			<dc:creator>go61t</dc:creator>
			<guid isPermaLink="false">21342@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;i did not find a way to shrink the amount of compiled code when using the SD card functionallity; what is your experience with the size. the sd file object has a size of 4kb but the behaviour is strange. while instancing another object the size is not increasing, even if the rest of the code is reduced to almost zero! when using the rest of the code it goes up to 30kb; only 7kb are free in SRAM as the boot environment already takes round 12kb &#60;/p&#62;
&#60;p&#62;Does anybody know a way to extend ram as a solution?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>go61t on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21337</link>
			<pubDate>Thu, 29 Nov 2012 08:24:18 +0000</pubDate>
			<dc:creator>go61t</dc:creator>
			<guid isPermaLink="false">21337@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;looks good on your side. i guess you have the flash enabled for your compiled code as target.&#60;br /&#62;
otherwise there should be the message (storage... reported above...) as the 20kb of the SRAM is exhausted also as in my case.&#60;/p&#62;
&#60;p&#62;&#38;gt;&#38;gt;Total 22376&#38;lt;&#38;lt; &#60;/p&#62;
&#60;p&#62;the question remains. why is the script that big!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bubulindo on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21335</link>
			<pubDate>Thu, 29 Nov 2012 07:32:59 +0000</pubDate>
			<dc:creator>bubulindo</dc:creator>
			<guid isPermaLink="false">21335@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello, &#60;/p&#62;
&#60;p&#62;I copied and pasted the script into the maple IDE and it compiled. :\ Mind you though that I don't have the last SDFat library, or the DMA enabled version either.&#60;br /&#62;
Have you tried different versions of the library?&#60;/p&#62;
&#60;p&#62;I got this back from the compiler:&#60;/p&#62;
&#60;p&#62;Compiling the sketch...&#60;br /&#62;
	Linking...&#60;br /&#62;
	Computing sketch size...&#60;/p&#62;
&#60;p&#62;/var/folders/b2/b2Qxxb0JHpulgWmJOPT3vU+++TI/-Tmp-/build8926750940236191491.tmp/sketch_nov29a.cpp.bin  :&#60;br /&#62;
section    size   addr&#60;br /&#62;
.data   22376      0&#60;br /&#62;
Total   22376
&#60;/p&#62;</description>
		</item>
		<item>
			<title>go61t on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21334</link>
			<pubDate>Thu, 29 Nov 2012 07:21:07 +0000</pubDate>
			<dc:creator>go61t</dc:creator>
			<guid isPermaLink="false">21334@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hi gbulmer - as posted I tried both and had problems in case i use the RAM solely. (20kb)&#60;br /&#62;
The thing is that I want to know why so much storage is used in case of the above script covering the SD card fuctionality.&#60;br /&#62;
If I add realtime functionaliy I truely get more problems, that might fast exceed the flash as well. (128kB) &#60;/p&#62;
&#60;p&#62;I could not imagine that others have less code involved in their projects...&#60;/p&#62;
&#60;p&#62;Thank you
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21324</link>
			<pubDate>Wed, 28 Nov 2012 19:43:40 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">21324@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;go61t - this may be a silly question, but are compiling and loading the program into Flash or RAM?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>go61t on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21320</link>
			<pubDate>Wed, 28 Nov 2012 17:38:04 +0000</pubDate>
			<dc:creator>go61t</dc:creator>
			<guid isPermaLink="false">21320@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi there,&#60;/p&#62;
&#60;p&#62;i got a code working on the STM32 Olimexino using sd card functionality on an example way. (file open, write....)&#60;/p&#62;
&#60;p&#62;I also made changes in .h according to some older posts that were really hard to find the propper settings revealing too much confusing stuff also. eventually i got it working just by hardcoding the 31 to 25 issue.&#60;/p&#62;
&#60;p&#62;I could then write to the SD card..&#60;/p&#62;
&#60;p&#62;The really hard thing i encouterred with this script, and that´s what i wanted to talk about here, is that i have severe SRAM problems. (error message like: '...region ram overflowed by...' '...reported above...')&#60;/p&#62;
&#60;p&#62;the script is very small; I know that i could have flash used for the .text based files (whatever part that might be) but i do not understand why the size is that big and do not want to exegerate or exhaust the timley constricted falsh ram.&#60;/p&#62;
&#60;p&#62;could anybode explain why the compiled file is too big and how to maybe shrink it.&#60;/p&#62;
&#60;p&#62;thank you; go61t&#60;/p&#62;
&#60;p&#62;here is the code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;#include &#38;lt;SdFat.h&#38;gt;
#include &#38;lt;HardwareSPI.h&#38;gt;
#include &#38;lt;stdint.h&#38;gt;

HardwareSPI spi(2);
Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;

void setup()
{
  SerialUSB.begin();
  spi.begin(SPI_281_250KHZ, MSBFIRST, 0);
  SerialUSB.println(&#38;quot;type any char to start&#38;quot;);
  while (!SerialUSB.available());
  SerialUSB.println();

  if (!card.init(&#38;amp;spi))
    SerialUSB.println(&#38;quot;card.init failed&#38;quot;);
  else
    SerialUSB.println(&#38;quot;card.init passed&#38;quot;);
//  spi.end();

//  spi.begin(SPI_1_125MHZ, MSBFIRST, 0);

  delay(100);

  // initialize a FAT volume
  if (!volume.init(&#38;amp;card))
    SerialUSB.println(&#38;quot;volume.init failed&#38;quot;);
  else
    SerialUSB.println(&#38;quot;volume.init passed&#38;quot;);

  // open the root directory
  if (!root.openRoot(&#38;amp;volume))
    SerialUSB.println(&#38;quot;openRoot failed&#38;quot;);
  else
    SerialUSB.println(&#38;quot;openRoot passed&#38;quot;);

    /*file.createContiguous(&#38;amp;root, &#38;quot;TEXTFILE.TXT&#38;quot;, 100);
    */file.ls(LS_SIZE, 1);
    /*
    // open a file
  if (file.open(&#38;amp;root, &#38;quot;output2.csv&#38;quot;, O_READ))
  {
    SerialUSB.println(&#38;quot;Opened PRINT00.TXT&#38;quot;);
  }
  else if (file.open(&#38;amp;root, &#38;quot;WRITE00.TXT&#38;quot;, O_READ))
  {
    SerialUSB.println(&#38;quot;Opened WRITE00.TXT&#38;quot;);
  }
  else
  {
    SerialUSB.println(&#38;quot;file.open failed&#38;quot;);
  }*/
  SerialUSB.println();
  /*
  int16_t n;
  uint8_t buf[7];// nothing special about 7, just a lucky number.
  while ((n = file.read(buf, sizeof(buf))) &#38;gt; 0)
  {
    for (uint8_t i = 0; i &#38;lt; n; i++)
      SerialUSB.print(buf[i]);
  }*/
  /* easier way
  int16_t c;
  while ((c = file.read()) &#38;gt; 0) Serial.print((char)c);
  */
  SerialUSB.println(&#38;quot;\nDone&#38;quot;);
  spi.end();

}

void loop()
{
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>higwoshy on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21147</link>
			<pubDate>Sun, 18 Nov 2012 16:05:14 +0000</pubDate>
			<dc:creator>higwoshy</dc:creator>
			<guid isPermaLink="false">21147@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;So, playing around with the newer maplesdfat, I've made a very quick hack which will enable some (maybe all?) of the arduino examples to work on the maple with only 1 or 2 modifications.&#60;/p&#62;
&#60;p&#62;@everyone who codes pro or semi-pro or teaches : you are not going to like this hack, but it's better than staring at a page of nonsensical errors.&#60;/p&#62;
&#60;p&#62;First, add a file called MapleHack.h to the sdfat library (you've installed it so you should know where it is) and paste in the following 'code' :-&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;// BEGIN MASSIVE ARDUINO to MAPLE HACK

#include &#38;lt;string.h&#38;gt;		// needed for strcpy

#define Serial SerialUSB
#define SPI_HALF_SPEED &#38;amp;spi  // Replace line &#38;quot;init.card(SPI_HALF_SPEED)&#38;quot; with line &#38;quot;init.card(&#38;amp;spi)&#38;quot;
#define PSTR (const char*)
#define strcpy_P (strcpy)

#define PgmPrint(x) SerialPrint_P(PSTR(x))
#define PgmPrintln(x) SerialPrintln_P(PSTR(x))
#define NOINLINE __attribute__((noinline))

#include &#38;lt;HardwareSPI.h&#38;gt;

HardwareSPI spi( 1 );           // Change this to 2 if your SD card is on SPI2

#include &#38;lt;WProgram.h&#38;gt;
static NOINLINE void SerialPrint_P(const char *str) {
	SerialUSB.print(str);
}
static NOINLINE void SerialPrintln_P(const char *str) {
	SerialUSB.println(str);
}
static int FreeRam(void) {
	return (20);		// NOPE!
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Save it and forget all about it. PLEASE Don't use it in your own code!&#60;/p&#62;
&#60;p&#62;For each arduino examples your interested in playing around with  (and ONLY for these examples) replace&#60;br /&#62;
        &#60;code&#62;#include &#38;lt;fatutils.h&#38;gt;&#60;/code&#62;&#60;br /&#62;
with &#60;code&#62;#include &#38;lt;MapleHack.h&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Then replace &#60;code&#62;serial.begin(9600)&#60;/code&#62; which isn't needed on the Maple with&#60;br /&#62;
&#60;code&#62;spi.begin(SPI_4_5MHZ, MSBFIRST, 0);      // Start the SPI at the given speed&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;It's confirmed to work with sdfatls, sdfatinfo, sdfatappend, sdfatcopy  though you might have to remove a &#60;code&#62;serial.flush()&#60;/code&#62; from the code as Maple doesn't do that.&#60;/p&#62;
&#60;p&#62;If your using a Olimexino with built in sdcard, change the spi in the code above to 2 and either change the maple.h file found in the depths of the maple core and change the line&#60;br /&#62;
 &#60;code&#62;#define BOARD_SPI2_NSS_PIN&#60;/code&#62;	25	// oli is 25, maple is 31&#60;br /&#62;
OR if your feeling lazy, wire pins 25 and pin 31 together.&#60;/p&#62;
&#60;p&#62;Note also that in all these examples, the setup() waits for a character from serialusb before proceeding, so don't forget to type any key and hit 'send'.&#60;/p&#62;
&#60;p&#62;Hopefully this'll be useful for someone who wants to use the Maple to 'make stuff' without getting too bogged down in details of sd card programming.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>higwoshy on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21142</link>
			<pubDate>Sun, 18 Nov 2012 10:24:48 +0000</pubDate>
			<dc:creator>higwoshy</dc:creator>
			<guid isPermaLink="false">21142@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@everyone I think the problem for new users is that there is no warning anywhere to tell them that all the examples that come with the sd library do not work on the Maple and will never work because they use Arduino specific code (IIRC pointers and PROGMEM). Obviously they work with a bit of tweaking to the Maple. It's not a big problem, just time consuming for the number of examples. The only one that works is filesys.&#60;/p&#62;
&#60;p&#62;I think a simple, but obvious, readme which states this problem would be a simple fix. The first thing most new users are going to do are run the examples, rather than look at the docs and write their own code. Or just put an &#60;code&#62;#error These files won&#38;#39;t compile on Maple without modifications&#60;/code&#62; on each example file.&#60;/p&#62;
&#60;p&#62;I know I went through about 4 or 5 of the examples changing them for the Maple (Olimexino), but it wasn't a pretty fix.&#60;/p&#62;
&#60;p&#62;BTW The Olimexino uses pin 25 for chip select on port 2, not 31. Will there be an easy way to change this? I've noticed that the new Arduino spi library allows you to specify the nss pin i.e. spi.begin(25). &#60;/p&#62;
&#60;p&#62;A quick fix is just to run a wire from pin 25 to pin 31. Not ideal.&#60;/p&#62;
&#60;p&#62;While I'm here @feurig, the FileSys example as supplied doesn't work, there are two spi.begin() in it? Why? Surely just the one begin should work. If you need someone to test your new libraries I can do this. Also I have a SdMapleRTC.h that uses the maples real time clock for timestamps if needed.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bubulindo on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043&amp;page=2#post-21121</link>
			<pubDate>Sat, 17 Nov 2012 01:30:15 +0000</pubDate>
			<dc:creator>bubulindo</dc:creator>
			<guid isPermaLink="false">21121@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;If you read my replies above, you'll see the reply to your question... which, is the same that Joseph had.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>cmartin on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043#post-21120</link>
			<pubDate>Sat, 17 Nov 2012 00:12:52 +0000</pubDate>
			<dc:creator>cmartin</dc:creator>
			<guid isPermaLink="false">21120@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I know this is an old thread, but it seems to be the most recent on this particular issue.&#60;/p&#62;
&#60;p&#62;I've downloaded the latest version of the SdFat library and it doesn't seem to work &#34;out of the box.&#34; The problem comes when I try to compile any of the examples and I get &#34;not declared in this scope&#34; errors for PSTR, SerialPrint_P and others.&#60;/p&#62;
&#60;p&#62;PSTR and SerialPrint_P (anything ending in '_P') is specific to an AVR processor and is used to access data in flash (P as in Program) memory.  Flash memory on the AVR is a separate address space from RAM so special instructions are needed to access it.  An ARM processor doesn't need any special handling for this as Flash memory is in the same address space as RAM.&#60;/p&#62;
&#60;p&#62;It looks like this library was brought over from Arduino without making any changes for ARM.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Joseph86 on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043#post-21117</link>
			<pubDate>Fri, 16 Nov 2012 16:13:33 +0000</pubDate>
			<dc:creator>Joseph86</dc:creator>
			<guid isPermaLink="false">21117@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I've successfully compiled and run the FilySys.pde example. All I had to do for the Olimex board was change the &#34;HardwareSPI spi(1) declaration to &#34;spi(2).&#34; &#60;/p&#62;
&#60;p&#62;I guess I got needlessly caught up in the apparently unrelated compile errors in the other examples. Now I can get back to work.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bubulindo on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043#post-21115</link>
			<pubDate>Fri, 16 Nov 2012 15:26:39 +0000</pubDate>
			<dc:creator>bubulindo</dc:creator>
			<guid isPermaLink="false">21115@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hmmm... I compiled the FileSys.pde that sits in the examples/filesys folder. :S &#60;/p&#62;
&#60;p&#62;I seem to remember that I did have problems compiling the Arduino examples... but can't remember exactly what the problem was back then.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Joseph86 on "Idiot guide to using SD card on Olimexino - STM32 Maple clone"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2043#post-21114</link>
			<pubDate>Fri, 16 Nov 2012 15:17:07 +0000</pubDate>
			<dc:creator>Joseph86</dc:creator>
			<guid isPermaLink="false">21114@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I just tried to compile the SdFatMakeDir example. &#60;/p&#62;
&#60;p&#62;I'm not sure what example you're talking about that says to just import SDFat.h. &#60;/p&#62;
&#60;p&#62;Could it be my errors are purely related to libraries for error handling used in the examples, and not from the sdfat library itself? In other words, the sdfat stuff works fine, and I just need to start using it rather than fiddling with the examples?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
