SPI Flash File System - Out of memory rebooting

Hello, I am trying to implement the spiflashfilesystem on an imp003, and when I call sffs.init() the imp reboots and says out of memory. I am calling the init on the imp.onidle. My free memory before calling the init is ~110000. Is this enough for this class? Also, are there any examples for this class (besides the github repo)? I am attempting to replace a previous “linear” file system with this wear leveling class. Do I still need to call flash.enable() and disable in addition to the sffs.open() calls for example? Thanks in advance.

Perhaps if there is already data on the chip is the cause?

Some progress… Now I am getting error “null cannot be used as index (line 659)” when trying sffs.init(). I am thinking this has something to do with data present on the flash. I am attempting to build the file system code integration and I believe it is not writing/creating complete file correctly, so when i reboot and init, is gets caught up trying to read partial data? I wish I could post my code… Trying to replace linear file system with this wearleveling one utilized by recorder, playback, and chunker…

Can you erase the device and retest?

I made this startup code

`// Allocate the first 2MB to the file system
sffs <- SPIFlashFileSystem(0x000000, 0x200000, flash);

try {
sffs.init(function(files) {
// Log how many files we found
server.log(format(“Found %d files”, files.len()));
// Log all the information returned about each file:
foreach (file in files) {
server.log(format(" %d: %s (%d bytes)", file.id, file.fname, file.size));
}
});
} catch(error) {
server.log("Error init sffs: " + error);
sffs.eraseAll();
server.log(“Done erasing”);
}`

This does seem to erase the chip. From there it runs, but have other issues. I was hoping there was some examples somewhere I missed.