Question about SUOTA_MAX_IMAGE_SIZE

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
nigelyang
Offline
Last seen:1 month 5 days ago
加入:2018-03-20 08:24
Question about SUOTA_MAX_IMAGE_SIZE

hi Dialog,

my code size(with suota) is around 320 Kbytes, and I failed to do suota everytime. I found SUOTA_MAX_IMAGE_SIZE is set as (236 * 1024). Could I change the parameter ? and should other related parammeters set together? dose it have limitation?

thanks for your help

Device:
PM_Dialog
Offline
Last seen:1 day 15 hours ago
工作人员
加入:2018-02-08 11:03
Hi nigelyang,

Hi nigelyang,

The SUOTA_MAX_IMAGE_SIZE macro, defines the maximum image size should be taken into consideration when the SUOTA feature is enabled. Please note that apart from the actual firmware update that is stored, a header is placed above that. If the total size of both header + the firmware update is larger than the size we have predefined (236 * 1024), then an error identification will be occurred. To do so, if you want to store a firmware update which is bigger than the predefined size (236*1024), then you should change the value of SUOTA_MAX_IMAGE_SIZE macro accordingly.

The firmware update will be stored in the QSPI Flash and more specifically in the NVMS_FW_UPDATE_PART section. The SDK includes 3 different predefined partition tables(1M, 2M, 521K) both for SUOTA and non-SUOTA protects. The selection depends on the size of the flash.

Let’s take the pxp_reporter project as an example. In case of SUOTA configuration, the partition table for 1M is used (#define USE_PARTITION_TABLE_1MB_WITH_SUOTA). Having a look at the partition table for 1M using SUOTA you will see the following entry:

PARTITION2( 0x090000 , 0x051000 , NVMS_FW_UPDATE_PART , 0 )

The first parameter determines the offset address of the partition and the second its size. Analyzing the 0x051000 = 324 * 1024. This means that the maximum value the macro can take (in this case) is #define SUOTA_MAX_IMAGE_SIZE (324*1024). So, in your case you have to change the SUOTA_MAX_IMAGE_SIZE macro and the NVMS_FW_UPDATE_PART entry accordingly. Changes in the NVMS_FW_UPDATE_PART partition entry means that the whole partition table should be changed.

Thanks, PM_Dialog