Flashing the M52223EVB - Connection Problems

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

Flashing the M52223EVB - Connection Problems

5,767 Views
PopsStack
Contributor I
I have been trying for some time now with no success. I have tried flashing both Stationery built code as well as the CMX provided USB Mass Storage stuff to the M52223EVB (Rev B Board). I have religously followed (I think) the Targeting Coldfire (PDF) document.
 
Each time I try do an erase I get a message saying failed to write - error in connection. So I presume it can't be a badly built project cause the erase must happen before attmepting to load the Flash.
 
I then tried to use the Hardware Diagnostics option - I get:
 
" Connect Failed : Can't conenct to PE micro via USB "
 
There must be something simple that I am missing out on.
 
Does the J1 jumper of BDM_Config or JTAG have anything to do with this. I have tried both - same story.
 
All my code generated under Console Debug gets things like the PIT, ADC etc running quite nicely.
 
Maybe I have not read an important document prior to this??????
 
That tall building down the road looks like a good option - I am getting desparate.
Labels (1)
0 Kudos
22 Replies

1,740 Views
lambtron
Contributor I
I am unable to program flash on my board. This used to work, but CodeWarrior crashed a few days ago and since then I haven't been able to program flash. I am running CodeWarrior v6.4 build 4, target is MCF52230, connected via USB-TAP.
 
 
Flash erasure seems to work ok. I get this log:
 
======================================================================
=== Execute: Erase
=== Timestamp:  Thu Sep 20 12:44:41 2007
=== Flash Device:         CFM_MCF52230
=== Flash Organization:   4Kx32x1
=== Flash Mem Start Addr: 0x00000000
=== Flash Mem End Addr:   0x0001FFFF
======================================================================
Using Algorithm: CFM_MCFCOMMON.elf
 
Loading Flash Device Driver at: 0x20000000
Flash Driver Buffer is at:      0x20001FB0
Flash Driver Buffer Size is:    0x00006050
Done
Initialization Command Succeeded
Erasing entire flash ... Done
Erase Command Succeeded
Timestamp:  Thu Sep 20 12:44:44 2007
: No Error
 

BUT, when I try to program flash I get this log:
 
======================================================================
=== Execute: Program
=== Timestamp:  Thu Sep 20 14:52:47 2007
=== Flash Device:         CFM_MCF52230
=== Flash Organization:   4Kx32x1
=== Flash Mem Start Addr: 0x00000000
=== Flash Mem End Addr:   0x0001FFFF
======================================================================
Using Algorithm: CFM_MCFCOMMON.elf
 
Loading Flash Device Driver at: 0x20000000
Flash Driver Buffer is at:      0x20001FB0
Flash Driver Buffer Size is:    0x00006050
Done
Initialization Command Succeeded
Programming file C:\blah.elf
Programming 0x00002747 bytes of Target Memory at 0x00000000
Flash Programmer:  Flash driver reports the following error(s):  Operation Unsupported  Timed Out  Chip reported Low VPP Error Status  Chip reported error during erase  Chip reported error during program  Device Protection Error
Timestamp:  Thu Sep 20 14:52:50 2007
 
 
Please help!
How can I get flash programming working again?
0 Kudos

1,740 Views
DrSeuss
Contributor I
Change the VBUS jumper to "HOST"
0 Kudos

1,740 Views
PopsStack
Contributor I
Hi Doc
 
Have the jumper on Host - still not working.
 
Attached is the XML file I got from the installation CD. I eventually edited the file myself and changed the base address for Flash to 0000_0000 up to 0000_3FFF and then all worked fine. So just need to hunt around for the reason why the mem stick not being reocognised.
 
Pops
 
Had trouble attaching a XML file so changed it to a .txt file.
0 Kudos

1,740 Views
DrSeuss
Contributor I
First try the flash stick on a PC.
Then plug it into the EVB and verify that the LED on the stick comes on. If not than you still have some kind of Vbus issue. Mearsure the voltage on the center pin of the Vbus jumper and make sure you have +5V.
0 Kudos

