Hello Zhengyu,
A1.
Please see the description below
danielmartynek_0-1609764036063.png
In other words, If the MCU has not been partitioned yet, the flash IFR is erased by default and FlexNVM is erased by the Program partition command anyway.
But if it has been already partitioned, you need to Mass erase the MCU before it can be partitioned again.
A2.
There is no such restriction. The application code can partition the MCU.
A3.
PFlash does not have to be erased before the FTFC Program Partition command is launched.
A4.
Hard to say what could be wrong.
A5.
The FTFC Program Partition command must be launched from flash memory.
The function that launches the command can be in SRAM or it can be done by the programmer.
danielmartynek_1-1609764499651.png
Regards,
Daniel