How to actual delete file from flash memory in xbee 3

Well hey everyone,

I have kind of asked this question in an other topic of mine, but it was mixed with some other questions, so I took the initiative to create a new topic, so that it doesn’t get lost…

My equipment is an XBee 3 RF Zigbee module.

My issue is that I cannot release the flash memory occupied from a file, that I created. I am using uos.remove and the file is not listed anymore in uos.listdir (nor in XCTU’s file manager), but the flash memory doesn’t regain its size! The occupied flash memory, is only freed by formating the flash, something which is not helpful at all.

Any ideas and help about what could solve this problem is welcomed!

You can only recover the flash if the file you want to remove is the last file that was uploaded to it.

Have you tried using uos.sync() ? I have had to do that to get files I created to show up, it might work in reverse for deleting files

Thank you for your answers!

@plater thanks for the idea!
Fortunately, I managed to solve this by first updating the firmware…It seems like uos.remove method was not working properly in some older version of the firmware or something…
Anyway, updating the firmware and deleting (with uos.remove) the last file that shows up when you type uos.listdir() actually freed the specific part of the flash memory without having to (re)format it (and thus losing all files).