<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>LPC1768 hard fault when using a function pointer</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/39005/lpc1768-hard-fault-when-using-a-function-pointer</link><description> 
Hello, 

 
I am working with a LPC1768. I don&amp;#39;t have a lot of experience with
it yet, so I am stuck doing something that seems very simple - but I
cannot find the reason in the manual. 
I am calling a function via a function pointer. Why is it then</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: LPC1768 hard fault when using a function pointer</title><link>https://community.arm.com/thread/116077?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2010 06:04:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:657d1ecf-afcc-429d-baba-00cfcb60e838</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Marcus,&lt;/p&gt;

&lt;p&gt;
Thanks. I &lt;b&gt;FORGOT&lt;/b&gt; that CM3 will only operate at
&lt;b&gt;Thumb-2&lt;/b&gt;, so I used an even address...! In the mean time I
prepared an assembly work-around - no longer required. Thanks
again.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1768 hard fault when using a function pointer</title><link>https://community.arm.com/thread/104332?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2010 06:00:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:67f29eed-acc0-4299-a5a8-6c0670b88f58</guid><dc:creator>Marcus Harnisch</dc:creator><description>&lt;p&gt;&lt;p&gt;
How do you call these functions? Do you load the address
explicitly, or do you allow the linker to sort things out? If
explicitly, make sure the destination address is odd.&lt;/p&gt;

&lt;p&gt;
--&lt;br /&gt;
Marcus&lt;br /&gt;
&lt;a href="http://www.doulos.com/arm/"&gt;http://www.doulos.com/arm/&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1768 hard fault when using a function pointer</title><link>https://community.arm.com/thread/90676?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2010 05:37:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1dd20189-51c9-4219-9a52-b96003375e76</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Maybe I should further clarify: when I call a function via a
function pointer or branching to its address, the thumb bit in xPSR
is cleared, which is illegal. How can be avoid that? Function calls
that the compiler generates use BL.W, but I don&amp;#39;t think it is
related.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1768 hard fault when using a function pointer</title><link>https://community.arm.com/thread/58772?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2010 05:30:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0cfe23a3-d0fa-4c7e-be92-42282b93bc30</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
OK, I see that xPSR contains a clear 0 bit for the T field, will
is guaranteed to cause an exception.&lt;br /&gt;
Any ideas how that happened?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>