<?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>I get stuck in HardFault_Handler when calling os_mbx_send</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/39104/i-get-stuck-in-hardfault_handler-when-calling-os_mbx_send</link><description> 
I am trying to pass a message from one task to another and when I
call os_mbx_send I am getting a HardFault_Handler error. The call
stack has a lot of HAL_CM3 calls. Any ideas? Seems pretty straight
forward. Also, I followed instructions on setting</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: I get stuck in HardFault_Handler when calling os_mbx_send</title><link>https://community.arm.com/thread/139792?ContentTypeID=1</link><pubDate>Sat, 08 Jan 2011 07:42:51 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:44fdd5c7-b701-43b5-8030-c8f5af8cc541</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Just as well that I don&amp;#39;t smoke, then...!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I get stuck in HardFault_Handler when calling os_mbx_send</title><link>https://community.arm.com/thread/136360?ContentTypeID=1</link><pubDate>Sat, 08 Jan 2011 07:32:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1d5829f5-3cbb-4cb6-9cb5-c78e9f979aa5</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;The whole point of void* is that it&amp;#39;s compatible with
&lt;b&gt;anything!&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Close, but not quite worthy of a cigar.&lt;/p&gt;

&lt;p&gt;
void * is compatible with any &lt;b&gt;data pointer&lt;/b&gt;. You should
still get a warning if you mix it with integers and function
pointers, and an error if you mix it with floats or structs.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I get stuck in HardFault_Handler when calling os_mbx_send</title><link>https://community.arm.com/thread/126588?ContentTypeID=1</link><pubDate>Sat, 08 Jan 2011 05:13:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ca22d239-f92a-4386-8b98-2a25c56e6202</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
The whole point of &lt;b&gt;void*&lt;/b&gt; is that it&amp;#39;s compatible with
&lt;i&gt;&lt;b&gt;anything&lt;/b&gt;&lt;/i&gt;!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I get stuck in HardFault_Handler when calling os_mbx_send</title><link>https://community.arm.com/thread/116193?ContentTypeID=1</link><pubDate>Sat, 08 Jan 2011 05:02:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5b563dbc-68ec-42b0-943f-dce9f3c29bf8</guid><dc:creator>Ben Stickrod</dc:creator><description>&lt;p&gt;&lt;p&gt;
Unfortunatly Object_Message is not of type OS_ID, but OS_ID is
typedef void *, so I can see why that is happening.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I get stuck in HardFault_Handler when calling os_mbx_send</title><link>https://community.arm.com/thread/104499?ContentTypeID=1</link><pubDate>Sat, 08 Jan 2011 04:57:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:eda8c7dd-e15a-4262-ae00-c477bcae6ab0</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
The function prototype is:&lt;/p&gt;

&lt;pre&gt;
OS_RESULT os_mbx_send( OS_ID mailbox, void* message_ptr, U16   timeout );
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
&lt;a href="http://www.keil.com/support/man/docs/rlarm/rlarm_os_mbx_send.htm"&gt;http://www.keil.com/support/man/docs/rlarm/rlarm_os_mbx_send.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
So the only checks that the compiler can do are:&lt;br /&gt;
1. The first actual parameter has a type compatible with the type
&lt;b&gt;OS_ID&lt;/b&gt;;&lt;br /&gt;
2. The second actual parameter has a type compatible with the type
&lt;b&gt;void*&lt;/b&gt;;&lt;br /&gt;
3. The third actual parameter has a type compatible with the type
&lt;b&gt;U16&lt;/b&gt;.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I get stuck in HardFault_Handler when calling os_mbx_send</title><link>https://community.arm.com/thread/102380?ContentTypeID=1</link><pubDate>Sat, 08 Jan 2011 04:54:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f0076a03-091c-446f-b8fb-a762c282d5e7</guid><dc:creator>Ben Stickrod</dc:creator><description>&lt;p&gt;&lt;p&gt;
Depends on the implementation of the compiler, some are more
strict than others as to what types are automatically
promoted/cast/demoted. Some have configurable rules.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I get stuck in HardFault_Handler when calling os_mbx_send</title><link>https://community.arm.com/thread/90788?ContentTypeID=1</link><pubDate>Sat, 08 Jan 2011 04:50:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5c0e2227-0dbe-43f5-9e1c-53228bd5be8e</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
And why would it?&lt;/p&gt;

&lt;p&gt;
The compiler knows nothing about the &lt;i&gt;meaning&lt;/i&gt; of the
parameters - all it knows is whether the types are &amp;quot;compatible&amp;quot;
&lt;i&gt;within the rules of the &amp;#39;C&amp;#39; programming language&lt;/i&gt;...!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I get stuck in HardFault_Handler when calling os_mbx_send</title><link>https://community.arm.com/thread/59048?ContentTypeID=1</link><pubDate>Sat, 08 Jan 2011 04:43:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b7d02084-6527-4071-ade5-da77139089df</guid><dc:creator>Ben Stickrod</dc:creator><description>&lt;p&gt;&lt;p&gt;
D&amp;#39;Oh, parameter order is incorrect on os_mbx_send. Hmmm, compiler
was not warning.&lt;/p&gt;

&lt;p&gt;
Ben&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>