ColdFire MDF52259C Bootloader with Processor Expert

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ColdFire MDF52259C Bootloader with Processor Expert

Jump to solution
3,751 Views
CristianPena
Contributor I

Hello,

 

    I'm working on a generic Bootloader based on the AN3927. I've carefully followed the steps to modify the project: made a new vectors table and forced it to possition zero in the flash, errased the flash protection configurations, modified the LCF file (I had to freeze the Processor expert for that), added parser, usr_entry and bootloader files, added the USER_ENTRY MARK with the NOP and JMP at the correct location. The software copies the firmware vector table in ram and changes the VBR.

   After all this changes, I still was able to compile it and make it. I downloaded it to the flash but when I try to run it with the debugger I get 

          Memory write verify failure

        Memory write to address 0x357aef6 failed to verify: expected value 0x40d, actual value 0. Retry?

 

I used to get error messages like that when I forgot to make the project with the last modifications and flashed the device. I don't get programming nor blank check errors.

 

 

  Any idea that could help??

 

Thank you!

 

Cristian Pena

0 Kudos
Reply
1 Solution
2,446 Views
Mark_G
Contributor II

Hi,

 

Thanks for the reply.  For reference I'm using CW 7.2.2 and PE 1.05.  I actually discovered the bug causing my problems this morning.  The example code uses this code snippet to copy the Vector Table to RAM:

 

  word *pdst,*psrc;
  byte i;
   
  pdst=(word*)0x20000000;
  psrc=(word*)0x00004000;

  for (i=0;i<0xC0;i++,pdst++,psrc++)
  {
    *pdst=*psrc;
  }

 

It's using a word pointer but each vector is of size dword so only half of the vector table actually gets copied.  So any interrupt before 0x60 was working.  'DTIM0_Compare' interrupt is at 0x53.  When I changed to the 'GPT_Channel_0' interrupt source it stopped working becuase it's at 0x6C.  After changing the code above to use dword pointers, I now see the entire table being copied and everything works.  Hopefully this will save someone else a day's worth of scratching their head.

 

Mark

View solution in original post

0 Kudos
Reply
5 Replies
2,446 Views
ProcessorExpert
Senior Contributor III

 

Hello,
  
please find attached Processor Expert bootloader demo project based on AN3927. It has been created and tested with CW V7.1.2 and PE 1.04. I hope that it will help you. For more details please see the pe_readme.txt file enclosed in projects.
  
best regards
Vojtech Filip
Processor Expert Support Team

 

 

2,446 Views
Mark_G
Contributor II

Hi,

 

I've used the attached project(PE_bootloader_AN3927_CFV2_blink) as an example for the changes required in my own application code but I keep hitting a Cpu_Interrupt().  I confirmed that the vector table is being copied to RAM and the VBR is being set to 0x20000000. 

 

When I started modifying the example project, I ran into the same Cpu_Interrupt() problem by simply changing the TI1 interrupt source from 'DTIM0_Compare' to 'GPT_Channel_0'.  I can't figure out what I'm missing that would cause the difference in behavior between these two interrupts, but I'm hoping this will give me a clue to get my own project working. 

 

Thanks for your help!

 

- Mark

0 Kudos
Reply
2,446 Views
jiri_rezler
NXP Employee
NXP Employee

Hello

 

Which version of Cw do you use? (Projects mentioned above are tested with Cw 7.1.2, PE 1.04).

Could you please send your project?

 

Best regards

Jiri Rezler

0 Kudos
Reply
2,447 Views
Mark_G
Contributor II

Hi,

 

Thanks for the reply.  For reference I'm using CW 7.2.2 and PE 1.05.  I actually discovered the bug causing my problems this morning.  The example code uses this code snippet to copy the Vector Table to RAM:

 

  word *pdst,*psrc;
  byte i;
   
  pdst=(word*)0x20000000;
  psrc=(word*)0x00004000;

  for (i=0;i<0xC0;i++,pdst++,psrc++)
  {
    *pdst=*psrc;
  }

 

It's using a word pointer but each vector is of size dword so only half of the vector table actually gets copied.  So any interrupt before 0x60 was working.  'DTIM0_Compare' interrupt is at 0x53.  When I changed to the 'GPT_Channel_0' interrupt source it stopped working becuase it's at 0x6C.  After changing the code above to use dword pointers, I now see the entire table being copied and everything works.  Hopefully this will save someone else a day's worth of scratching their head.

 

Mark

0 Kudos
Reply
2,446 Views
cw_weldon
Contributor I

I got a similar error message when I ran a demo project over SDRAM target. It turns out my new computer is the culprit.

 

This is a USB 2.0 issue that occurs when the port runs at its highest speed and overruns the probe interface (USB Multilink). You may need to run the USB interface at the slower USB 1.1 speed to elimiate the problem.

 

You can find more info in FAQ-29039.

0 Kudos
Reply