Bootloader for MC9S12xDP512 to erase and program at a certain area

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Bootloader for MC9S12xDP512 to erase and program at a certain area

1,463 次查看
serkanakbulut
Contributor I

Hello Everyone,

 

We are using MC9S12xDP512 controller for our project. Currently we are using Softec and P&E tools to flash our .s19 files.

we were using  attached code to erase all are and program all area.(I found the code in community discussion)

But now we need to erase and program at a certain area.

 

I wrote an example function to do it. I am erasing the area but cant programing :S.

So i think  ı am missing somewhere.İf you see please let me now.

Thank You.

Here is the code.;     Consider that function is in the attached project ,boot.c.

http://speedy.sh/dZ6n4/S12XBootLoader.zip

 

uchar MyData= { 0x11,0x22,0x33,0x44,0x55,0x66,0x77, 0x11,0x22,0x33,0x44,0x55,0x66,0x77, 0x11,0x22,0x33,0x44,0x55,0x66,0x77, 0x11,0x22,0x33,0x44,0x55,0x66,0x77, 0x11,0x22,0x33,0x44,0x55,0x66,0x77, 0x11,0x22,0x33,0x44,0x55,0x66,0x77, }; int ProgramCertainArea (void) {  ulong  GlobalAddress=0x7EC000;    uchar *PPAGEWinAddr; if(EraseFlashCmd(GlobalAddress, SectorEraseCmd)==1)  OutStr("E"); else  OutStr("S");  PPAGEVal = (GlobalAddress - 0x400000) / FPageWsize;  PPAGEWinAddr = (uchar *)(((GlobalAddress - 0x400000) % FPageWsize) + FPageWstart); if(ProgFlashBlock(PPAGEVal, (uint *)PPAGEWinAddr, (uint *)&MyData, 21)==1)  OutStr("E"); else  OutStr("S"); }
标签 (1)
0 项奖励
回复
2 回复数

926 次查看
serkanakbulut
Contributor I

Is ıt about unsecuring the MCU in Special Single Chip Mode?

Or I should look Flash Protection and Flash Security topics.

0 项奖励
回复

926 次查看
iggi
NXP Employee
NXP Employee

Hello,

I'm not sure why you cannot program the MCU after erasing it, but i doubt it's because it is secured.

Anyway, regarding the Flash security feature and how to unsecure an MCU, see this document:
https://community.freescale.com/docs/DOC-93803

Attached is a CodeWarrior example project written for MC9S12XDP512 device demonstrating Flash R/W routines.

Regards,

Ivan

0 项奖励
回复