Flash write

Hello 
      I want write in data flash.. i’m using board RA8 using flash_hp.but i got error when erase api called its shows CMD_LOCKED.. FASTAT register not set .. what should i do??

i got refrence code from ra8d1 example