<?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: [Handler HardFault] About downloading maple.bin with openocd(jlink)</title>
		<link>http://forums.leaflabs.com/topic.php?id=872</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:06:22 +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=872" rel="self" type="application/rss+xml" />

		<item>
			<title>librae8226 on "[Handler HardFault] About downloading maple.bin with openocd(jlink)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=872#post-5343</link>
			<pubDate>Sun, 19 Jun 2011 00:54:41 +0000</pubDate>
			<dc:creator>librae8226</dc:creator>
			<guid isPermaLink="false">5343@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@poslathian&#60;/p&#62;
&#60;p&#62;Yeah, I was careless of looking into the linker script.. :P&#60;/p&#62;
&#60;p&#62;Thanks a lot, carry on with your excellent products!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "[Handler HardFault] About downloading maple.bin with openocd(jlink)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=872#post-5342</link>
			<pubDate>Sat, 18 Jun 2011 18:21:50 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">5342@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;glad you solved your problem. Make JTAG will treat your code as totally first class and link it against the base address of 0x00, which means whatever goes into a make jtag binary gets located in memory right at 0x0. Whereas with make ram and make flash your binary will be offset by some amount, to leave room for the bootloader. The bootloader is then responsible for jumping out to this offset.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>librae8226 on "[Handler HardFault] About downloading maple.bin with openocd(jlink)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=872#post-5338</link>
			<pubDate>Sat, 18 Jun 2011 07:57:08 +0000</pubDate>
			<dc:creator>librae8226</dc:creator>
			<guid isPermaLink="false">5338@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Solved.&#60;/p&#62;
&#60;p&#62;For building target, it should be:&#60;br /&#62;
$ make jtag
&#60;/p&#62;</description>
		</item>
		<item>
			<title>librae8226 on "[Handler HardFault] About downloading maple.bin with openocd(jlink)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=872#post-5337</link>
			<pubDate>Sat, 18 Jun 2011 02:11:03 +0000</pubDate>
			<dc:creator>librae8226</dc:creator>
			<guid isPermaLink="false">5337@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I tried to download flash step by step with openocd:&#60;/p&#62;
&#60;p&#62;========================================================================&#60;br /&#62;
&#38;gt; init&#60;br /&#62;
&#38;gt; targets&#60;br /&#62;
    TargetName         Type       Endian TapName            State&#60;br /&#62;
--  ------------------ ---------- ------ ------------------ ------------&#60;br /&#62;
 0* stm32.cpu          cortex_m3  little stm32.cpu          running&#60;br /&#62;
&#38;gt; reset halt&#60;br /&#62;
JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)&#60;br /&#62;
JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)&#60;br /&#62;
target state: halted&#60;br /&#62;
target halted due to debug-request, current mode: Thread&#60;br /&#62;
xPSR: 0x01000000 pc: 0x080000d4 msp: 0x20000100&#60;br /&#62;
&#38;gt; flash erase_address 0x08000000 0x20000&#60;br /&#62;
erased address 0x08000000 (length 131072) in 0.038003s (3368.155 kb/s)&#60;br /&#62;
&#38;gt; flash write_image maple.bin 0x08000000 bin&#60;br /&#62;
not enough working area available(requested 16384, free 16336)&#60;br /&#62;
wrote 13136 bytes from file maple.bin in 1.157949s (11.078 kb/s)&#60;br /&#62;
&#38;gt; verify_image maple.bin 0x08000000 bin&#60;br /&#62;
verified 13136 bytes in 0.528980s (24.251 kb/s)&#60;br /&#62;
&#38;gt; reset halt&#60;br /&#62;
JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)&#60;br /&#62;
JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)&#60;br /&#62;
target state: halted&#60;br /&#62;
target halted due to debug-request, current mode: Thread&#60;br /&#62;
xPSR: 0x01000000 pc: 0x08007844 msp: 0x20005000&#60;br /&#62;
&#38;gt; resume&#60;br /&#62;
stm32.cpu -- clearing lockup after double fault&#60;br /&#62;
target state: halted&#60;br /&#62;
target halted due to debug-request, current mode: Handler HardFault&#60;br /&#62;
xPSR: 0x01000003 pc: 0x08007064 msp: 0x20004fe0&#60;br /&#62;
&#38;gt; &#60;/p&#62;
&#60;p&#62;------------------------------------------------------------------------&#60;/p&#62;
&#60;p&#62;in maple.map:&#60;/p&#62;
&#60;p&#62;.text	0x08007060	0x60	build/./libmaple/exc.o&#60;br /&#62;
		0x08007060				__exc_nmi&#60;br /&#62;
		0x08007064				__exc_hardfault&#60;br /&#62;
		0x08007068				__exc_memmanage&#60;br /&#62;
		0x0800706c				__exc_busfault&#60;br /&#62;
		0x08007070				__exc_usagefault&#60;/p&#62;