1,740 Views
Zeig
Contributor I
Hi,

If your problem has to do with the flash configuration, I had a similar problem.
I don't think my xml file was being read properly, but you shouldn't have a problem setting it up manually. Your original problem didn't look like the same thing, but I figured I'd throw this out there.

Here are the settings I use in the flash programmer in CW.
I'm working with a similar board (M52235EVB) and the memory settings are basically the same.

Target Memory Buffer Address: 0x20000000
Target Memory Buffer Size: 0x00008000
Flash Memory Base Address: 0x00000000

You might also have to check "Use Target Initialization" and pick the proper file for your board under "CodeWarrior\E68K_Support\Initialization_Files\".

Hopefully you might be able to erase the flash then.
0 Kudos

1,740 Views
Arev
Contributor III
Hello All,
Hardware USB Test Utility "Test_CFZ.zip" can be downloaded from PEmicro WebSite to check your USB connection with the P&E Wiggler.

I Hope this helps..

Bye
0 Kudos

1,740 Views
PopsStack
Contributor I
I have run a hardware test - on the CD provided by P&E. Tests out OK.
 
I went back and tried again - no joy. I get the feeling I have either got an incorrect config or initialisation file as I get an erro in the Status line showing:
 
" Error : could not write Flash driver to file - see details etc"
 
If I call up the Show Log option then the Flash Program Logger shows
 
Connecting.....connected
Execute : Erase
Timestamp  xxxxxxxxx
Flash Device : CFM_MCF52223_48MHZ
Flash Organization :  8Kx32x1
Flash Mem Start Address : 0xFFE0000
Flash Mem End Add         : 0xFFE3FFF
using Algorithm CFM_MCF52223_48MHz.elf
 
then it shows an error - so this leads me to believe it is an initialisation file that is the problem.
 
I have used Load Settings to select the file which appears to be correct as this then shows the 8Kx32x1 Flash organization.
 
What file extension should one be using - am worried that I may have the correct file name but chosen one of incorrect file extension or does the system take one to the correct subdirectory for file selection.
 
Ok back to the den of frustrations...
 
Nic
0 Kudos

1,740 Views
DrSeuss
Contributor I
The config files are XML specifically:
CFM_MCF52223_48MHz.xml   (256K) or
CFM_MCF52221_48MHz.xml   (128K)
 
Below is a dump of what you should see:
 

======================================================================
=== Target Configuration Settings
=== Connection:       PEMICRO_USB
=== Target Processor: 5222x
=== Target Init File: D:\Program Files\Freescale\CodeWarrior for ColdFire V6.3\E68K_Support\Initialization_Files\M52223EVB.cfg
======================================================================
Connecting......Connected

======================================================================
=== Execute: Erase
=== Timestamp:  Wed Jan 10 16:01:27 2007
=== Flash Device:         CFM_MCF52221_48MHz
=== Flash Organization:   4Kx32x1
=== Flash Mem Start Addr: 0x00000000
=== Flash Mem End Addr:   0x0001FFFF
======================================================================
Using Algorithm: CFM_MCF52221_48MHz.elf
 
Loading Flash Device Driver at: 0x20000000
Flash Driver Buffer is at:      0x20001B60
Flash Driver Buffer Size is:    0x000024A0
Done
Initialization Command Succeeded
Erasing entire flash ... Done
Erase Command Succeeded
Timestamp:  Wed Jan 10 16:01:31 2007
 
It appears for some reason your flash address are WAY off.
Flash should start at zero.
 
Check your init file on the first screen should be:
D:\Program Files\Freescale\CodeWarrior for ColdFire V6.3\E68K_Support\Initialization_Files\M52223EVB.cfg
 
This should have been loaded from the XML above.
0 Kudos

1,740 Views
PopsStack
Contributor I
Hi Doc
 
Thanks for this.
 
I was also a little confused as to why the Flash did not start at zero. It certainly bombs where the device driver is being loaded - according to the log.
 
