hi, I am trying to built the bootloader by ISO15765 base on the MC9S12XDP512 .
I had load a demo from freescale ,but find some "odd" questions:
1)when the ECU running in the BDM debug, it is correct to write/read the flash ---I can write the data to the flash and read the right back.
2)when the ECU running without BDM,it is wrong to write/read the flash ----when I read the flash that had been write ,it respone 0xFF ,not the data I had write.
I don't know what's wrong on my code, the MC9S12XDP512 bootloader demo is "XDP512-FLASH-EW-CW47" .
please help me to find what's wrong
thanks
Hi Jiannian,
Could you please clarify which function response 0xFF? I do not see any error code in software with this value.
I guess that problem could be in case of using mass erase and erase verify operations. In normal mode FCNFG_ BKSEL bits are not available. However these functions are not part of "XDP512-FLASH-EW-CW47" example code.
Problem could be also in case of modifying flash protection scenario. In special mode you can modify FPROT register to any value, however writes to FPROT register are restricted in normal mode – you can only increase protected area.
As template for your own bootloader code, you can use attached example code (load code over SCI) include short description, conversion tool and demo application.
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi RadekS,
Thank you very much.
It seems that if the flash clock does not accurate enough ,may lead to the problem. I had adjust the flash clock and it work.
thanks for you demo, I think it will help me .
thanks