I having some trouble writing to the internal Flash memory, I can erase the flash blocks fine.
I think my problem is I am not really understanding the steps in the MPC manual for programming.
Ignoring the process of unlocking the blocks (which I'm sure I have right), the MPC manual states:
"Write the first address to be programmed in the flash module with the program data."
A sampe of my code I am using for testing is to write the data $12345678 to address 0x0006_0000
lis r12,6 ; Hardcode to address $60000 for testing
ori r11,r11,5678 ; Try to write 12345678 to $60000
Then turn on the EHV bit.
But this doesn't work, in fact it makes the CPU reset.
Am I missing something?