Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-9559

Multiple NVS instances use the same buffer (SysConfig issue)

    XMLWordPrintable

Details

    • Bug
    • Status: Fixed
    • High
    • Resolution: Fixed
    • TI Device Drivers
    • TIDRIVERS-3908
    • TIDRIVERS_4_30_00
    • TIDRIVERS_4_40_00
    • Hide
      As a workaround, the user may remove the NVS SysConfig configuration and instead provide their own NVS config in a separate file compiled with their application. A working example of this is attached, note that the corresponding CONFIG_NVSname defines with the appropriate NVS index will also need to be declared where needed, e.g.:

      #define CONFIG_NVSINTERNAL 0
      #define CONFIG_NVSHOMEKIT 1

      Example custom.c file:

      #if defined(__TI_COMPILER_VERSION__)

      #pragma LOCATION(flashBuf0, 0x48000);
      #pragma NOINIT(flashBuf0);
      static char flashBuf0[0x4000];

      #pragma LOCATION(flashBuf1, 0x4c000);
      #pragma NOINIT(flashBuf1);
      static char flashBuf1[0x4000];

      #elif defined(__IAR_SYSTEMS_ICC__)

      __no_init static char flashBuf0[0x4000] @ 0x48000;
      __no_init static char flashBuf1[0x4000] @ 0x4c000;

      #elif defined(__GNUC__)

      __attribute__ ((section (".nvs")))
      static char flashBuf0[0x4000];
      __attribute__ ((section (".nvs")))
      static char flashBuf1[0x4000];

      #endif

      NVSCC26XX_Object nvsCC26XXObjects[2];

      static const NVSCC26XX_HWAttrs nvsCC26XXHWAttrs[2] = {
          /* CONFIG_NVSINTERNAL */
          {
              .regionBase = (void *) flashBuf0,
              .regionSize = 0x4000
          },
          /* CONFIG_NVSHOMEKIT */
          {
              .regionBase = (void *) flashBuf1,
              .regionSize = 0x4000
          },
      };

      #define CONFIG_NVS_COUNT 2

      const NVS_Config NVS_config[CONFIG_NVS_COUNT] = {
          /* CONFIG_NVSINTERNAL */
          {
              .fxnTablePtr = &NVSCC26XX_fxnTable,
              .object = &nvsCC26XXObjects[0],
              .hwAttrs = &nvsCC26XXHWAttrs[0],
          },
          /* CONFIG_NVSHOMEKIT */
          {
              .fxnTablePtr = &NVSCC26XX_fxnTable,
              .object = &nvsCC26XXObjects[1],
              .hwAttrs = &nvsCC26XXHWAttrs[1],
          },
      };

      const uint_least8_t NVS_count = CONFIG_NVS_COUNT;
      Show
      As a workaround, the user may remove the NVS SysConfig configuration and instead provide their own NVS config in a separate file compiled with their application. A working example of this is attached, note that the corresponding CONFIG_NVSname defines with the appropriate NVS index will also need to be declared where needed, e.g.: #define CONFIG_NVSINTERNAL 0 #define CONFIG_NVSHOMEKIT 1 Example custom.c file: #if defined(__TI_COMPILER_VERSION__) #pragma LOCATION(flashBuf0, 0x48000); #pragma NOINIT(flashBuf0); static char flashBuf0[0x4000]; #pragma LOCATION(flashBuf1, 0x4c000); #pragma NOINIT(flashBuf1); static char flashBuf1[0x4000]; #elif defined(__IAR_SYSTEMS_ICC__) __no_init static char flashBuf0[0x4000] @ 0x48000; __no_init static char flashBuf1[0x4000] @ 0x4c000; #elif defined(__GNUC__) __attribute__ ((section (".nvs"))) static char flashBuf0[0x4000]; __attribute__ ((section (".nvs"))) static char flashBuf1[0x4000]; #endif NVSCC26XX_Object nvsCC26XXObjects[2]; static const NVSCC26XX_HWAttrs nvsCC26XXHWAttrs[2] = {     /* CONFIG_NVSINTERNAL */     {         .regionBase = (void *) flashBuf0,         .regionSize = 0x4000     },     /* CONFIG_NVSHOMEKIT */     {         .regionBase = (void *) flashBuf1,         .regionSize = 0x4000     }, }; #define CONFIG_NVS_COUNT 2 const NVS_Config NVS_config[CONFIG_NVS_COUNT] = {     /* CONFIG_NVSINTERNAL */     {         .fxnTablePtr = &NVSCC26XX_fxnTable,         .object = &nvsCC26XXObjects[0],         .hwAttrs = &nvsCC26XXHWAttrs[0],     },     /* CONFIG_NVSHOMEKIT */     {         .fxnTablePtr = &NVSCC26XX_fxnTable,         .object = &nvsCC26XXObjects[1],         .hwAttrs = &nvsCC26XXHWAttrs[1],     }, }; const uint_least8_t NVS_count = CONFIG_NVS_COUNT;

    Description

      Multiple NVS instances use the same buffer (SysConfig issue)

      Attachments

        Activity

          People

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: