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.

CC3235MODSF: Writing the Service Pack API - Signature and Confirmation

Part Number: CC3235MODSF

Hi,

I am trying to update the service command using the SimpleLink API/AT Wifi Commands. I don't want to reprogram the whole wifi module, so I'm using the AT+fileWrite command. I have two questions.

First - I know that the service pack needs to be closed with its signature, but what I'm doing doesn't seem to be working. This is the command that, based on the "SimpleLink Wi-Fi AT Command User's Guide", I am sending:

AT+fileClose=340588583,,3d115b452f22c81ebf830863fce98d53e63db662

Which has the format: 

AT+fileClose=[fileHandle],[NULL],[SHA1 signature]

When I send this, I get a '-5' error, which doesn't appear in the "SimpleLink CC31xx/CC32xx Host Driver" error.h list. From what I can tell looking at the wifi module source code, '-5' might refer to the STRMPL_ERROR_WRONG_SIZE error. I tried sending it a shorter signature of made-up characters, and I received an "OK" response back. From that, I think that the signature that I've included is too long, but I'm not sure how to format it. My understanding is that SHA-1 is generally formatted with 40-symbol hex values. How should I be formatting it?

My second question is how do I know that the service pack write was successful? When I send a short, nonsense signature in fileClose, it responds with "OK", even though it shouldn't have been a successful write with a bad signature. Is there a way to do a service pack version check?

  • Hi Anna,

    I noticed two strange things about you command initially. First, the signature should be much longer than what you are sending. The signature can be found in the SDK tools folder (in my case the path is C:\ti\simplelink_cc32xx_sdk_6_10_00_05\tools\cc32xx_tools\servicepack-cc3x35). Second, when you’re updating our gen 2 devices (CC32xx) you need to use SHA2, not SHA1 (but anyway you can’t calculate the signature as you miss the private key – you should use the signature we provide).

    For both of your questions I will need some time to check where the error is coming from. I’ll get back to you in 1 to 2 business days.

  •  Hi Anna,

    1. Go to line 315 of atcmd_file.c in the SDK and change ATCMDFILE_SHA256_LEN to 256. This should be in ATCmdFile_closeParse() in the if statement under the commented /*Signature*/. (Path is simplelink_cc32xx_sdk_6_10_00_05/source/ti/net/atcmd/)

        /* Signature */
        if ((ret = StrMpl_getAllocStr(&buff, (char **)&params->signature, ATCMD_DELIM_TRM, 256 ,ATCmd_excludeDelimStr)) < 0)
        {
            if (ret != STRMPL_ERROR_PARAM_MISSING)
            {
                return ret;
            }
            ret = 0;
        }
    

    2. Build the core files for atcmd (gmake.exe). Documentation for this process can be found here: file:///C:/ti/simplelink_cc32xx_sdk_6_10_00_05/docs/simplelink_mcu_sdk/Quick_Start_Guide.html#build-core-libs)  

    3. Finally, when using the AT+fileclose command, the third input should be the signature

  • Thanks for looking into this. Does this mean that it's not possible to write the service pack without altering build? With the boards that I'm working on, I don't have an easy way to reprogram them, which is why I wanted to write the service pack instead of building a new image. 

  • Correct, you must change the build to repair the signature length.