Hi,
I was trying to format the flash storage as just one partition with the full size, and tried the method
mbed::MBRBlockDevice::partition(&root, 1, 0x0B, 0);
without the last argument, that should partition the whole device size. But in this case instead of 16MB on the partition table it showed as 16TB or something like that. From that point on, just trying partition it again locked the device.
For anyone with similar issues, I ended uploading the sketch to use the giga as a mass storage media usb, and fixed the partitions with an app called bootice from this page: Restore USB drives back to full capacity ▷ Format & reset USB (pendrivelinux.com)
as suggested by this mbed doc: deadmbed - Cookbook | Mbed