The granularity of the erased section depends on the target device. The smallest size of Flash memory that can be erased is defined by the Flash sector size.
Follow the How to erase a specific Flash Memory region how-to guide in winIDEA Help, which describes how to erase a part of a Flash memory with an attached Python script.