<?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>Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75578/stack-overflow-after-gps-when-integrating-sms-and-pdu-libraries-based-on-asset-tracker-v2</link><description>Hello 
 
 
 
 I have this firmware running in C:\Users\danie\ncs\v1.5.1\nrf\applications\tracker on the nRF9160-DK, nRF9160 SICA B1 is the marking on the chip 
 Modem FW is 1.2.3: 
 
 
 
 See the attached log, it overflows every time there is a GPS lock</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Jun 2021 14:26:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75578/stack-overflow-after-gps-when-integrating-sms-and-pdu-libraries-based-on-asset-tracker-v2" /><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/313163?ContentTypeID=1</link><pubDate>Wed, 02 Jun 2021 14:26:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:612c9ff4-a3ce-49ec-b6a3-39cf88864bc7</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;As long as you do not need scanf for floats, you should be fine without the option.&lt;/p&gt;
&lt;p&gt;Though I am not sure what your best option would be if you need float support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/313093?ContentTypeID=1</link><pubDate>Wed, 02 Jun 2021 12:24:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4762f6bd-c2db-4498-9c9e-a31060771459</guid><dc:creator>Aidanv</dc:creator><description>&lt;p&gt;Hi Didrik. &lt;br /&gt;&lt;br /&gt;Thank you, it seems to be working on Dan&amp;#39;s side now (harder for me to test on this side due to my location).&lt;/p&gt;
&lt;p&gt;We initially were going to use scanf for the binary to hex conversion. I know that we did test without the&amp;nbsp;&lt;span&gt;CONFIG_NEWLIB_LIBC_FLOAT_SCANF&amp;nbsp;but it&amp;#39;s possible that there were issues with the build not being cleaned first or something.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What would we do if we did need to use scanf? Slightly concerning that such a simple change could cause such an obscure problem.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/312938?ContentTypeID=1</link><pubDate>Tue, 01 Jun 2021 14:54:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c51a312-bed2-4182-a92b-b27ad4a3bc26</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Yes, it looks like CONFIG_NEWLIB_LIBC_FLOAT_SCANF is the culprit.&lt;/p&gt;
&lt;p&gt;Why did you add it? It doesn&amp;#39;t look like you are using scanf in your project.&lt;/p&gt;
&lt;p&gt;If I remove the option, I am no longer able to reproduce the crash in your code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/312717?ContentTypeID=1</link><pubDate>Mon, 31 May 2021 19:31:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71463a1d-de45-4cd1-9871-debf0dc0ac53</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Quick update: I am able to reproduce the crash with just changes to prj.conf.&lt;/p&gt;
&lt;p&gt;My current suspect is CONFIG_NEWLIB_LIBC_FLOAT_SCANF, but I&amp;#39;ll keep working on this tomorrow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/312613?ContentTypeID=1</link><pubDate>Mon, 31 May 2021 11:01:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ffdbf83-a040-458f-a65a-83a77d2703f1</guid><dc:creator>Aidanv</dc:creator><description>&lt;p&gt;Thank you Didrik. That is correct. It&amp;nbsp; only occurs on GPS lock. &lt;br /&gt;If I recall correctly, even if we do not reference our added source code (sms and pdu) it still crashes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/312465?ContentTypeID=1</link><pubDate>Fri, 28 May 2021 16:55:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baf5b887-9e0b-4632-9bc0-403b9f92e4ac</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;I am able to reproduce the crash, though it seems to be dependent on the GPS. If the device doesn&amp;#39;t get GPS fixes, I don&amp;#39;t see the crashes.&lt;/p&gt;
&lt;p&gt;Other than that I haven&amp;#39;t been able to make much more progress in identifying the cause of the crash, but I will keep investigating.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/312189?ContentTypeID=1</link><pubDate>Thu, 27 May 2021 15:59:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efc3767b-a014-4f13-90f8-0c65a62789b2</guid><dc:creator>Aidanv</dc:creator><description>&lt;p&gt;Hi Didrik,&lt;/p&gt;
&lt;p&gt;I sent you the application in a private message.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Aidan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/312159?ContentTypeID=1</link><pubDate>Thu, 27 May 2021 14:35:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c66bcc7-0d45-4955-9137-c576e328b52e</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hello, and sorry for the late answer.&lt;/p&gt;
&lt;p&gt;Unfortunately, it doesn&amp;#39;t look like your application is attached to the ticket any longer.&lt;/p&gt;
&lt;p&gt;Could you re-upload it, or send it to me in a direct message, so I can take a look at it?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/311548?ContentTypeID=1</link><pubDate>Tue, 25 May 2021 14:53:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d66cbabd-94c3-4b16-be27-fb8dfbf844c2</guid><dc:creator>Aidanv</dc:creator><description>&lt;p&gt;Hi Didrik&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I&amp;#39;m working with Dan on this project. Thank you for assisting us with this issue.&lt;/p&gt;
&lt;p&gt;The problem is that we simply add SMS functionality and PDU decoding to the original Asset Tracker v2 example. This is causing stack overflows. The fact that every time Dan has increased the stack size has merely delayed the issue implies a deeper issue.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;It&amp;#39;s not clear how our code could cause this issue as the&amp;nbsp; functions we have added are not even called at this point (only when an SMS is received). The overflow occurs during normal out-of-the-box functionality of asset tracker v2.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;re new to Zephyr, and we&amp;#39;re just trying make what should be a simple modification to the example.&amp;nbsp;Please can you review the small amount of code that we&amp;#39;ve added to see if we have done something obviously wrong?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Aidan&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/311522?ContentTypeID=1</link><pubDate>Fri, 21 May 2021 21:09:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcd5c344-bd2e-4c20-ac90-9f5c2a0731a3</guid><dc:creator>danimalia</dc:creator><description>&lt;p&gt;Hi Didrik&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks, I increased the buffer size to 4096 - it helped, but still overflows; just takes longer now.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you could please test on your side - after a few GPS locks it always overflows. We did not add much code, only the SMS and PDU libraries. What do you suggest we make the buffer?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;br /&gt;Dan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/311521?ContentTypeID=1</link><pubDate>Fri, 21 May 2021 14:31:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f48f6636-ce04-4e59-812a-d1002c4f8595</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;I haven&amp;#39;t had time to test your application yet. Is there anything in paraticular you want me to try?&lt;/p&gt;
&lt;p&gt;The log shows that the stack overflow comes from the data_module thread.&lt;/p&gt;
&lt;p&gt;You can set it&amp;#39;s stack size with CONFIG_DATA_THREAD_STACK_SIZE. The default is 2048.&lt;/p&gt;
&lt;p&gt;The data_module also has a lot of other buffers. To see what options exists for controlling their sizes, you can take a look at asset_tracker_v2/src/modules/Kconfig.data_module.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/311520?ContentTypeID=1</link><pubDate>Thu, 20 May 2021 15:27:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3adce396-e394-4089-b790-d0b6fbb57f74</guid><dc:creator>danimalia</dc:creator><description>&lt;p&gt;Hi Didrik&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the reply. I added confid_thread_name=y to the prj.conf, see attached log.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, are you able to run the firmware I originally attached and verify the issue on your side?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Dan&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2021_2D00_05_2D00_20T15_5F00_23_5F00_00.914Z_2D00_log.txt"&gt;devzone.nordicsemi.com/.../2021_2D00_05_2D00_20T15_5F00_23_5F00_00.914Z_2D00_log.txt&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6175.prj.conf"&gt;devzone.nordicsemi.com/.../6175.prj.conf&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow after GPS when integrating SMS and PDU libraries (based on asset tracker v2)</title><link>https://devzone.nordicsemi.com/thread/311519?ContentTypeID=1</link><pubDate>Thu, 20 May 2021 14:41:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6895a950-fee8-4119-b0e1-a5a6556dd20c</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you know which thread the stack overflow comes from?&lt;/p&gt;
&lt;p&gt;Setting &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/CONFIG_THREAD_NAME.html#cmdoption-arg-CONFIG_THREAD_NAME"&gt;CONFIG_THREAD_NAME=y&lt;/a&gt; in your prj.conf might be a good place to start.&lt;/p&gt;
&lt;p&gt;If you are using SES, remember that you must re-open the project, or use &amp;#39;Project -&amp;gt; Run CMake...&amp;#39; for changes in your prj.conf to be included.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>