KV31F Tower havings issues with PE and Flash driver combo

I have run both the flash_example and flash_demo and simply tried replicating this logic within a new project (for a bootloader) using Processor Expert. I am aware of the demo/example using the bare metal platform library rather than PE but that appears to be the only difference. My main issue appears to be centered around: