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

migrate "Asset_tracker" project to "http_application_update"

Hi,

I am using "asset tracker" project in nRF9160 DK.

I want to update asset tracker application through HTTP.

So i migrated changes of "asset tacker" in main function of "http_application_update" project and added necessary files for gps and accelerometer  to the project.

In "prj.conf" file of "http_application_update" project i added following 

CONFIG_WATCHDOG=y
CONFIG_WDT_NRFX=y
CONFIG_NRFX_WDT=y

CONFIG_SPI=y
CONFIG_SPI_NRFX=y
CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=8
CONFIG_SPI_3=y
CONFIG_SPI_3_NRF_SPIM=y

CONFIG_SERIAL=y
CONFIG_UART_NRFX=y
CONFIG_UART_2_NRF_UARTE=y

CONFIG_NEWLIB_LIBC=y

In "nrf9160_pca10090ns.overlay" file of "http_application_update" i added following 

&spi3 {
	status = "ok";
	sck-pin = <13>;
	mosi-pin = <11>;
	miso-pin = <12>;
    spi-max-frequency = <4000000>;
};

&wdt{

   status = "ok";
};

&uart2 {
	status = "ok";
	current-speed = <9600>;
	tx-pin = <21>;
	rx-pin = <22>;
	rts-pin = <24>;
	cts-pin = <25>;
};

After adding above changes "http_application_update" project is compiled with no error.

Now i made change to the "spm" project as below 

I added following in "prj.conf" file 

CONFIG_TRUSTED_EXECUTION_SECURE=y
CONFIG_IS_SPM=y
CONFIG_SPM_NRF_UARTE2_NS=y

I added following in the "nrf9160_pca10090.overlay" file. 

/* needed to get the NRF_UARTE2 defined */
&uart2 {
	status = "ok";
	current-speed = <9600>;
	tx-pin = <21>;
	rx-pin = <22>;
	rts-pin = <24>;
	cts-pin = <25>;
};

&spi3 {
	status = "ok";
	sck-pin = <13>;
	mosi-pin = <11>;
	miso-pin = <12>;
    spi-max-frequency = <4000000>;
};

&wdt{

   status = "ok";
};

After making above changes i compiled "http_application_update" project and programmed the board with "merge.hex" file. 

There at power on i am getting following print on UART. 

***** Booting Zephyr OS v1.14.99-ncs1 *****<CR><LF>
[00:00:00.003,723] <ESC><inf> mcuboot: Starting bootloader<ESC><CR><LF>
[00:00:00.012,359] <ESC><inf> mcuboot: Primary image: magic=unset, copy_done=0x3, image_ok=0x3<ESC><CR><LF>
[00:00:00.023,712] <ESC><inf> mcuboot: Scratch: magic=unset, copy_done=0x50, image_ok=0x3<ESC><CR><LF>
[00:00:00.034,515] <ESC><inf> mcuboot: Boot source: primary slot<ESC><CR><LF>
[00:00:00.045,684] <ESC><inf> mcuboot: Swap type: none<ESC><CR><LF>
[00:00:00.473,876] <ESC><inf> mcuboot: Bootloader chainload address offset: 0xc000<ESC><CR><LF>
[00:00:00.483,856] <ESC><inf> mcuboot: Jumping to the first image slot<ESC><CR><LF>
***** 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>	Secure<HT>	<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>	Non-Secure<HT>	OK<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 0x14200<CR><LF>
SPM: NS MSP at 0x20026580<CR><LF>
SPM: NS reset vector at 0x1e2d9<CR><LF>
SPM: prepare to jump to Non-Secure image.<CR><LF>
<NUL>

So SPM is not being able to jump to the "asset tracker" application.

can you help me solve the issue ?

Regards,

Smitesh Mali

Related