Hi Dialog
I am developing my project code based on DSPS project. I had a error while compiling. The error is " ble_sps_peripheral.elf section `.text' will not fit in region `ROM' " , " region `ROM' overflowed by 2240 bytes ". So I modified dg_configQSPI_CODE_SIZE from ( 128*1024 ) to (320 * 1024 ), and then solve the problem. But I still do not know hot to set the CODE_SIZE
correctly. if my suota partition_table.h is as below, I should set dg_configQSPI_CODE_SIZE to be 320 * 1024 (0x50000) ? Should the code size follow the size of NVMS_FW_EXEC_PART and NVMS_FW_UPDATE_PART, is it correct? if correct, why the project code's default setting is 128*1024 , smaller than the real capacity of qspi flash ?
PARTITION2( 0x000000 , 0x01E000 , NVMS_FIRMWARE_PART , 0 )
PARTITION2( 0x01E000 , 0x001000 , NVMS_PRODUCT_HEADER_PART , 0 )
PARTITION2( 0x01F000 , 0x001000 , NVMS_IMAGE_HEADER_PART , 0 )
PARTITION2( 0x020000 , 0x050000 , NVMS_FW_EXEC_PART , 0 ) // 320K
x00d000 x070000 PARTITION2 (0, 0, NVMS_LOG_PART , 0 )
PARTITION2( 0x07D000 , 0x002000 , NVMS_PLATFORM_PARAMS_PART , PARTITION_FLAG_READ_ONLY )
PARTITION2( 0x07F000 , 0x001000 , NVMS_PARTITION_TABLE , PARTITION_FLAG_READ_ONLY )
PARTITION2( 0x080000 , 0x010000 , NVMS_PARAM_PART , 0 )
PARTITION2( 0x090000 , 0x051000 , NVMS_FW_UPDATE_PART , 0 ) // 320K
PARTITION2( 0x0E1000 , 0x01F000 , NVMS_GENERIC_PART , PARTITION_FLAG_VES )
Hi nigelyang,
This compilation error is because of the code is too large for the flash limit to fit it (the flash space is considered as a ROM section), so as you have correctly mentioned you should increase the dg_configQSPI_CODE_SIZE definition. The CODE_SIZE definition that the project has, by default is 128K, if you increase that you will be able to have extra ROM for the firmware to compile, so that’s why you figured your problem out. The CODE_SIZE must be equal or less than the size of NVMS_FW_EXEC_PART and NVMS_FW_UPDATE_PART. In your case the CODE_SIZE is equal to both of partitions, that means that your firmware could be fit into them, so you will able to compile your project without errors. If you increase the code size more than 320K, you should increase the NVMS_FW_EXEC_PART and NVMS_FW_UPDATE_PART, so the partition table must be modified. In that case, the only thing that must not be changed is the PARTITION_FLAG_VES. In our examples we have 128K code size because this is the minimum cachable code size when using QSPI configuration. With current partition table, you are able to use up to 320 * 1024 (0x50000) code size.
Thanks, PM_Dialog