<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/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/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf5340 net core crashes when multiplying 2 uint16_t</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107301/nrf5340-net-core-crashes-when-multiplying-2-uint16_t</link><description>Hi all, 
 I&amp;#39;m currently trying to get Nimble controller running on the nrf53 net core. All seems fine except that the core is crashing when I multiply 2 uint16_t variables together. When I&amp;#39;m using uint32_t variables the core doesn&amp;#39;t crash. 
 Is there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Jan 2024 09:44:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107301/nrf5340-net-core-crashes-when-multiplying-2-uint16_t" /><item><title>RE: nrf5340 net core crashes when multiplying 2 uint16_t</title><link>https://devzone.nordicsemi.com/thread/464118?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2024 09:44:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66aefeb3-78c6-4cb3-b62e-a89d37795af4</guid><dc:creator>Jocelyn Masserot</dc:creator><description>&lt;p&gt;I found the issue, I was setting the option -mcpu to cortex-m33 while I should have used cortex-m33+nodsp.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 net core crashes when multiplying 2 uint16_t</title><link>https://devzone.nordicsemi.com/thread/464114?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2024 09:22:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:affe263e-9de9-4c12-8a4d-94ba3015dd55</guid><dc:creator>Jocelyn Masserot</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try to send a full project later today. In the meantime, I&amp;#39;ve been able to narrow down the investigation. It look like the &amp;quot;smulbb&amp;quot; assembly instruction is the one causing the crash. The following code is also crashing:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;__asm volatile 
(
	&amp;quot;ldr r0, =2\n&amp;quot;
	&amp;quot;ldr r1, =2\n&amp;quot;		
	&amp;quot;smulbb r2, r0, r1 \n&amp;quot;
);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Jocelyn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 net core crashes when multiplying 2 uint16_t</title><link>https://devzone.nordicsemi.com/thread/463992?ContentTypeID=1</link><pubDate>Fri, 12 Jan 2024 13:56:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d874252-2f78-45a5-9474-480e191fbf83</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please provide the full project for reproduction, not only parts of it.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 net core crashes when multiplying 2 uint16_t</title><link>https://devzone.nordicsemi.com/thread/463797?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2024 14:41:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0c4257a-0c3f-43d1-96bf-710b57765858</guid><dc:creator>Jocelyn Masserot</dc:creator><description>&lt;p&gt;Hi, thanks for your reply.&lt;br /&gt;&lt;br /&gt;The code is super simple. I can get the Network core to crash directly&amp;nbsp;from the reset handler:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;extern unsigned long _sidata;   /* start address for the initialization values of the .data section. defined in linker script */
extern unsigned long _sdata;    /* start address for the .data section. defined in linker script */
extern unsigned long _edata;    /* end address for the .data section. defined in linker script */
extern unsigned long _sbss;     /* start address for the .bss section. defined in linker script */
extern unsigned long _ebss;     /* end address for the .bss section. defined in linker script */
extern unsigned long _estack;

void Reset_Handler(void)
{
	unsigned long *src, *dest;
	
	src = &amp;amp;_sidata;
	
	for(dest = &amp;amp;_sdata; dest &amp;lt; &amp;amp;_edata; )
	{
		*(dest++) = *(src++);
	}
    
	for(dest = &amp;amp;_sbss; dest &amp;lt; &amp;amp;_ebss; )
	{
		*(dest++) = 0;
	}

	uint16_t temp = 2, temp2 = 4;
	temp = temp * temp2;

	main();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The core dump I&amp;#39;m getting:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;error   [FAULT]: [************* Hard fault *************]                                     
error   [FAULT]: r0 = 0x4                                                                     
error   [FAULT]: r1 = 0xffffffb8                                                              
error   [FAULT]: r2 = 0x1c                                                                    
error   [FAULT]: r3 = 0x0                                                                     
error   [FAULT]: r12 = 0x2                                                                    
error   [FAULT]: lr = 0x4                                                                     
error   [FAULT]: pc = 0x1016b4f                                                               
error   [FAULT]: psr = 0x1000c0b                                                              
error   [FAULT]: icsr = 0x803                                                                 
error   [FAULT]: bfar = 0xe000ed38                                                            
error   [FAULT]: cfsr = 0x10000                                                               
error   [FAULT]: hfsr = 0x40000000                                                            
error   [FAULT]: mmfar = 0xe000ed34                                                           
error   [FAULT]: sfsr = 0x0                                                                   
error   [FAULT]: sfar = 0x0                                                                   
error   [FAULT]: [**************************************]  &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The observation I made so far is that the variable alignment seems to be the culprit.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jocelyn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 net core crashes when multiplying 2 uint16_t</title><link>https://devzone.nordicsemi.com/thread/463784?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2024 14:21:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba4ebed7-e5f8-48f2-a7d1-4f5393831066</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you have a minimal example of this failing in a project? (That is, a full project, not only the two lines of code?) Also, do you have more details regarding the crash, such as any log, crash log, observations from a debug session, etc.?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>