Other Parts Discussed in Thread: UNIFLASH
Tool/software: TI-RTOS
Hi,
I asked this earlier but still looking for some clarification.
I have two images on my flash and I am trying to copy one over the other. (more specifically, second image over sys/mcuflashimg.bin )
I can open both files and I am able to write but when I close mcuflashimg.bin I get the error SL_ERROR_FS_WRONG_SIGNATURE_SECURITY_ALERT (-10289). I think this is related to the signature I am trying to use to close the file. I followed the steps that were mentioned in another article ( http://dev.ti.com/tirex/content/simplelink_academy_cc32xxsdk_1_13_00_29/modules/wifi_secure_file_system/wifi_secure_file_system.html ) that described creating the signature for my mcuflashimg.bin. TEST_CERTIFICATE is defined as "dummy-trusted-cert". I am assuming that if I write over mcuflashimg.bin that I would need the signature of that file.
I create the signature using this command: openssl dgst -hex -c -sha1 -keyform DER -sign dummy-trusted-cert-key -out signature.hex.sign mcuflashimg.bin. Note: I attach a sha1 hash to the image then I create a signature for the entire image. Not sure if there are additional bytes that I need to include before creating the signature.
Here are the command I am use to open and close mcuflashimg.bin:
prod_lFileHandle = sl_FsOpen(MCU_LOCATION, SL_FS_WRITE ,0);
sl_FsWrite( prod_lFileHandle, (i*4096) , copied_buffer, 4096);
Status = sl_FsClose(prod_lFileHandle, TEST_CERTIFICATE, (const unsigned char *)originalSignature, sizeof(originalSignature));
Thanks,
Kevin