<?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>AWS IoT example getting RSRP results in HARD FAULT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66490/aws-iot-example-getting-rsrp-results-in-hard-fault</link><description>In the AWS IoT example I have been trying to add RSRP support (i.e. getting RSRP when sending my data packet). 
 I registered the handler/callback function in main after modem_info_init() like modem_info_rsrp_register(rsrp_handler); where 
 
 And I just</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Sep 2020 12:07:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66490/aws-iot-example-getting-rsrp-results-in-hard-fault" /><item><title>RE: AWS IoT example getting RSRP results in HARD FAULT</title><link>https://devzone.nordicsemi.com/thread/272290?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 12:07:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cca5fb83-f05f-4299-a2ce-9cd2401503c3</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;It is also now fixed in NCS master:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/2999"&gt;https://github.com/nrfconnect/sdk-nrf/pull/2999&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS IoT example getting RSRP results in HARD FAULT</title><link>https://devzone.nordicsemi.com/thread/272180?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 07:15:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b30eecfa-b4d1-4039-9afb-73def8206fdd</guid><dc:creator>Elith</dc:creator><description>&lt;p&gt;Perfect, thank you very much. I just found out myself that the problem was the sys_rand32_get().&lt;/p&gt;
&lt;p&gt;Also a great tip with the sched_lock() functionality - that will be useful for other things I imagine &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS IoT example getting RSRP results in HARD FAULT</title><link>https://devzone.nordicsemi.com/thread/272175?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 06:55:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0200cae-6357-4c18-a0b1-4a81d77e1a95</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Daniel,&lt;br /&gt;&lt;br /&gt;Please try to change&amp;nbsp;&lt;em&gt;sys_rand32_get()&lt;/em&gt; to&amp;nbsp;&lt;em&gt;k_uptime_get_32()&amp;nbsp;&lt;/em&gt;in&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/master/subsys/net/lib/aws_iot/src/aws_iot.c#L920"&gt; this line&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Another option is to run&amp;nbsp;&lt;em&gt;k_sched_lock(), k_sched_unlock()&amp;nbsp;&lt;/em&gt;around&amp;nbsp;&lt;em&gt;aws_iot_send(), &lt;/em&gt;but I recommend the first suggestion&lt;em&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/60850/nrf9160-secure-services-causing-a-crash" rel="noopener noreferrer" target="_blank"&gt;Similar issue has been reported earlier as well)&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS IoT example getting RSRP results in HARD FAULT</title><link>https://devzone.nordicsemi.com/thread/272174?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 06:43:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:865f11e8-c4e4-448b-828f-d6430a1ba603</guid><dc:creator>Elith</dc:creator><description>&lt;p&gt;Alright, newest status this morning is: Completely new aws_iot project yields:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.3.0-rc1-ncs1-2410-g7d20f2ebf259  ***
Flash regions           Domain          Permissions
00 02 0x00000 0x18000   Secure          rwxl
03 31 0x18000 0x100000  Non-Secure      rwxl

Non-secure callable region 0 placed in flash region 2 with size 32.

SRAM region             Domain          Permissions
00 07 0x00000 0x10000   Secure          rwxl
08 31 0x10000 0x40000   Non-Secure      rwxl

Peripheral              Domain          Status
00 NRF_P0               Non-Secure      OK
01 NRF_CLOCK            Non-Secure      OK
02 NRF_RTC0             Non-Secure      OK
03 NRF_RTC1             Non-Secure      OK
04 NRF_NVMC             Non-Secure      OK
05 NRF_UARTE1           Non-Secure      OK
06 NRF_UARTE2           Secure          SKIP
07 NRF_TWIM2            Non-Secure      OK
08 NRF_SPIM3            Non-Secure      OK
09 NRF_TIMER0           Non-Secure      OK
10 NRF_TIMER1           Non-Secure      OK
11 NRF_TIMER2           Non-Secure      OK
12 NRF_SAADC            Non-Secure      OK
13 NRF_PWM0             Non-Secure      OK
14 NRF_PWM1             Non-Secure      OK
15 NRF_PWM2             Non-Secure      OK
16 NRF_PWM3             Non-Secure      OK
17 NRF_WDT              Non-Secure      OK
18 NRF_IPC              Non-Secure      OK
19 NRF_VMC              Non-Secure      OK
20 NRF_FPU              Non-Secure      OK
21 NRF_EGU1             Non-Secure      OK
22 NRF_EGU2             Non-Secure      OK
23 NRF_DPPIC            Non-Secure      OK
24 NRF_GPIOTE1          Non-Secure      OK
25 NRF_REGULATORS       Non-Secure      OK

