3 Replies Latest reply on May 21, 2020 6:59 AM by NaFi_2915566

    Application DCT changes on reset

    NaFi_2915566

      I defined a structure within our application DCT and increased DCT size accordingly.

      There are no write commands for the application DCT area.

      I added multiple lock/read/print/unlock cycles to make it is not an unlock

       

      Problem:

      • the DCT contents are loaded correctly when I load the code via JTAG but some parts are changed after a reset. 
      • the changed values are always changed to the same values,which points to another part of the code overwriting application DCT
      • we have code that writes to DCT_WIFI_CONFIG_SECTION to update wifi credentials

       

      Questions:

      1. are there any other changes needed besides updating dct.ld?  Based on where the the overwrite is happening, it s past the old DCT.
      2. read_lock / read_unlock should not change the contents, right?

       

      dct.ld increased from 16k to 64k:

      MEMORY
      {
      /*    DCT1_FLASH                 (rx)  : ORIGIN = 0x0, LENGTH = 16K */
          DCT1_FLASH                 (rx)  : ORIGIN = 0x0, LENGTH = 64K
      }
      

       

      application_dct.h (some names are obscured)

      #define DCT_SCHEMA_VERSION     1
      #define DCT_CONFIG_FILE_SIZE   (20*1024)
      #define DCT_WIFI_FILE_SIZE     (2*1024)
      
      pragma pack (1)
      typedef struct
      {
         //overall content
         uint32_t schemaVersion;                       // BUILD
         uint32_t dummyTop[7];                         // FFS
         
         // configuration.json
         uint32_t configJsonSize;                      // redundant size of string
         uint32_t dummyConfigJson[7];                  // FFS
         char     configJsonStr[DCT_CONFIG_FILE_SIZE]; // BUILD
         
         // wifi.json
         uint32_t wifiJsonSize;                        // redundant size of string
         uint32_t dummyWifiJson[7];                    // FFS
         char     wifiJsonStr[DCT_WIFI_FILE_SIZE];     // BUILD
      } ...Dct_t;
      #pragma pack ()
      } ...Dct_t;
      #pragma pack ()
      

       

      application_dct.c

      DEFINE_APP_DCT(...Dct_t)
      {
         .schemaVersion   = DCT_SCHEMA_VERSION,
         .dummyTop        = {0,1,2,3,4,5,6},
         .configJsonSize  = 6,
         .dummyConfigJson = {0,7,8,9,0xA,0xB,0xC},
         .configJsonStr   = "config",
         .wifiJsonSize    = 4,
         .dummyWifiJson   = {0,0xD,0xE,0xF,1,2,3},
         .wifiJsonStr     = "wifi"
      };
      

       

      application

         ...Dct_t *...Dct=NULL;
      

       

      during startup,the application runs the following code three times

         // First check DCT to see if it has a valid file
         wResult = wiced_dct_read_lock( (void**) &...Dct, WICED_TRUE, DCT_APP_SECTION, 0, sizeof( ...Dct_t ) );
         if ( wResult == WICED_SUCCESS)
         {
               WPRINT_APP_DEBUG( ( "APP DCT\n" ) );
               WPRINT_APP_DEBUG( ( " schemaVersion   : %lu\n",datablizzard2Dct->schemaVersion ) );
               DEBUG_HEX_DUMP    ( " dummyTop        :",datablizzard2Dct->dummyTop,7);
               WPRINT_APP_DEBUG( ( " configJsonSize  : %lu\n",datablizzard2Dct->configJsonSize ) );
               DEBUG_HEX_DUMP    ( " dummyConfigJson :",datablizzard2Dct->dummyConfigJson,7);
               WPRINT_APP_DEBUG( ( " configJsonStr   : %.10s\n",datablizzard2Dct->configJsonStr ) );
               WPRINT_APP_DEBUG( ( " wifiJsonSize    : %lu\n",datablizzard2Dct->wifiJsonSize ) );
               DEBUG_HEX_DUMP    ( " dummyWifiJson   :",datablizzard2Dct->dummyWifiJson,7);
               WPRINT_APP_DEBUG( ( " wifiJsonStr     : %.10s\n",datablizzard2Dct->wifiJsonStr ) );
            // done with DCT, close it
            wResult = wiced_dct_read_unlock( ...Dct, WICED_TRUE );
            if ( wResult != WICED_SUCCESS)
            {
               WPRINT_APP_ERROR( ( "%s wiced_dct_read_unlock failed: %u\n", __FUNCTION__, wResult) );
            }
            else
            {
               WPRINT_APP_DEBUG( ( "%s wiced_dct_read_unlock done\n", __FUNCTION__) );
            }         
         }   
      

       

      the attached log file shows the correct DCT being printed 3 times.

      then following a reset, some of the values are changed.

        • 1. Re: Application DCT changes on reset
          NaFi_2915566

          (10:11:03.566)

          (10:11:03.566) Starting WICED vWiced_006.002.001.0002

          (10:11:03.566) Platform DataBlizzard2_Rev_A initialised

          (10:11:03.566) Started ThreadX v5.8

          (10:11:03.566) Initialising NetX_Duo v5.10_sp3

          (10:11:03.566) Creating Packet pools

          (10:11:03.945) WLAN MAC Address : 10:98:C3:70:9C:1C<CR>

          (10:11:03.945) WLAN Firmware    : wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905<CR>

          (10:11:03.945) WLAN CLM         : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-05-15 19:33:15 <CR>

          (10:11:03.945) Set UI State to 1

          (10:11:03.945) start configuration thread

          (10:11:03.945)   configuration thread started (5886836)

          (10:11:03.945) APP DCT

          (10:11:03.945)  schemaVersion   : 1

          (10:11:03.945)  dummyTop        : [00000000,00000001,00000002,00000003,00000004,00000005,00000006,]

          (10:11:03.945)  configJsonSize  : 6

          (10:11:03.945)  dummyConfigJson : [00000000,00000007,00000008,00000009,0000000A,0000000B,0000000C,]

          (10:11:03.945)  configJsonStr   : config

          (10:11:03.945)  wifiJsonSize    : 4

          (10:11:03.945)  dummyWifiJson   : [00000000,0000000D,0000000E,0000000F,00000001,00000002,00000003,]

          (10:11:03.945)  wifiJsonStr     : wifi

          (10:11:03.945) ParseWifiJson wiced_dct_read_unlock done

          (10:11:03.945) APP DCT

          (10:11:03.945)  schemaVersion   : 1

          (10:11:03.945)  dummyTop        : [00000000,00000001,00000002,00000003,00000004,00000005,00000006,]

          (10:11:03.945)  configJsonSize  : 6

          (10:11:03.945)  dummyConfigJson : [00000000,00000007,00000008,00000009,0000000A,0000000B,0000000C,]

          (10:11:03.945)  configJsonStr   : config

          (10:11:03.945)  wifiJsonSize    : 4

          (10:11:03.945)  dummyWifiJson   : [00000000,0000000D,0000000E,0000000F,00000001,00000002,00000003,]

          (10:11:03.945)  wifiJsonStr     : wifi

          (10:11:03.945) ParseWifiJson wiced_dct_read_unlock done

          (10:11:03.945) APP DCT

          (10:11:03.945)  schemaVersion   : 1

          (10:11:03.945)  dummyTop        : [00000000,00000001,00000002,00000003,00000004,00000005,00000006,]

          (10:11:03.945)  configJsonSize  : 6

          (10:11:03.945)  dummyConfigJson : [00000000,00000007,00000008,00000009,0000000A,0000000B,0000000C,]

          (10:11:03.945)  configJsonStr   : config

          (10:11:03.945)  wifiJsonSize    : 4

          (10:11:03.945)  dummyWifiJson   : [00000000,0000000D,0000000E,0000000F,00000001,00000002,00000003,]

          (10:11:03.945)  wifiJsonStr     : wifi

          (10:11:03.945) ParseWifiJson wiced_dct_read_unlock done

          (10:11:03.945)

           

           

          <<<<<<<<<<<<< MANUAL RESET >>>>>>>>>>>>>>>>

           

           

          (10:11:11.315) Starting WICED vWiced_006.002.001.0002

          (10:11:11.315) Platform DataBlizzard2_Rev_A initialised

          (10:11:11.381) Started ThreadX v5.8

          (10:11:11.381) Initialising NetX_Duo v5.10_sp3

          (10:11:11.381) Creating Packet pools

          (10:11:11.728) WLAN MAC Address : 10:98:C3:70:9C:1C<CR>

          (10:11:11.728) WLAN Firmware    : wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905<CR>

          (10:11:11.728) WLAN CLM         : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-05-15 19:33:15 <CR>

          (10:11:11.728) Set UI State to 1

          (10:11:11.728) start configuration thread

          (10:11:11.728)   configuration thread started (5886836)

          (10:11:11.728) APP DCT

          (10:11:11.728)  schemaVersion   : 1

          (10:11:11.728)  dummyTop        : [00000000,00000001,00000002,00000003,00000004,00000005,00000006,]

          (10:11:11.728)  configJsonSize  : 6

          (10:11:11.728)  dummyConfigJson : [00000000,00000007,00000008,00000009,0000000A,0000000B,0000000C,]

          (10:11:11.728)  configJsonStr   : config

          (10:11:11.728)  wifiJsonSize    : 3993371137

          (10:11:11.728)  dummyWifiJson   : [EE062F51,F7FF3F91,F85DFFDE,BF00FB04,EE100000,F3C00F90,29002107,]

          (10:11:11.728)  wifiJsonStr     :

          (10:11:11.728) ParseWifiJson wiced_dct_read_unlock done

          (10:11:11.728) APP DCT

          (10:11:11.728)  schemaVersion   : 1

          (10:11:11.728)  dummyTop        : [00000000,00000001,00000002,00000003,00000004,00000005,00000006,]

          (10:11:11.728)  configJsonSize  : 6

          (10:11:11.728)  dummyConfigJson : [00000000,00000007,00000008,00000009,0000000A,0000000B,0000000C,]

          (10:11:11.728)  configJsonStr   : config

          (10:11:11.728)  wifiJsonSize    : 3993371137

          (10:11:11.728)  dummyWifiJson   : [EE062F51,F7FF3F91,F85DFFDE,BF00FB04,EE100000,F3C00F90,29002107,]

          (10:11:11.728)  wifiJsonStr     :

          (10:11:11.728) ParseWifiJson wiced_dct_read_unlock done

          (10:11:11.728) APP DCT

          (10:11:11.728)  schemaVersion   : 1

          (10:11:11.728)  dummyTop        : [00000000,00000001,00000002,00000003,00000004,00000005,00000006,]

          (10:11:11.728)  configJsonSize  : 6

          (10:11:11.728)  dummyConfigJson : [00000000,00000007,00000008,00000009,0000000A,0000000B,0000000C,]

          (10:11:11.728)  configJsonStr   : config

          (10:11:11.728)  wifiJsonSize    : 3993371137

          (10:11:11.728)  dummyWifiJson   : [EE062F51,F7FF3F91,F85DFFDE,BF00FB04,EE100000,F3C00F90,29002107,]

          (10:11:11.728)  wifiJsonStr     :

          (10:11:11.728) ParseWifiJson wiced_dct_read_unlock done

          (10:11:11.728)

           

           

          <<<<<<<<<<<<< MANUAL RESET >>>>>>>>>>>>>>>>

           

           

          (10:11:20.716) Starting WICED vWiced_006.002.001.0002

          (10:11:20.804) Platform DataBlizzard2_Rev_A initialised

          (10:11:20.804) Started ThreadX v5.8

          (10:11:20.804) Initialising NetX_Duo v5.10_sp3

          (10:11:20.804) Creating Packet pools

          (10:11:21.131) WLAN MAC Address : 10:98:C3:70:9C:1C<CR>

          (10:11:21.131) WLAN Firmware    : wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905<CR>

          (10:11:21.131) WLAN CLM         : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-05-15 19:33:15 <CR>

          (10:11:21.131) Set UI State to 1

          (10:11:21.131) start configuration thread

          (10:11:21.131)   configuration thread started (5886836)

          (10:11:21.131) APP DCT

          (10:11:21.131)  schemaVersion   : 1

          (10:11:21.131)  dummyTop        : [00000000,00000001,00000002,00000003,00000004,00000005,00000006,]

          (10:11:21.131)  configJsonSize  : 6

          (10:11:21.131)  dummyConfigJson : [00000000,00000007,00000008,00000009,0000000A,0000000B,0000000C,]

          (10:11:21.131)  configJsonStr   : config

          (10:11:21.131)  wifiJsonSize    : 3993371137

          (10:11:21.131)  dummyWifiJson   : [EE062F51,F7FF3F91,F85DFFDE,BF00FB04,EE100000,F3C00F90,29002107,]

          (10:11:21.131)  wifiJsonStr     :

          (10:11:21.131) ParseWifiJson wiced_dct_read_unlock done

          (10:11:21.131) APP DCT

          (10:11:21.131)  schemaVersion   : 1

          (10:11:21.131)  dummyTop        : [00000000,00000001,00000002,00000003,00000004,00000005,00000006,]

          (10:11:21.131)  configJsonSize  : 6

          (10:11:21.131)  dummyConfigJson : [00000000,00000007,00000008,00000009,0000000A,0000000B,0000000C,]

          (10:11:21.131)  configJsonStr   : config

          (10:11:21.131)  wifiJsonSize    : 3993371137

          (10:11:21.131)  dummyWifiJson   : [EE062F51,F7FF3F91,F85DFFDE,BF00FB04,EE100000,F3C00F90,29002107,]

          (10:11:21.131)  wifiJsonStr     :

          (10:11:21.131) ParseWifiJson wiced_dct_read_unlock done

          (10:11:21.131) APP DCT

          (10:11:21.131)  schemaVersion   : 1

          (10:11:21.131)  dummyTop        : [00000000,00000001,00000002,00000003,00000004,00000005,00000006,]

          (10:11:21.131)  configJsonSize  : 6

          (10:11:21.131)  dummyConfigJson : [00000000,00000007,00000008,00000009,0000000A,0000000B,0000000C,]

          (10:11:21.131)  configJsonStr   : config

          (10:11:21.131)  wifiJsonSize    : 3993371137

          (10:11:21.131)  dummyWifiJson   : [EE062F51,F7FF3F91,F85DFFDE,BF00FB04,EE100000,F3C00F90,29002107,]

          (10:11:21.131)  wifiJsonStr     :

          (10:11:21.131) ParseWifiJson wiced_dct_read_unlock done

          (10:11:21.131)

          • 2. Re: Application DCT changes on reset
            RaktimR_11

            To increase the DCT, 3 files need to be modified,

            1. In the DCT.ld (/43xxx_Wi-Fi/WICED/platform/MCU/BCM4390x/GCC/dct.ld) where the DCT1_FLASH LENGTH needs to be modified based on the required length.

            2. In the waf_platform.h (/43xxx_Wi-Fi/WICED/platform/MCU/BCM4390x/WAF/waf_platform.h) file where the PLATFORM_DCT_COPY1_SIZE needs to be modified

            3. The memory address bases need to be modified according to the memory requirement in either normal_image_defines.mk(/43xxx_Wi-Fi/platforms/CYW943907AEVAL1F/) or the OTA2_image_defines.mk based on the ota2 or production use-case.

            1 of 1 people found this helpful
            • 3. Re: Application DCT changes on reset
              NaFi_2915566

              this solved my problem, thanks