Custom DFU imlementation

I am implementing DFU using my own transport to retrieve the binary image from AWS.

I'm developing in 2.6.0.

I am using the DFU TARGET libraries. 

When I start my download I look at the first 512 byte block with

     i=dfu_target_img_type   (  buffer2,xblocksize); I get 1 (I think that this is DFU_TARGET_IMAGE_TYPE_MCUBOOT)

But I can't get past dfu_target_init().

When I run   i=dfu_target_init(DFU_TARGET_IMAGE_TYPE_MCUBOOT,0,filesize,NULL); I get an error 19 (No Such Device)

When I run i=dfu_target_reset(); I get an error 13 (Permission Denied)

I believe the issue lies either in my prj.conf or my static partition.

Currently, prj.conf has

CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_BOOTLOADER_MCUBOOT=y
Small blue diamond Enable DFU Target Library
CONFIG_DFU_TARGET=y
CONFIG_DFU_TARGET_MCUBOOT=y

Small blue diamond Enable MCUboot Image Manager (if using MCUboot)
CONFIG_STREAM_FLASH=y
CONFIG_STREAM_FLASH_ERASE=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y

My static partition  is

app:
address: 0xc200
end_address: 0x85000
region: flash_primary
size: 0x78e00
mcuboot:
address: 0x0
end_address: 0xc000
placement:
before:
- mcuboot_primary
region: flash_primary
size: 0xc000
mcuboot_pad:
address: 0xc000
end_address: 0xc200
placement:
align:
start: 0x1000
before:
- mcuboot_primary_app
region: flash_primary
size: 0x200
mcuboot_primary:
address: 0xc000
end_address: 0x85000
orig_span: &id001
- mcuboot_pad
- app
region: flash_primary
sharers: 0x1
size: 0x79000
span: *id001
mcuboot_primary_app:
address: 0xc200
end_address: 0x85000
orig_span: &id002
- app
region: flash_primary
size: 0x78e00
span: *id002
mcuboot_secondary:
address: 0x85000
end_address: 0xfe000
placement:
after:
- mcuboot_primary
align:
start: 0x1000
region: flash_primary
share_size:
- mcuboot_primary
size: 0x79000
settings_storage:
address: 0xfe000
end_address: 0x100000
placement:
align:
start: 0x1000
before:
- end
region: flash_primary
size: 0x2000
sram_primary:
address: 0x20000000
end_address: 0x20040000
region: sram_primary
size: 0x40000

I've been playing with this for five days - any help would be greatly appreciatd.
Parents Reply Children
No Data
Related