How to configure XIP from QSPI with CODE_SIZE greater than 512KB

⚠️
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.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
5个帖子/ 0新
Last post
加里Clarkson
Offline
最后一次露面:1年11个月前
Joined:2019-04-16 09:57
How to configure XIP from QSPI with CODE_SIZE greater than 512KB

Hi Team,

I have a DA1469x ProKit and building code with SDK_10.0.4.66 and this has a standard MX25U3235F flash device. I am performing an evaluation to check the device will meet the requirements for a customer application.

My application is configured to execute as XIP from QSPI and the initial test using sample application freertos_retarget builds and runs fine when using the 4MB partition table.

现在,当我添加我的剩余应用程序时,我已经在一些专有的代码库和恒定的代码表中链接,该常量代码表将映射到ROM区域的代码大于默认的512KB。ROM接头区域增长到800kb左右。我留下了在64KB中被配置为默认值的QSPI的缓存。

I have created a modified 4M based partition table which defines the firmware partition to be larger as per below and I have adjusted the linker scripts:

#define NVMS_PRODUCT_HEADER_PART_START 0x000000 #define NVMS_PRODUCT_HEADER_PART_SIZE 0x002000 #define NVMS_FIRMWARE_PART_START 0x002000 /* Alignment to 512KB is dictated by the default FLASH_REGION_SIZE. */ #define NVMS_FIRMWARE_PART_SIZE 0x0DE000 /* Increased from default 0x07E000 to use empty space */

我使用使用该设备program_qspi_jtagscript which appears to flash all the sectors correctly however I am unable to read back any constant data or execute code from addresses above 0x80000 (remapped) or 0x36080000 direct. Is it even possible to have anvms_firmware_part_size.大于512kb?

Either theprogram_qspi_jtagscript is failing to flash the upper regions correctly or the QSPI memory (re)mapping is somehow still misconfigured.

请您提供任何指导。

谢谢

〜加里

Device:
PM_DIALOG.
Offline
最后一次露面:2天23小时前
Staff
Joined:2018-02-08 11:03
嗨加里克拉克森,

嗨加里克拉克森,

Please check the Table 976 of DA1469x datasheet. By default, the FLASH region size is set at 0.5 Mbytes, but this value can be changed by programming the CACHE_FLASH_REG[FLASH_REGION_SIZE] in the OTP header. The CACHE_FLASH_REG[FLASH_REGION_BASE] and CACHE_FLASH_REG[FLASH_REGION_OFFSET] will be set by the bootloader, so you don’t need to program them. ONLY CACHE_FLASH_REG[FLASH_REGION_SIZE] must be programmed.

  1. 假设你想to have 1MB FLASH region size, so you will have to set the CACHE_FLASH_REG[FLASH_REGION_SIZE] to 0x5. Please find attached the steps you should follow in order to program the OTP header.
  2. 刻录OTP标题后,您应该更改分区表,因为FW分区必须用偏移量对齐至1MB,最高可达0x4000。通常,FW分区必须与Flash_Region_size对齐。您可以在附件中找到一个引用分区表。如您所见,固件和通用分区都为1MB对齐。NVMS_Product_Header应以0x0000开始,大小应为0x2000。除了NVMS_Product_Header之外,可以根据您的实现和要求修改NVMS_Firmware和NVMS_GENERIC_PART。确保根据表976设置了正确的值并刻录OTP标题。
  3. In case you use the MX25U3235F and 4MB partition table, you must have the same configurations as in config.png snapshot. Run the program_qspi_config script in order to make sure that you have the same configurations. Unless, please change them.
  4. First Erase and then program the QSPI by executing the appropriate scripts. After that open the QSPI Partition Table form the Tools bar of SmartSnippets toolbox. It is strongly recommended to use the latest version of the tool which is version 2.0.8. If you press connect and read, you will see the updated partition table as in partition_table.PNG snapshot. The NVMS_PARTITION_TABLE should start at QSPI address 0x3FF00 and 4 kBytes (1 FLASH sector size) should be placed before the end of the selected FLASH size. If this is not the case, then Toolbox will not recognize your new partition scheme (NVMS_PARTITION_TABLE.PNG)!

In addition, if you would like to have SUOTA functionality, the SUOTA partition table must be modified respectively.

谢谢,PM_DIALOG.

Attachment:
加里Clarkson
Offline
最后一次露面:1年11个月前
Joined:2019-04-16 09:57
Hi,

Hi,

many thanks for the guidance and step by step instructions. I was setting CACHE_FLASH_REG[FLASH_REGION_SIZE] to 0x5 early in the startup code without realising this must be done via the OTP route.

I instead changed to use a 2Mbyte configuration by setting CACHE_FLASH_REG[FLASH_REGION_SIZE] to 0x4 for some headroom and adjusted the partition table. It is now working fine. Thanks for your help.

问候,

加里

PM_DIALOG.
Offline
最后一次露面:2天23小时前
Staff
Joined:2018-02-08 11:03
嗨加里,

嗨加里,

Glad that you figured your issue out. If you found my answer useful, please mark it as “accepted”.

谢谢,PM_DIALOG.

PM_DIALOG.
Offline
最后一次露面:2天23小时前
Staff
Joined:2018-02-08 11:03
Hi Gary,

Hi Gary,

此外,您应该在bsp_memory_defaults.h文件中更改dg_configqspi_code_size_aa宏。请在bsp_memory_defaults中进行以下修改

#ifndef dg_configQSPI_MAX_IMAGE_SIZE #define dg_configQSPI_MAX_IMAGE_SIZE ( IMAGE_PARTITION_SIZE ) #endif #ifndef dg_configQSPI_CODE_SIZE_AA #define dg_configQSPI_CODE_SIZE_AA (dg_configQSPI_MAX_IMAGE_SIZE - (136*1024)) /* Take into account CMI firmware size */ #endif

136KB是在M0 +中运行的CMAC的大小。

谢谢,PM_DIALOG.