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:
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