I will carefully check the files  - they certianly have not been tampered with after downloading the stuff of the CD.
 
I am still trying to get my (now highly over taxed) brain around this USB stuff - finding that understanding the protocol and seeing how this integrates with the Coldfire stuff quite heavy going - hence the query about some RAM based stuff that will allow me to easily follow through the USB setup and identifying the attachment of a device on hte Console Debug - any example stuff avail.
 
I'll keep plugging away - thanks again for the assistance - gretaly appreciated.
 
Nic (Pops' Stack Popped)
0 Kudos

1,740 Views
PopsStack
Contributor I
Checked the files - Flash Mem shown as FFE00000 to FFE3FFF. Looked at the XML file.
 
Cannot understand why as I haev not changed this file.
 
Any harm in setting the file to 00000000 to 0003FFFF to force the issue.
 
Maybe I should just delete the whole CodeWarrior Dev Studio ans reinstall it.
 
The Falsh Mem address layout is in
 
CodeWarrior     \bin\Plugins\Support\Flash-Programmer\ColdFire\CFM-MCF52223_48MHZ.XML
 
I will now go back an look at your CFM_MCF52221_48MHZ.XML file and see how diff that is - rememebering that I am using the 52223 EVB so it has 8Kx32x1 Flash as apposed to 4Kx32x1 on the 52221 board.
 
Nic
0 Kudos

1,740 Views
DrSeuss
Contributor I
First all the console debug target that I know of are RAM based, meaning that they have linker file assocating all code and data to RAM. Beware that as soon as we get flashing working the next error you will get is that some address will not map to FLASH.
 
In the project settings, (the little button to the right of the target name) if you click on the right panel at the bottom are debugger settings. Select the remote debugger and in the top right of the screen is a  button called "edit connection" select port 0 and increase the speed from 0. (mine has two).
 
Try flashing again.
 
If this does not work exit CW and with the debugger plugged in, go into hardware manager. (my computer, properties) and find the jungo USB driver. do an install. exit and disconnect the pod and you should get a new hardware found indication. Let windows reinstall. (you shouldn't need any CDs or such)
 
I have seen both these issues. I think the first is because you have a nice machine.
 
The second, I think is some form of windows corruption. I is like the installed driver is half there. Enough of windows to think is OK, but not enough for it to function.
 
Hope this helps.

Message Edited by DrSeuss on 2007-01-10 02:58 AM

0 Kudos

1,740 Views
PopsStack
Contributor I
Thanks Doc - will give this a bash.
 
When I try an erase I get a "Can't load Flash Driver".
 
Will keep at it.
 
Nic
0 Kudos

1,740 Views
HackMeUp
Contributor I
I too have many issues burning flash on a Coldfire 5485 EVB from Phytec.  In my case, the flash was upgraded to Intel 28F128J3D.  This part is not supported properly in the Codewarrior IDE for this EVB.  Since it is a multiple vendor issue, all vendors dutifully absolve themselves of responsibility.  I'm the developer left with the non-functional tools at great cost.
 
CFFLASHER is a Windows tool that can be an alternative to the IDE flash environment.  It talks to a P&E dongle but it has limitations in that it only writes to flash at the addresses the file is compiled for (ie where the S-records say to store).  The IDE has a nice feature in that it can shift the image into address other than what it is compiled for.  It's probably still worth it to try CFFLASHER to prove connectivity since the IDE can be problematic.  I believe CFFLASHER is available from the Freescale website.  You might try erasing and flashing your EVB using this tool just to prove connectivity to the P&E dongle.  Keep in mind the dongle needs both lights on for it to be seen by your PC and the IDE.  If your PC goes into powersave/sleep mode at any time, the P&E dongle will power off and it will need to be rescusitated by unplugging and replugging it to the USB after waking up your PC.  Also, some PC's don't have enough drive current for the USB dongle to work properly.  The P&E dongle is probably on the edge and requires the max.  On some PCs the front USB ports have different drive current than the rear you might try switching your USB connection.  Keep in mind you can only run CFFLASHER or the IDE because they both want to talk to the dongle so remember to exit the program you are not using.  Fun stuff.   
0 Kudos

1,740 Views
SimonMarsden_de
Contributor II
I had this problem once and solved it by reinstalling the USB driver from the disk supplied with the P & E device.

(I also seem to recall reading about other people with the problem on this forum a few months back. Sorry, can't be more specific).

Hope this helps
0 Kudos

1,740 Views
David_L
Contributor I
One very interesting experience I had recently was as follows:  I had been using the Demo board with the embedded P&E debugger on a Athlon P1800+ WinXP system quite successfully for several months.  Never had a single problem connecting.   Then about a month ago I made the apparent mistake of upgrading my PC to a nice new Intel Core 2 duo machine.  I did an identical install of CW6.3 and used the exact same project directory.  On the new machine I could not get any reliable communication to the debugger.  I could get it to do a chip erase about 70% of the time, but it was unreliable and seemed to take a long time.  I could NEVER get it to program a full part.  
 
After beating my head against the wall for some time, at the advice of a coworker, I tried connecting to the debugger through a USB 1.1 hub.  Amazingly this fixed everything.  It now works perfectly again.  I've repeatedly verified that removing the hub causes the problems to reappear. 
 
I did exchange e-mails with somebody at P&E and they claimed to not know of this issue.  My suspicion is that there is some timing issue with their USB driver and it gets into trouble on very quick machines.  The hub adds just enough delay to get things back in order.    FYI I also tried disabling one of the cores on the dual core CPU without seeing any improvement.
 
I had a problem similar to what was reported with needing to reload the driver.  This was only an issue when I upgraded from the preview version of CW6.3 to the release version.  I did try it here but it was no help as this was a clean install of the the release version.
 
Hope this helps!
Dave Lundquist
 
0 Kudos

1,740 Views
PopsStack
Contributor I
Hi all
 
Thanks for the input.
 
I have also tried the reinstallation thing - no joy there. Tried again last night to do a simple stationery generated prog and target to ROM. Then tried the configuration by loading settings, seeing all the FLASH stuff (Not sure if the config is correct shoiwng Flash not starting at 0000_0000), then trying an erase - no joy.
 
Tried ther hardware diagnostics - no joy - comms faliure.
 
My logic tells me (If there is any left) that a simple erase or hardware diagnostics run should not have anything to do with the program so even if that was not 100% correct, one should still be able to erase or do a walking one's etc.
 
Any other ideas - found that tall building and about to leap.
 
Nic
0 Kudos

1,740 Views
David_L
Contributor I
You are going to try a USB hub as I suggested I hope?

Dave Lundquist
0 Kudos

1,740 Views
peg
Senior Contributor IV
Hi,
 
I seem to remember this (putting the BDM behind a 1.1 hub) being a cure for some in the past.
 
Can't remember who, what or where, but it is certainly worth a try.
 
Regards
Peg
 
0 Kudos

1,740 Views
PopsStack
Contributor I
Well that brings me to my next question and set of woes.
 
I have had a look at the Remote Debugging Settings and note that under the PEMicro_USB config one can select USB0 USB 1 USB 2 or USB 3 - the default being 0.
 
Had a look under the System on my PC under Hardware and note that my PC has a HUB - has 5 USB ports - then also noticed that there is a Jungo (Driver?) showing Multilink 2.0 Properties - this reveals P&E Microcomputer Systems Inc - so Driver appears all there as I tested things when reinstalling the driver.
 
So does this all mean that I have to select the USB 0-3 - tried 0 and 3 and still cannot connect.
 
Man I am confused.
0 Kudos

1,740 Views
ColdFireHot
Contributor I
Pops
  I had a similar issue a while back.  I had to change the speed setting for the USB Connection.
 
The default was 0 and I had to use 2 or higher for my board.
 
Mark
 
0 Kudos