any update ..??
Apologies my bad. The sflash_write API does throw error if the sflash is written without erasing.
Kindly erase the flash before writing new content. Based on Sflash_write.c file, the contents of sflash are verified before writing. if the contents are same, it is not overwritten. If the contents mismatch, the flash sector is erased using sflash_sector_erase and than written.
Is your issue resolved?