<?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>Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92418/fota-anomaly-based-on-ncs-1-9-0-sdk</link><description>I developed a product for the customer with 9160. It used to run on the sdk of ncs1.2.0, and its fota function is normal; Now I have upgraded the sdk to ncs1.9.0, and found that the fota function is abnormal. The device can connect to the background and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Oct 2022 09:59:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92418/fota-anomaly-based-on-ncs-1-9-0-sdk" /><item><title>RE: Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/thread/389965?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2022 09:59:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0fd5791-5031-4308-ace1-fb69836d48d5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Can you post the current code and log output?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/thread/389918?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2022 03:04:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e26a36c4-d965-4940-a6a6-bf47f05bc9b5</guid><dc:creator>duxinglang</dc:creator><description>&lt;p&gt;&lt;span&gt;I tried again according to your method. Unfortunately, after my device fota was successfully upgraded and restarted, it was still running the old firmware before the upgrade, and did not switch to the new firmware. I watched the boot_ write_ img_ The result returned by the confirmed function is 0, whether before or after the upgrade. So, what is the reason for this?&amp;nbsp;&lt;/span&gt;&lt;span&gt;This is the log file I grabbed.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/thread/388894?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2022 06:25:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:378b3cb0-fd14-421c-b8c1-b6974dd7aba4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Based on what you describe, it seems as if the boot_write_img_confirmed() function only works when called before modem init.&lt;/p&gt;
&lt;p&gt;Please check the return code from boot_write_img_confirmed(); and see if it returns with an error when&amp;nbsp; CONFIG_NRF_MODEM_ LIB_SYS_INIT=y.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/thread/388729?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 10:34:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db664f67-2fa0-4680-8675-662b4461a4aa</guid><dc:creator>duxinglang</dc:creator><description>&lt;p&gt;OK.This is my initialization code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void work_init(void)
{
	k_work_q_start(&amp;amp;nb_work_q, nb_stack_area,
					K_THREAD_STACK_SIZEOF(nb_stack_area),
					CONFIG_APPLICATION_WORKQUEUE_PRIORITY);
#ifdef CONFIG_IMU_SUPPORT	
	k_work_q_start(&amp;amp;imu_work_q, imu_stack_area,
					K_THREAD_STACK_SIZEOF(imu_stack_area),
					CONFIG_APPLICATION_WORKQUEUE_PRIORITY);
#endif
	
	if(IS_ENABLED(CONFIG_WATCHDOG))
	{
		watchdog_init_and_start(&amp;amp;k_sys_work_q);
	}
}

static int application_init(void)
{
	int err;

	err = fota_download_init(fota_dl_handler);
	if(err != 0)
	{
		return err;
	}

	return 0;
}

void fota_init(void)
{
	int err;

#ifdef FOTA_DEBUG
	LOGD(&amp;quot;begin&amp;quot;);
#endif

#if 0
	nrf_modem_lib_init(NORMAL_MODE);
#else
	err = nrf_modem_lib_get_init_ret();
	switch(err)
	{
	case 0:
		/* Initialization successful, no action required. */
	#ifdef FOTA_DEBUG
		LOGD(&amp;quot;Initialization successful&amp;quot;);
	#endif		
		break;

	case MODEM_DFU_RESULT_OK:
	#ifdef FOTA_DEBUG	
		LOGD(&amp;quot;Modem firmware update successful!&amp;quot;);
		LOGD(&amp;quot;Modem will run the new firmware after reboot&amp;quot;);
	#endif
		k_thread_suspend(k_current_get());
		break;
		
	case MODEM_DFU_RESULT_UUID_ERROR:
	case MODEM_DFU_RESULT_AUTH_ERROR:
	#ifdef FOTA_DEBUG
		LOGD(&amp;quot;Modem firmware update failed&amp;quot;);
		LOGD(&amp;quot;Modem will run non-updated firmware on reboot.&amp;quot;);
	#endif
		break;
		
	case MODEM_DFU_RESULT_HARDWARE_ERROR:
	case MODEM_DFU_RESULT_INTERNAL_ERROR:
	#ifdef FOTA_DEBUG
		LOGD(&amp;quot;Modem firmware update failed&amp;quot;);
		LOGD(&amp;quot;Fatal error.&amp;quot;);
	#endif
		break;
		
	default:
		break;
	}
#endif

	boot_write_img_confirmed();

	err = application_init();
	if(err != 0)
	{
		return;
	}

#ifdef FOTA_DEBUG
	LOGD(&amp;quot;done&amp;quot;);
#endif
}

