Dear PW,
I don't know if I got you right, if you are programming internal flash or external IIC flash. Both are possible but the first one has limitations depending on the architecture you're using, e.g. you need to be executing in RAM in order to program flash.
Cheers,
Celso