<?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: Where is the Maple startup code?</title>
		<link>http://forums.leaflabs.com/topic.php?id=1276</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:13:56 +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=1276" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7666</link>
			<pubDate>Sun, 15 Jan 2012 17:46:30 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7666@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;siy - thanks for cs3.h.&#60;br /&#62;
I downloaded a 214.5MB source archive, and it wasn't in there :-(
&#60;/p&#62;</description>
		</item>
		<item>
			<title>siy on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7664</link>
			<pubDate>Sun, 15 Jan 2012 14:59:03 +0000</pubDate>
			<dc:creator>siy</dc:creator>
			<guid isPermaLink="false">7664@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ah sorry, I've missed that you're using Mac OS X. I don't know where to download binary distribution for it.&#60;/p&#62;
&#60;p&#62;I was trying to say that STM32Fxx standard peripheral library is ugly and does not serve as abstraction layer.&#60;br /&#62;
(I often have problems expressing my thoughts so they are clear to other peoples. This happens even when I'm using one of my native languages. English makes things worse :) )&#60;/p&#62;
&#60;p&#62;P.S. Downloading 135Mb source archive for one 6Kb file is overkill, IMHO. Copies of this file are present in numerous places through Internet, for example here &#60;a href=&#34;http://code.google.com/p/plex-svn/source/browse/trunk/h103/cs3.h?r=407&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/p/plex-svn/source/browse/trunk/h103/cs3.h?r=407&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7663</link>
			<pubDate>Sun, 15 Jan 2012 14:35:47 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7663@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;siy&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;The cs3.h is a part of standard binary distribution which, I guess, you should have installed already.&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;AFAIK CodeSourcery/Mentor do not provide a standard binary distribution of Sourcery_G++_Lite for Mac OS X. Is there a place to retrieve one? I just install Maple, and it comes with a minimal gcc &#38;amp; binutils.&#60;/p&#62;
&#60;p&#62;Are you saying the STM32Fxx standard peripheral library is ugly, or provides a good abstraction layer?&#60;/p&#62;
&#60;p&#62;I have only looked at a few parts of the STM32F peripheral library.&#60;br /&#62;
I think it is pretty ugly.&#60;/p&#62;
&#60;p&#62;While the functions appear to provide a stable API across STM32F devices, there isn't much of an abstraction.&#60;br /&#62;
For example the GPIO functions take structs which appear to change depending on which STM32Fx device is used. So the family leaks out into the user code. Hence, IMHO, it provides very little abstraction.&#60;/p&#62;
&#60;p&#62;I dislike naming conventions which suffix type names with &#34;TypeDef&#34;, or &#34;Struct&#34;. The sort of modern IDE hardcore engineers use will tell you the definition of a name anyway. My era was initial capital for types/classes or  &#34;_t&#34;.  &#60;/p&#62;
&#60;p&#62;I like things that have sensible, working defaults, which require minimal code to get right.&#60;/p&#62;
&#60;p&#62;But, I think it might be practical to put a thin 'veneer' over those libraries to make them more approachable.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>siy on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7662</link>
			<pubDate>Sun, 15 Jan 2012 13:31:49 +0000</pubDate>
			<dc:creator>siy</dc:creator>
			<guid isPermaLink="false">7662@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The cs3.h is a part of standard binary distribution which, I guess, you should have installed already.&#60;/p&#62;
&#60;p&#62;P.S. The restoring knowledge is not a problem, but, as you have mentioned, some things moved on since I've used them last time, so my old knowledge does not always fit, so efforts necessary to adjustments. Unix tools are not problem for me too just because I had installed Windows on my PC only for about 6 months during last 20 years. From the other hand, I had feeling that this area of software development evolves together with remaining industry, but found that this is not the case. Of course there are some notable differences, but most things looked almost identical 10-15 years ago. Nothing comparable to changes, for example, in Java for last 10 years. Of course I know, that, in fact there are significant changes in &#34;big&#34; C++ software development, but this is not the case for embedded software, where C seems still dominates and C++ is used as &#34;C with classes&#34; at best. Moreover, even some pure C code looks...hmm... well, ugly, as if authors don't know meaning of words &#34;abstraction layer&#34; and how they related to libraries. Most notable example, probably, is STM32Fxx standard peripheral library.&#60;br /&#62;
As always, above is just my thoughts and they can be wrong...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7661</link>
			<pubDate>Sun, 15 Jan 2012 12:57:35 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7661@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Rod - my copy of  libmaple/support/ld/libcs3_stm32_src doesn't contain cs3.h, does yours?&#60;br /&#62;
I downloaded libmaple git repository today to check.&#60;br /&#62;
I assume siy's Sourcery_G++ path is likely correct, but I haven't checked yet.&#60;/p&#62;
&#60;p&#62;siy - I am downloading the source TAR for &#34;Sourcery G++ Lite 2011.03-41 for ARM GNU/Linux&#34; I guess that is the thing to start with&#60;/p&#62;
&#60;p&#62;I don't have much problem restoring old knowledge about &#34;standard&#34; C/C++ approaches and tools. I've continued using gcc, make, bison, flex, shell scripts, find, grep, ar, nm, strings etc. as well as Java, DTrace, Ruby, Erlang, Python etc. Having all of that at my fingertips is one of the reasons I use Mac OS X.&#60;/p&#62;
&#60;p&#62;The problem is some of the old technologies have moved on, and alternatives added, so techniques which work for me aren't always the way some people, who don't have those historical skills, do things. Its all adds to my learning experiences :-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rod on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7659</link>
			<pubDate>Sun, 15 Jan 2012 12:15:36 +0000</pubDate>
			<dc:creator>Rod</dc:creator>
			<guid isPermaLink="false">7659@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Try libmaple/support/ld/libcs3_stm32_src.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>siy on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7658</link>
			<pubDate>Sun, 15 Jan 2012 12:01:03 +0000</pubDate>
			<dc:creator>siy</dc:creator>
			<guid isPermaLink="false">7658@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I guess this is what you're looking for:&#60;br /&#62;
Sourcery_G++_Lite/arm-none-eabi/include/cs3.h&#60;/p&#62;
&#60;p&#62;i.e. it's a part of the toolchain, as I've mentioned above :)&#60;/p&#62;
&#60;p&#62;P.S. I've also switched to Java many years ago and often it requires some efforts to restore old knowledge and get used to (rather inconvenient after Java) C/C++ &#34;standard&#34; approaches and tools (makefiles often perceived as something from stone age after maven)...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7656</link>
			<pubDate>Sun, 15 Jan 2012 10:47:33 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7656@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I should have been clearer.&#60;br /&#62;
I am looking for the &#60;strong&#62;source&#60;/strong&#62; &#34;code which copies from flash to initialise the area of RAM occupied by the initialised variables&#34;.&#60;br /&#62;
I think I have found most of it.&#60;/p&#62;
&#60;p&#62;I believe the &#60;strong&#62;source&#60;/strong&#62; code which initialises the program variables (data and bss segment) is in start_c.c called by start.S.&#60;/p&#62;
&#60;p&#62;I looked in the linker include 'common.inc' where it identified __cs3_start_c.&#60;br /&#62;
The object code for __cs3_start_c appears in the two libraries libcs3_stm32_med_density.a and libcs3_stm32_high_density.a&#60;/p&#62;
&#60;p&#62;(Side Note: The way linkers used to work (maybe smarter now, so this may be wrong), the startup code had to be separate from libc.a so that the user's program could be linked with the startup code, and the user's code could *ALL* be &#34;linked&#34; before extracting anything from the libraries. Otherwise the user's program couldn't override/replace library functions, which, at least, would make it hard to write and test new versions of library functions. I haven't looked hard at linkers for more than 15 years (that's what Java, and VM based languages do to you:-), so this might be wrong, but, it did lead me to the code I was looking for :-)&#60;/p&#62;
&#60;p&#62;The source files, start.S and start_c.c, are in the libmaple git repository at libmaple/support/ld/libcs3_stm32_src&#60;br /&#62;
start_c.c is Copyright CodeSourcery, which maybe why it isn't in the Maple IDE download.&#60;/p&#62;
&#60;p&#62;BUT, I can't find the file cs3.h&#60;br /&#62;
Any ideas?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>siy on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7650</link>
			<pubDate>Sun, 15 Jan 2012 02:08:25 +0000</pubDate>
			<dc:creator>siy</dc:creator>
			<guid isPermaLink="false">7650@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;There are two parts of initialization code - libc runtime initialization (where variables copied from flash to RAM, in particular) and hardware initialization. The libc initialization is obviously part of libc (i.e. part of toolchain libraries). Hardware initialization can be found in boards.cpp in libmaple. Hope this helps.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Where is the Maple startup code?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1276#post-7645</link>
			<pubDate>Sat, 14 Jan 2012 19:53:04 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7645@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I've been looking through the Maple code. I can't find the startup code. This is the code that executes before main() is called, and hence before setup() and loop(). &#60;/p&#62;
&#60;p&#62;Where is it?&#60;/p&#62;
&#60;p&#62;I would normally expect some code which copies from flash to initialise the area of RAM occupied by the initialised variables, but I can't find that.&#60;/p&#62;
&#60;p&#62;I would hope it is in there somewhere because the executable program couldn't be installed using the USART or JTAG/SWD otherwise. &#60;/p&#62;
&#60;p&#62;Is it in the bootloader?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
