<?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>CPU reset during Debug</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84444/cpu-reset-during-debug</link><description>Hi, I testing the code using nrf5340DK kit written using nRF Connect SDK in SES. The CPU resets automatically, after few lines of code. The Output code and Task images are atached. 
 Gulzar Singh</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Feb 2022 11:59:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84444/cpu-reset-during-debug" /><item><title>RE: CPU reset during Debug</title><link>https://devzone.nordicsemi.com/thread/351513?ContentTypeID=1</link><pubDate>Mon, 07 Feb 2022 11:59:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08e31925-5153-4eb7-8f07-c14be1c4237c</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Gulzar&lt;/p&gt;
&lt;p&gt;It seems it is the call strcpy that is causing a memory fault, which implies that there is an issue with one of the buffers (esp_buffer1 or esp_buffer).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you let me know how these buffers are defined?&lt;/p&gt;
&lt;p&gt;Also, using strcpy is a bit risky unless you are sure that there is a terminating null character in the source string.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is better to use strncpy, so that you can define a maximum length of the copy operation, which should be set to the size of the destination string.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The memory bus fault could be caused by overrunning the destination buffer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>