This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I2C and NB-IoT problem

I am currently working on adding the ambient light sensor to the asset_tracker application firmware. I have managed to configure the I2C, configure the sensor and read the values. For now, I send values from the light sensor as air pressure to the cloud. Because there is no LTE-M in my area I need to switch to NB-IoT, and that is where the problem starts. After the build and firmware download nRF91 module has a problem with I2C module, and it can not initialize it. The UART output from the device is in attachment file uart_out.txt at the end you will see that some exception occurs.

I have put the code on the GitHub, so you can see what we added. If you go to the link and scroll to the end of the page you can see the differences in the main.c and prj.conf files.
https://github.com/VojislavM/asset_tracker/pull/1/files?file-filters%5B%5D=.c&file-filters%5B%5D=.conf
My start point was asset_tracker code from v0.4.0 release. 

01/07/2019 12:55:10.60 [RX] - ***** Booting Zephyr OS v1.14.99-ncs1 *****<CR><LF>
Flash region<HT>	<HT>	Domain<HT>	<HT>	Permissions<CR><LF>
00 0x00000 0x08000 <HT>	Secure<HT>	<HT>	rwxl<CR><LF>
01 0x08000 0x10000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
02 0x10000 0x18000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
03 0x18000 0x20000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
04 0x20000 0x28000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
05 0x28000 0x30000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
06 0x30000 0x38000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
07 0x38000 0x40000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
08 0x40000 0x48000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
09 0x48000 0x50000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
10 0x50000 0x58000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
11 0x58000 0x60000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
12 0x60000 0x68000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
13 0x68000 0x70000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
14 0x70000 0x78000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
15 0x78000 0x80000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
16 0x80000 0x88000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
17 0x88000 0x90000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
18 0x90000 0x98000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
19 0x98000 0xa0000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
20 0xa0000 0xa8000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
21 0xa8000 0xb0000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
22 0xb0000 0xb8000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
23 0xb8000 0xc0000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
24 0xc0000 0xc8000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
25 0xc8000 0xd0000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
26 0xd0000 0xd8000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
27 0xd8000 0xe0000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
28 0xe0000 0xe8000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
29 0xe8000 0xf0000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
30 0xf0000 0xf8000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
31 0xf8000 0x100000 <HT>	Non-Secure<HT>	rwxl<CR><LF>
<CR><LF>
SRAM region<HT>	<HT>	Domain<HT>	<HT>	Permissions<CR><LF>
00 0x00000 0x02000<HT>	Secure<HT>	<HT>	rwxl<CR><LF>
01 0x02000 0x04000<HT>	Secure<HT>	<HT>	rwxl<CR><LF>
02 0x04000 0x06000<HT>	Secure<HT>	<HT>	rwxl<CR><LF>
03 0x06000 0x08000<HT>	Secure<HT>	<HT>	rwxl<CR><LF>
04 0x08000 0x0a000<HT>	Secure<HT>	<HT>	rwxl<CR><LF>
05 0x0a000 0x0c000<HT>	Secure<HT>	<HT>	rwxl<CR><LF>
06 0x0c000 0x0e000<HT>	Secure<HT>	<HT>	rwxl<CR><LF>
07 0x0e000 0x10000<HT>	Secure<HT>	<HT>	rwxl<CR><LF>
08 0x10000 0x12000<HT>	Non-Secure<HT>	rwxl<CR><LF>
09 0x12000 0x14000<HT>	Non-Secure<HT>	rwxl<CR><LF>
10 0x14000 0x16000<HT>	Non-Secure<HT>	rwxl<CR><LF>
11 0x16000 0x18000<HT>	Non-Secure<HT>	rwxl<CR><LF>
12 0x18000 0x1a000<HT>	Non-Secure<HT>	rwxl<CR><LF>
13 0x1a000 0x1c000<HT>	Non-Secure<HT>	rwxl<CR><LF>
14 0x1c000 0x1e000<HT>	Non-Secure<HT>	rwxl<CR><LF>
15 0x1e000 0x20000<HT>	Non-Secure<HT>	rwxl<CR><LF>
16 0x20000 0x22000<HT>	Non-Secure<HT>	rwxl<CR><LF>
17 0x22000 0x24000<HT>	Non-Secure<HT>	rwxl<CR><LF>
18 0x24000 0x26000<HT>	Non-Secure<HT>	rwxl<CR><LF>
19 0x26000 0x28000<HT>	Non-Secure<HT>	rwxl<CR><LF>
20 0x28000 0x2a000<HT>	Non-Secure<HT>	rwxl<CR><LF>
21 0x2a000 0x2c000<HT>	Non-Secure<HT>	rwxl<CR><LF>
22 0x2c000 0x2e000<HT>	Non-Secure<HT>	rwxl<CR><LF>
23 0x2e000 0x30000<HT>	Non-Secure<HT>	rwxl<CR><LF>
24 0x30000 0x32000<HT>	Non-Secure<HT>	rwxl<CR><LF>
25 0x32000 0x34000<HT>	Non-Secure<HT>	rwxl<CR><LF>
26 0x34000 0x36000<HT>	Non-Secure<HT>	rwxl<CR><LF>
27 0x36000 0x38000<HT>	Non-Secure<HT>	rwxl<CR><LF>
28 0x38000 0x3a000<HT>	Non-Secure<HT>	rwxl<CR><LF>
29 0x3a000 0x3c000<HT>	Non-Secure<HT>	rwxl<CR><LF>
30 0x3c000 0x3e000<HT>	Non-Secure<HT>	rwxl<CR><LF>
31 0x3e000 0x40000<HT>	Non-Secure<HT>	rwxl<CR><LF>
<CR><LF>
Peripheral<HT>	<HT>	Domain<HT>	<HT>	Status<CR><LF>
00 NRF_P0<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
01 NRF_CLOCK<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
02 NRF_RTC1<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
03 NRF_NVMC<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
04 NRF_UARTE1<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
05 NRF_UARTE2<HT>	<HT>	Secure<HT>	<HT>	SKIP<CR><LF>
06 NRF_IPC<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
07 NRF_VMC<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
08 NRF_FPU<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
09 NRF_EGU1<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
10 NRF_EGU2<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
11 NRF_TWIM2<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
12 NRF_SPIM3<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
13 NRF_TIMER0<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
14 NRF_TIMER1<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
15 NRF_TIMER2<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
16 NRF_SAADC<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
17 NRF_GPIOTE1<HT>	<HT>	Non-Secure<HT>	OK<CR><LF>
<CR><LF>
SPM: NS image at 0x8000<CR><LF>
SPM: NS MSP at 0x2002a4a8<CR><LF>
SPM: NS reset vector at 0x10005<CR><LF>
SPM: prepare to jump to Non-Secure image.<CR><LF>
***** Booting Zephyr OS v1.14.99-ncs1 *****<CR><LF>
Application started<CR><LF>
I2C_2 error<CR><LF>
LTE LC config ...<CR><LF>
NRF_CLOUD_EVT_TRANSPORT_CONNECTED<CR><LF>
NRF_CLOUD_EVT_USER_ASSOCIATED<CR><LF>
NRF_CLOUD_EVT_READY<CR><LF>
NRF_CLOUD_EVT_SENSOR_ATTACHED<CR><LF>
NRF_CLOUD_EVT_SENSOR_ATTACHED<CR><LF>
NRF_CLOUD_EVT_SENSOR_ATTACHED<CR><LF>
NRF_CLOUD_EVT_SENSOR_ATTACHED<CR><LF>
NRF_CLOUD_EVT_SENSOR_ATTACHED<CR><LF>
NRF_CLOUD_EVT_SENSOR_ATTACHED<CR><LF>
NRF_CLOUD_EVT_SENSOR_ATTACHED<CR><LF>
NRF_CLOUD_EVT_SENSOR_ATTACHED<CR><LF>
GPS device found<CR><LF>
Exception occurred in Secure State<CR><LF>
***** HARD FAULT *****<CR><LF>
  Fault escalation (see below)<CR><LF>
***** BUS FAULT *****<CR><LF>
  Precise data bus error<CR><LF>
  BFAR Address: 0x50008120<CR><LF>
***** Hardware exception *****<CR><LF>
Current thread ID = 0x20021da0<CR><LF>
Faulting instruction address = 0xea4a<CR><LF>
Fatal fault in ISR! Spinning...<CR><LF>

Related