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.

CC3200: Trouble writing /sys/mcuimgA.bin to flash

Part Number: CC3200
Other Parts Discussed in Thread: UNIFLASH

I'm adding custom OTA capability from a TFTP server.  During the update process, I'm opening the file in flash but getting an error returned (-23) from sl_extlib_FlcWriteFile when I write.

I've created /sys/mcuimg2.bin and /sys/mcuimg3.bin in the file system via uniflash.

Here's the relevant code:

		lRetVal = sl_extlib_FlcOpenFile ("\sys\mcuimgA.bin", 200000, 0, pFileHandle, FS_MODE_OPEN_WRITE);
		if(lRetVal!=0)
			{
			Report("Error opening file on flash: %i\r\n",lRetVal);
			}

		lRetVal = sl_extlib_FlcWriteFile (pFileHandle, 0, pbuffer, buf_size);
		if(lRetVal!=0)
			{
			Report("Error writing to file in flash: %i\r\n",lRetVal);
			}

		lRetVal = sl_extlib_FlcCloseFile (pFileHandle, 0, 0, 0);
		if(lRetVal!=0)
			{
			Report("Error closing file: %i\r\n",lRetVal);
			}

What is sl_extlib_FlcWriteFile return -23? 

Any ideas what could be the problem?

Thanks,

Alex

  • Hi Alex,

    -23 means "SL_FS_ERR_FILE_ACCESS_IS_DIFFERENT" see "Simplelink/include/fs.h".
    As response to FsWrite, this indicates that the file was not opened for write.
    In your case everything seems ok.

    However, the "sl_extlib_FlcWriteFile" expects to get the fileHandle itself (_i32) and not the pointer that is received from the Open request.

    br,
    Kobi