I added FOTA_DOWNLOAD and MCU_BOOT to my project.Then I want to use http to download a file, and an EBADMSG error occurs at this time.
I reproduced this problem in the download_test demo.
The code has not been changed, just modified prj.conf. Here is my prj.conf
CONFIG_NRF_MODEM_LIB=y CONFIG_NRF_MODEM_LIB_SYS_INIT=n CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y CONFIG_NET_NATIVE=n CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_MODEM_KEY_MGMT=y CONFIG_LTE_LINK_CONTROL=y CONFIG_DOWNLOAD_CLIENT=y CONFIG_SAMPLE_FILE_CUSTOM=y CONFIG_SAMPLE_FILE_URL="http://wpepodownload.mediatek.com/QGPS_1.DAT?vendor=GOTOP&project=KuiiklNAqorm8SRdaWPQiGbZ6lkElM6-KzNRIau_tjE&device_id=100" # LTE link control CONFIG_LTE_LINK_CONTROL=y CONFIG_LTE_AUTO_INIT_AND_CONNECT=n CONFIG_LTE_NETWORK_MODE_NBIOT=y CONFIG_LTE_LEGACY_PCO_MODE=y # FOTA library CONFIG_FOTA_DOWNLOAD=y # Image manager CONFIG_IMG_MANAGER=y CONFIG_FLASH=y CONFIG_IMG_ERASE_PROGRESSIVELY=y CONFIG_BOOTLOADER_MCUBOOT=y # DFU Target CONFIG_DFU_TARGET=y
Application log:
[22:25:50.810]收←◆I: Bootloader chainload address offset: 0x10000 I: Jumping to the first image slot [22:26:01.080]收←◆*** Booting Zephyr OS build v2.4.99-ncs1 *** 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. [22:26:01.291]收←◆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_REGULATORS Non-Secure OK 25 NRF_GPIOTE1 Non-Secure OK SPM: NS image at 0x1c200 SPM: NS MSP at 0x200183d0 SPM: NS reset vector at 0x1f10d SPM: prepare to jump to Non-Secure image. *** Booting Zephyr OS build v2.4.99-ncs1 *** Download client sample started [22:26:01.610]收←◆Waiting for network.. [22:26:07.682]收←◆OK [22:26:08.294]收←◆Downloading http://wpepodownload.mediatek.com/QGPS_1.DAT?vendor=GOTOP&project=KuiiklNAqorm8SRdaWPQiGbZ6lkElM6-KzNRIau_tjE&device_id=100 [22:26:08.893]收←◆Error -77 during download
I did some tests. When I commented out CONFIG_DFU_TARGET=y, everything became normal. But FOTA is gone, this is not the result I want.
CONFIG_NRF_MODEM_LIB=y CONFIG_NRF_MODEM_LIB_SYS_INIT=n CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y CONFIG_NET_NATIVE=n CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_MODEM_KEY_MGMT=y CONFIG_LTE_LINK_CONTROL=y CONFIG_DOWNLOAD_CLIENT=y CONFIG_SAMPLE_FILE_CUSTOM=y CONFIG_SAMPLE_FILE_URL="http://wpepodownload.mediatek.com/QGPS_1.DAT?vendor=GOTOP&project=KuiiklNAqorm8SRdaWPQiGbZ6lkElM6-KzNRIau_tjE&device_id=100" # LTE link control CONFIG_LTE_LINK_CONTROL=y CONFIG_LTE_AUTO_INIT_AND_CONNECT=n CONFIG_LTE_NETWORK_MODE_NBIOT=y CONFIG_LTE_LEGACY_PCO_MODE=y # FOTA library CONFIG_FOTA_DOWNLOAD=y # Image manager CONFIG_IMG_MANAGER=y CONFIG_FLASH=y CONFIG_IMG_ERASE_PROGRESSIVELY=y CONFIG_BOOTLOADER_MCUBOOT=y # DFU Target #CONFIG_DFU_TARGET=y
Application log:
[22:50:40.129]收←◆I: Bootloader chainload address offset: 0x10000
I: Jumping to the first image slot
[22:50:41.848]收←◆*** Booting Zephyr OS build v2.4.99-ncs1 ***
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.
[22:50:42.058]收←◆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_REGULATORS Non-Secure OK
25 NRF_GPIOTE1 Non-Secure OK
SPM: NS image at 0x1c200
SPM: NS MSP at 0x200182f0
SPM: NS reset vector at 0x1f10d
SPM: prepare to jump to Non-Secure image.
*** Booting Zephyr OS build v2.4.99-ncs1 ***
Download client sample started
[22:50:42.377]收←◆Waiting for network..
[22:50:47.374]收←◆OK
[22:50:47.823]收←◆Downloading http://wpepodownload.mediatek.com/QGPS_1.DAT?vendor=GOTOP&project=KuiiklNAqorm8SRdaWPQiGbZ6lkElM6-KzNRIau_tjE&device_id=100
[22:50:49.448]收←◆[ 88% ] |============================================ | (2048/2304 bytes)[ 100% ] |==================================================| (2304/2304 bytes)
Download completed in 1639 ms @ 1405 bytes per sec, total 2304 bytes
Bye
This seems to be related to CONFIG_DFU_TARGET=y, but I can’t see any problems in the code. Can you help me analyze the problem?