TMS320F28388D: How can I write to F2838D's flash memory using Matlab Simulink?

Part Number: TMS320F28388D

Tool/software:

Hi,

I am programming the TMS320F28388D microcontroller using Simulink. I want to write a certain number of configuration parameters to flash memory. I can read data from a specific flash address using the Memory Copy block in Simulink. However, I have not been successful in writing to a flash address. I don't think I have successfully implemented FlashAPI and custom code in Simulink either. Below you can see the Simulink block I have set up. Is there an example of using FlashAPI? What steps should I follow to enable writing to flash memory?