This is documented on the MBED Site for devices with a bootloader need to use erase=sector instead of chip.
erase=sector