SPM: NS image at 0x18200
SPM: NS MSP at 0x20029c80
SPM: NS reset vector at 0x1d9cd
SPM: prepare to jump to Non-Secure image.
*** Booting Zephyr OS build v2.3.0-rc1-ncs1-2410-g7d20f2ebf259  ***
E: AT socket could not be opened
E: thingy91_magpio_configure failed with error: -14
The AWS IoT sample started, version: v1.0.0
LTE cell changed: Cell ID: 41423372, Tracking area: 24012
PSM parameter update: TAU: -1, Active time: -1
RRC mode: Connected
Network registration status: Connected - home network
PSM parameter update: TAU: 3600, Active time: 0
DATE_TIME_OBTAINED_NTP
AWS_IOT_EVT_CONNECTING
I: Created notify_next_topic $aws/things/nrf-074626/jobs/notify-next
I: Created get_topic $aws/things/nrf-074626/jobs/$next/get/#
I: previously subscribed to notify-next topic
I: Publish topic: $aws/things/nrf-074626/jobs/$next/get
I: Publish payload {&amp;quot;clientToken&amp;quot;: &amp;quot;&amp;quot;}
AWS_IOT_EVT_CONNECTED
Persistent session enabled
Publishing: {
        &amp;quot;state&amp;quot;:        {
                &amp;quot;reported&amp;quot;:     {
                        &amp;quot;app_version&amp;quot;:  &amp;quot;v1.0.0&amp;quot;,
                        &amp;quot;batv&amp;quot;: 4425,
                        &amp;quot;ts&amp;quot;:   1601447933251
                }
        }
} to AWS IoT broker
AWS_IOT_EVT_READY
I: Checking for an available job
I: No queued jobs for this device
PSM parameter update: TAU: 1800, Active time: 60
RRC mode: Idle
Publishing: {
        &amp;quot;state&amp;quot;:        {
                &amp;quot;reported&amp;quot;:     {
                        &amp;quot;batv&amp;quot;: 4195,
                        &amp;quot;ts&amp;quot;:   1601447953252
                }
        }
} to AWS IoT broker
Next data publication in 20 seconds
RRC mode: Connected
RRC mode: Idle
Publishing: {
        &amp;quot;state&amp;quot;:        {
                &amp;quot;reported&amp;quot;:     {
                        &amp;quot;batv&amp;quot;: 4421,
                        &amp;quot;ts&amp;quot;:   1601447973329
                }
        }
} to AWS IoT broker
E: Exception occurred in Secure State
E: ***** HARD FAULT *****
E:   Fault escalation (see below)
E: ***** BUS FAULT *****
E:   Precise data bus error
E:   BFAR Address: 0x50015504
E: r0/a1:  0x0000000c  r1/a2:  0x00000090  r2/a3:  0x00000246
E: r3/a4:  0x000337f5 r12/ip:  0x20023108 r14/lr:  0x00000080
E:  xpsr:  0x20020400
E: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
E: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
E: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
E: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
E: fpscr:  0x00000000
E: Faulting instruction address (r15/pc): 0x20022490
E: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
E: Current thread: 0x20022490 (unknown)
E: Resetting system
*** Booting Zephyr OS build v2.3.0-rc1-ncs1-2410-g7d20f2ebf259  ***
Flash regions           Domain          Permissions
00 02 0x00000 0x18000   Secure          rwxl
03 31 0x18000 0x100000  Non-Secure      rwxl

Non-secure callable region 0 placed in flash region 2 with size 32.

SRAM region             Domain          Permissions
00 07 0x00000 0x10000   Secure          rwxl
08 31 0x10000 0x40000   Non-Secure      rwxl

Peripheral              Domain          Status
00 NRF_P0               Non-Secure      OK
01 NRF_CLOCK            Non-Secure      OK
02 NRF_RTC0             Non-Secure      OK
03 NRF_RTC1             Non-Secure      OK
04 NRF_NVMC             Non-Secure      OK
05 NRF_UARTE1           Non-Secure      OK
06 NRF_UARTE2           Secure          SKIP
07 NRF_TWIM2            Non-Secure      OK
08 NRF_SPIM3            Non-Secure      OK
09 NRF_TIMER0           Non-Secure      OK
10 NRF_TIMER1           Non-Secure      OK
11 NRF_TIMER2           Non-Secure      OK
12 NRF_SAADC            Non-Secure      OK
13 NRF_PWM0             Non-Secure      OK
14 NRF_PWM1             Non-Secure      OK
15 NRF_PWM2             Non-Secure      OK
16 NRF_PWM3             Non-Secure      OK
17 NRF_WDT              Non-Secure      OK
18 NRF_IPC              Non-Secure      OK
19 NRF_VMC              Non-Secure      OK
20 NRF_FPU              Non-Secure      OK
21 NRF_EGU1             Non-Secure      OK
22 NRF_EGU2             Non-Secure      OK
23 NRF_DPPIC            Non-Secure      OK
24 NRF_GPIOTE1          Non-Secure      OK
25 NRF_REGULATORS       Non-Secure      OK

