<?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>how to pass the structure value over ble</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69742/how-to-pass-the-structure-value-over-ble</link><description>hi , 
 I am working on the nRF52832 , I am trying to store the values in structure and then passing over BLE . I am getting this error after print statement unknown function of 0x00000A60 
 
 J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Dec 2020 15:28:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69742/how-to-pass-the-structure-value-over-ble" /><item><title>RE: how to pass the structure value over ble</title><link>https://devzone.nordicsemi.com/thread/286104?ContentTypeID=1</link><pubDate>Mon, 21 Dec 2020 15:28:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b62a4b0c-2c69-455e-b3d0-df5197ed1b8b</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I see a couple of issues here.&lt;/p&gt;
&lt;p&gt;First off none of the buffers are initialized to anything, which means that when you run strcat(a, data) for the first time you don&amp;#39;t know if the a array is zero terminated anywhere.&amp;nbsp;&lt;br /&gt;If it is not zero terminated the strcat function will iterate through memory indefinitely until it encounters a zero, which could take it outside the boundaries of the array.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To fix this it should be enough to initialize a[100] like this:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;char a[100] = {0};&lt;/p&gt;
&lt;p&gt;Another issue is that you convert 100 int values to strings, and try to store them all in a buffer that is only 100 characters long.&amp;nbsp;Depending on the size of the integers they could easily occupy more than one character each, which means the buffers won&amp;#39;t be&amp;nbsp;large enough (only the values 0-9 will fit in a single character after converting to a string).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am pretty sure the problem is that you start writing outside the boundaries of the arrays, which means you can corrupt other variables in memory, and even try to access memory outside the legal memory range.&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>