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.

CC3135: sl_FsProgram error code

Part Number: CC3135
Other Parts Discussed in Thread: UNIFLASH

Hi,

I am trying to firmware update the CC3135 with sl_FsProgram but it return "-673378300".

What does that mean? i can't find it in errors.h.

Furthermore, do you have some example code on sl_FsProgram except what i can find in "fs.h". I am using chunk size 4096. Should that be lower due to " MAX_NVMEM_CHUNK_SIZE = 1456" ?

Thanks in advance

br,

Casper

  • This error code is not recognized. It definitely suggests that something wrong had happened.

    Depending on the implementation of "fread", the chunk size of 4096 can make an issue (it should update the offset by number of bytes read rather than by the number of byte requested and may issue several sl_FsRead transactions to return the user request). Did you try updating the 4096 to 1456?

    You can send us a capture of the NWP log (see ch 20.1 in https://www.ti.com/lit/swru455) so we can try to debug the issue. Or send you exact programming code so we can try to reproduce the issue.

    Br,

    Kobi

  • I don't have access to "fread" and other functions in stdio.h which is why i tried to make a workaround. I found out that "-673378300" means ErrorNum = -10275 (SL_ERROR_FS_PROGRAMMING_ILLEGAL_FILE) and ExtendedErrorNum = 4100. Chunk size doesn't seem to matter, i still get the same errorcode.

    The file i am using is this:

    simplelink_cc32xx_sdk_3_40_00_05\tools\cc32xx_tools\servicepack-cc3x35\sp_4.5.0.11_3.1.0.5_3.1.0.25.ucf

    Which i then exported to C and loaded into our code

      bytesRead = sizeof(wifi_fwupdate_file_sp_4_5_0_11_3_1_0_5_3_1_0_25);  
      while ( bytesRead )
      {
        slRetVal =  sl_FsProgram( &wifi_fwupdate_file_sp_4_5_0_11_3_1_0_5_3_1_0_25[bytesRead] , PROGRAMMING_CHUNK_SIZE , NULL,  0 );
        if(slRetVal ==  SL_API_ABORTED)//timeout
        {
          break;
          //return( slRetVal );
        }
        else if (slRetVal < 0 )//error
        {
          ErrorNum = (long)slRetVal >> 16;
          ExtendedErrorNum = (_u16)(slRetVal & 0xFFFF);
          break;
        }
        if(slRetVal == 0)//finished succesfully
        {
          break;
        }    
        bytesRead -= PROGRAMMING_CHUNK_SIZE;
        if(bytesRead < 0)
        {
          bytesRead += PROGRAMMING_CHUNK_SIZE;
          chunk_size_remaining = bytesRead;
          slRetVal =  sl_FsProgram( &wifi_fwupdate_file_sp_4_5_0_11_3_1_0_5_3_1_0_25[bytesRead] , chunk_size_remaining , NULL,  0 );
          break;
        }
      }

  • The sl_FsProgramming can be used with the service-pack ucf. It require a programming image ucf (one that can create with Uniflash/Image-Creator and now also with CCS). Theoretically you can create a image that contains the SP (but during the creation the uniflash will add several other configuration files) that you can with sl_FsProgram, but the right solution (assuming you only want to update the SP) is to write it as a file using the simplelink file-system API (sl_FsOpen("sys/servicepack.ucf") / sl_FsWrite / sl_FsClose(signature)). 

    I'm not sure what do you mean by "don't have access to fread".

  • Thanks. It works with the programming image created in UniFlash.

    I have already implemented sl_FsOpen/sl_FsWrite and sl_FsClose but i would use sl_FsProgram for initial programming.

    Another question: When i try to downgrade the service pack from (sp_4.10.0.1_3.7.0.1_3.1.0.26) to (sp_4.5.0.11_3.1.0.5_3.1.0.25) then i get the following error: SL_ERROR_FS_CERT_STORE_OR_SP_DOWNGRADE

    Is there a correct way to avoid this? or should i just program it twice, it seems like it deletes the service pack during first programming.

  • no, you can't downgrade the SP (this is not true for any SP version, but there are points that prevents the downgrade). It is a security feature.

    You can program the entire image with the older SP.