&#60;p&#62;		...&#60;/p&#62;
&#60;p&#62;.text	0x08007844	0x10	./support/ld/libcs3_stm32_med_density.a(start.o)&#60;br /&#62;
		0x08007844				_start&#60;br /&#62;
.text	0x08007854	0x108	./support/ld/libcs3_stm32_med_density.a(start_c.o)&#60;br /&#62;
		0x08007854				__cs3_start_c&#60;br /&#62;
========================================================================&#60;/p&#62;
&#60;p&#62;    According to above information, I find that after &#34;flash write_image&#34; &#38;amp; &#34;verify_image&#34;, &#34;reset halt&#34;, the &#34;pc: 0x08007844&#34; is no problem, exactly the &#34;_start&#34; entry point.&#60;br /&#62;
    But just after that I try &#34;resume&#34; or &#34;reset run&#34;, it went into HardFault straight forward.&#60;/p&#62;
&#60;p&#62;    ????
&#60;/p&#62;</description>
		</item>
		<item>
			<title>librae8226 on "[Handler HardFault] About downloading maple.bin with openocd(jlink)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=872#post-5336</link>
			<pubDate>Sat, 18 Jun 2011 00:03:15 +0000</pubDate>
			<dc:creator>librae8226</dc:creator>
			<guid isPermaLink="false">5336@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi, I am attracted by the architecture of libmaple, so planning to try it on my board (stm32f103rbt6). However, it comes up with a Handler HardFault while downloading use openocd.&#60;br /&#62;
    Here is my steps:&#60;br /&#62;
--------------------------------------------------&#60;br /&#62;
$ git clone git://github.com/leaflabs/libmaple.git&#60;br /&#62;
$ cd libmaple&#60;br /&#62;
$ cp main.cpp.example main.cpp&#60;br /&#62;
$ make flash&#60;br /&#62;
--------------------------------------------------&#60;/p&#62;
&#60;p&#62;Because I am using jlink, then I modified support/openocd/flash_0.4.cfg as:&#60;br /&#62;
$ git diff&#60;br /&#62;
diff --git a/support/openocd/flash_0.4.cfg b/support/openocd/flash_0.4.cfg&#60;br /&#62;
index 32c06c6..d99c48c 100644&#60;br /&#62;
--- a/support/openocd/flash_0.4.cfg&#60;br /&#62;
+++ b/support/openocd/flash_0.4.cfg&#60;br /&#62;
@@ -1,9 +1,10 @@&#60;br /&#62;
 # script for stm32&#60;/p&#62;