SPM: NS image at 0x18200
SPM: NS MSP at 0x20029c80
SPM: NS reset vector at 0x1d9cd
SPM: prepare to jump to Non-Secure image.
*** Booting Zephyr OS build v2.3.0-rc1-ncs1-2410-g7d20f2ebf259  ***
E: AT socket could not be opened
E: thingy91_magpio_configure failed with error: -14
The AWS IoT sample started, version: v1.0.0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The aws_iot_send() is responsible somehow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS IoT example getting RSRP results in HARD FAULT</title><link>https://devzone.nordicsemi.com/thread/272052?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 12:11:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8277147d-f75c-4fc6-ab4d-48cef61a5f67</guid><dc:creator>Elith</dc:creator><description>&lt;p&gt;I noticed that it might also happen when not using RSRP. I updated to the latest origin/master earlier today - perhaps an unintended introduction of a bug?&lt;/p&gt;
&lt;p&gt;I get the following when compiling:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;C:/ncs/nrf/subsys/net/lib/aws_iot/src/aws_iot.c: In function &amp;#39;mqtt_evt_handler&amp;#39;:
C:/ncs/nrf/subsys/net/lib/aws_iot/src/aws_iot.c:586:26: warning: &amp;#39;err&amp;#39; may be used uninitialized in this function [-Wmaybe-uninitialized]
  586 |     aws_iot_evt.data.err = err;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I changed the err to just int err1 = 1; (and then changing the err to err1). Just in case, however it is not it.&lt;/p&gt;
&lt;p&gt;I can provoke the error by unplugging the SIM card and plugging it back in (with some changes to the example such that it does not delete the thread on disconnect. It also happens sometimes when the cell tower changes.&lt;/p&gt;
&lt;p&gt;It seems to be a problem in aws_iot_send(), as this is where it crashes (perhaps it is linked with the RSRP problem):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;+CEREG: 5,1,&amp;quot;5DCC&amp;quot;,&amp;quot;0278120C&amp;quot;,7,,,&amp;quot;00000000&amp;quot;,&amp;quot;00000110&amp;quot;
Publishing: {
        &amp;quot;state&amp;quot;:        {
                &amp;quot;reported&amp;quot;:     {
                        &amp;quot;device&amp;quot;:       &amp;quot;nrf-074626&amp;quot;,
                        &amp;quot;batv&amp;quot;: 4445,
                        &amp;quot;rsrp&amp;quot;: 255,
                        &amp;quot;mode&amp;quot;: 1,
                        &amp;quot;datim&amp;quot;:        &amp;quot;20/09/29,12:48:02+08&amp;quot;,
                        &amp;quot;timestamp&amp;quot;:    1601383681346
                }
        }
} to AWS IoT broker
*** Booting Zephyr OS build v2.3.0-rc1-ncs1-2410-g7d20f2ebf259  ***
Flash regions           Domain          Permissions
00 02 0x00000 0x18000   Secure          rwxl
03 31 0x18000 0x100000  Non-Secure      rwxl

Non-secure callable region 0 placed in flash region 2 with size 32.

SRAM region             Domain          Permissions
00 07 0x00000 0x10000   Secure          rwxl
08 31 0x10000 0x40000   Non-Secure      rwxl

Peripheral              Domain          Status
00 NRF_P0               Non-Secure      OK
01 NRF_CLOCK            Non-Secure      OK
02 NRF_RTC0             Non-Secure      OK
03 NRF_RTC1             Non-Secure      OK
04 NRF_NVMC             Non-Secure      OK
05 NRF_UARTE1           Non-Secure      OK
06 NRF_UARTE2           Secure          SKIP
07 NRF_TWIM2            Non-Secure      OK
08 NRF_SPIM3            Non-Secure      OK
09 NRF_TIMER0           Non-Secure      OK
10 NRF_TIMER1           Non-Secure      OK
11 NRF_TIMER2           Non-Secure      OK
12 NRF_SAADC            Non-Secure      OK
13 NRF_PWM0             Non-Secure      OK
14 NRF_PWM1             Non-Secure      OK
15 NRF_PWM2             Non-Secure      OK
16 NRF_PWM3             Non-Secure      OK
17 NRF_WDT              Non-Secure      OK
18 NRF_IPC              Non-Secure      OK
19 NRF_VMC              Non-Secure      OK
20 NRF_FPU              Non-Secure      OK
21 NRF_EGU1             Non-Secure      OK
22 NRF_EGU2             Non-Secure      OK
23 NRF_DPPIC            Non-Secure      OK
24 NRF_GPIOTE1          Non-Secure      OK
25 NRF_REGULATORS       Non-Secure      OK

SPM: NS image at 0x18200
SPM: NS MSP at 0x2002ac48
SPM: NS reset vector at 0x1b989
SPM: prepare to jump to Non-Secure image.
*** Booting Zephyr OS build v2.3.0-rc1-ncs1-2410-g7d20f2ebf259  ***
The AWS IoT sample started, version: v1.0.0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It seems that the aws_iot_send() bugs out when the connection is lost or changed or some state change related to the LTE and/or AWS iot connection occurs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>