void system_init(void)
{
	k_sleep(K_MSEC(500));//xb test 2022-03-11 启动时候延迟0.5S,等待其他外设完全启动
	
#ifdef CONFIG_FOTA_DOWNLOAD
	fota_init();
#endif

	InitSystemSettings();

	init_imu_int1();//xb add 2022-05-27
	PPG_i2c_off();
	
	pmu_init();
	flash_init();
	LCD_Init();
	
	ShowBootUpLogo();

	key_init();
#ifdef CONFIG_AUDIO_SUPPORT	
	audio_init();
#endif
	ble_init();
#ifdef CONFIG_PPG_SUPPORT	
	PPG_init();
#endif
#ifdef CONFIG_IMU_SUPPORT
	IMU_init(&amp;amp;imu_work_q);
#endif
#ifdef CONFIG_TEMP_SUPPORT
	temp_init();
#endif
#ifdef CONFIG_DATA_DOWNLOAD_SUPPORT
	dl_init();
#endif
	NB_init(&amp;amp;nb_work_q);
	GPS_init();
}

int main(void)
{
	work_init();
	system_init();

	while(1)
	{
		KeyMsgProcess();
		TimeMsgProcess();
		NBMsgProcess();
	#ifdef CONFIG_WIFI	
		WifiProcess();
	#endif
		GPSMsgProcess();
		PMUMsgProcess();
	#ifdef CONFIG_IMU_SUPPORT	
		IMUMsgProcess();
	#ifdef CONFIG_FALL_DETECT_SUPPORT
		FallMsgProcess();
	#endif
	#endif
	#ifdef CONFIG_PPG_SUPPORT	
		PPGMsgProcess();
	#endif
		LCDMsgProcess();
	#ifdef CONFIG_TOUCH_SUPPORT
		TPMsgProcess();
	#endif
		AlarmMsgProcess();
		SettingsMsgPorcess();
		SOSMsgProc();
		UartMsgProc();
	#ifdef CONFIG_ANIMATION_SUPPORT
		AnimaMsgProcess();
	#endif		
		ScreenMsgProcess();
	#ifdef CONFIG_DATA_DOWNLOAD_SUPPORT
		DlMsgProc();
	#endif
	#ifdef CONFIG_FOTA_DOWNLOAD
		FotaMsgProc();
	#endif
	#ifdef CONFIG_AUDIO_SUPPORT
		AudioMsgProcess();
	#endif
	#ifdef CONFIG_SYNC_SUPPORT
		SyncMsgProcess();
	#endif
	#ifdef CONFIG_TEMP_SUPPORT
		TempMsgProcess();
	#endif
		system_init_completed();
		k_cpu_idle();
	}
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/thread/388728?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 10:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fcdf152-5bd7-41ae-8c0e-c93572eb9e5f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;OK, thanks for confirming. Could you try to initialize the modem library yourself from main(),etc and see if it works then (i.e. both DFU and modem lib).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/thread/388725?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 10:11:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:697321a1-5f76-4113-a453-9fff823c5f57</guid><dc:creator>duxinglang</dc:creator><description>&lt;p&gt;Sorry，&amp;nbsp;I made a mistake. It is the CONFIG_NRF_MODEM_ IB_SYS_INIT.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/thread/388695?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 08:45:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80ec86e1-81c6-4222-9734-d8469bfb6311</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;What SDK version are you building the app with now? I read it as being 1.9.0, but this version does not define the CONFIG_BSD_LIBRARY_SYS_INIT symbol (BSD lib was renamed to modem lib in v1.5.0), so I don&amp;#39;t understand how you can still use this symbol and build your project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/thread/388686?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 08:15:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31c03edf-66e4-4f62-844a-d723c3742be7</guid><dc:creator>duxinglang</dc:creator><description>&lt;p&gt;Thanks for your reply. My current operation is to create an app on ncs1.9.0_ update. Bin, and then modified the interface to compile and burn it to the device. That is to say, when testing, the old firmware of the device and the new firmware of FOTA are compiled on ncs1.9.0, which should have nothing to do with slot partitions. Later, I found out that if Add CONFIG to conf_ BSD_ LIBRARY_ SYS_ INIT=n, after compiling and burning, my device will switch to the new firmware that was fota last time after it is powered on again, but it cannot operate the modem. It is strange whether the modem is turned on or off. By the way, the firmware version of my modem is v1.3.1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fota anomaly based on Ncs 1.9.0 sdk</title><link>https://devzone.nordicsemi.com/thread/388558?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 11:41:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8211be13-d672-4d03-abbd-0c790c4b66c7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Could it be that the memory layout has changed between these versions? For DFU to work, it is important that the primary and secondary slot partitions remain at the same addresses between updates. The normal way we ensure this is to use a startic partition file as explained here: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.2/nrf/scripts/partition_manager/partition_manager.html#configuring-static-partitions"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.2/nrf/scripts/partition_manager/partition_manager.html#configuring-static-partitions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can for instance make a copy of the partitions.yml file from your v1.2.0 project and use it as a static partitions file in your new project.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>