&#60;p&#62;-interface ft2232&#60;br /&#62;
-ft2232_device_desc &#34;Olimex OpenOCD JTAG&#34;&#60;br /&#62;
-ft2232_layout olimex-jtag&#60;br /&#62;
-ft2232_vid_pid 0x15ba 0x0003&#60;br /&#62;
+interface jlink&#60;br /&#62;
+#interface ft2232&#60;br /&#62;
+#ft2232_device_desc &#34;Olimex OpenOCD JTAG&#34;&#60;br /&#62;
+#ft2232_layout olimex-jtag&#60;br /&#62;
+#ft2232_vid_pid 0x15ba 0x0003&#60;/p&#62;
&#60;p&#62;After that, do&#60;br /&#62;
$ openocd -f support/openocd/flash_0.4.cfg&#60;/p&#62;
&#60;p&#62;Results below is printed&#60;br /&#62;
------------------------&#60;br /&#62;
Open On-Chip Debugger 0.4.0 (2011-02-09-04:28)&#60;br /&#62;
Licensed under GNU GPL v2&#60;br /&#62;
For bug reports, read&#60;br /&#62;
	&#60;a href=&#34;http://openocd.berlios.de/doc/doxygen/bugs.html&#34; rel=&#34;nofollow&#34;&#62;http://openocd.berlios.de/doc/doxygen/bugs.html&#60;/a&#62;&#60;br /&#62;
1000 kHz&#60;br /&#62;
jtag_nsrst_delay: 100&#60;br /&#62;
jtag_ntrst_delay: 100&#60;br /&#62;
srst_only separate srst_gates_jtag srst_open_drain&#60;br /&#62;
Info : J-Link initialization started / target CPU reset initiated&#60;br /&#62;
Info : J-Link ARM V7 compiled Jun 30 2009 11:05:27&#60;br /&#62;
Info : JLink caps 0xb9ff7bbf&#60;br /&#62;
Info : JLink hw version 70000&#60;br /&#62;
Info : JLink max mem block 9152&#60;br /&#62;
Info : Vref = 3.377 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0&#60;/p&#62;
&#60;p&#62;Info : J-Link JTAG Interface ready&#60;br /&#62;
Info : clock speed 1000 kHz&#60;br /&#62;
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)&#60;br /&#62;
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)&#60;br /&#62;
Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints&#60;br /&#62;
Warn : stm32.cpu -- clearing lockup after double fault&#60;br /&#62;
Halting...&#60;br /&#62;
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)&#60;br /&#62;
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)&#60;br /&#62;
target state: halted&#60;br /&#62;
target halted due to debug-request, current mode: Thread&#60;br /&#62;
xPSR: 0x01000000 pc: 0x08007844 msp: 0x20005000&#60;br /&#62;
Unlocking flash...&#60;br /&#62;
Info : device id = 0x20036410&#60;br /&#62;
Info : flash size = 128kbytes&#60;br /&#62;
cleared protection for sectors 0 through 127 on flash bank 0&#60;br /&#62;
Erasing...&#60;br /&#62;
erased address 0x08000000 (length 131072) in 0.040999s (3122.027 kb/s)&#60;br /&#62;
Flashing image...&#60;br /&#62;
wrote 13136 bytes from file build/maple.bin to flash bank 0 at offset 0x00000000 in 0.924966s (13.869 kb/s)&#60;br /&#62;
Verifying image...&#60;br /&#62;
verified 13136 bytes in 0.529968s (24.205 kb/s)&#60;br /&#62;
Checksum verified, resetting chip&#60;br /&#62;
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)&#60;br /&#62;
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)&#60;br /&#62;
Warn : stm32.cpu -- clearing lockup after double fault&#60;br /&#62;
target state: halted&#60;br /&#62;
target halted due to debug-request, current mode: Handler HardFault&#60;br /&#62;
xPSR: 0x01000003 pc: 0x08007064 msp: 0x20004fe0&#60;br /&#62;
Daemon shutdown&#60;br /&#62;
shutdown command invoked&#60;br /&#62;
------------------------&#60;/p&#62;
&#60;p&#62;So, I don't know what on earth resulted in this. Something wrong about using openocd? Or linkerscripts? Need maple-bootloader? Any ideas?&#60;/p&#62;
&#60;p&#62;Thanks a lot.&#60;br /&#62;
Support your excellent works as before. :P
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
