Hi,
Have you tried the MCUXpresso SDK software Flash driver for MK12DX128xxx5 chip?
I would recommend customer try with MCUXpresso SDK software package for MK12DX128xxx5 chip.
Please check if that Flash driver demo also has the same issue about IAR compiler optimize setting.
The flash driver difference between MK10DX128xxx5 and MK12DX128xxx5 is very tiny. The most Flash commands are same. While, I still recommend customer use MCUXpresso SDK flash driver for MK12DX128xxx5 chip.
Wish it helps.
Have a great day,
Mike
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------