This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/CC2640R2F: Using CACHE_AS_RAM=1 with OSAL_SNV=1

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hello,

I only want to use 1 SNV page in my application to save flash space. According to the BLE SW Dev Guide, when OSAL_SNV is set to 1, "flash compaction uses flash cache RAM for intermediate storage." In my project I am running low on RAM, so I am using the 8KB cache region as RAM. Given that this cache region is already being used by my application, how will SNV compaction of the SNV area be affected? Will the operation fail in any way or am I fine using this configuration?

Thanks,

Keron

  • Hello Keron,

    When using OSAL_SNV=1, a contiguous 4 kB block of SRAM is required to temporarily store the existing contents of the SNV page while the garbage collection ("compaction") operation is performed on the flash page. The default compaction implementation for OSAL_SNV=1 uses the base address of the 8 kB flash cache for this temporary storage. If you had placed anything in the first 4kB of the cache, it will likely be overwritten during the compaction phase. Likewise, if other code runs and disturbs the contents of the cache during a compaction, you will likely end up with corrupted contents in the SNV flash page.

    We don't provide a guide or example for using a different memory address for compaction purposes however, the OSAL_SNV=1 and related compaction implementation is provided in source via the nvocop.c file. Perhaps your application's implementation allows for a temporary 4kB buffer that can be used to facilitate a flash compaction, or you can reserve the first 4 kB of the cache for this purpose.

    Best wishes
  • Thanks JXS, this is exactly what I needed to know.