Dumping/debugging ColdFire safely without source code

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

Dumping/debugging ColdFire safely without source code

1,270 Views
natew
Contributor I

I have a legacy device with a ColdFire v2 (MCF5206) chip and a BDM header. I am using CodeWarrior v7.2 Special Edition and a Univelop ColdFire BDM interface (compatible with CF v2 according to specs, and apparently based on the USBDM designs). I need to be able to do the following things: 1) connect to the legacy device and read existing memory, ideally dumping a complete binary from internal+external SRAM to the PC as a backup; 2) debug existing code on the device--or alternatively in a VM--and potentially do a binary delta in code/data to repair a glitch; and 3) overwrite existing code with the backup binary from (1) or with the repaired binary from (2). I'm not sure if this last goal is possible with the Special Edition since the binary is >128kB, but I'm thinking it could be done it chunks if necessary. I need to do all of this without the original source code in CodeWarrior; working in assembly is fine as long as it's possible.

 

I want to emphasize that it is CRITICAL that I not initialize, overwrite, or download any data to my target, at least initially before (3) above. I do not have the source code or complete binary to restore if things go wrong, which is the main reason I need to do this to begin with. I want to connect as passively as possible, as if in read-only mode.

 

I don't have any other CF devices to experiment with first, and because I can't risk losing the existing code, I have not yet attempted to connect to the board via BDM. I need to be as certain as possible that my CW configuration and actions will not modify it in any way, so I would greatly appreciate it if someone could confirm that what I want to do is possible and validate/comment on my configuration steps below before I attempt anything.

 

It is most important for me to dump memory to get a backup, so that's my first goal. (If it works, I will move on to debugging.) My planned steps are:

  1. Open CodeWarrior 7.2 and create a new project (debugger is unavailable otherwise)
  2. Select CF 5206E, default settings
  3. Menu=>INTERNAL_RAM settings (Alt+F7)
    1. Debugger=>Debugger Settings: uncheck 'Stop on application launch' (will probably choose Program/Default Language Entry Point when debugging?)
    2. Remote Debugging: set Connection to the appropriate setting for Univelop device (a GDI plugin), leave 'Download OS' unchecked.
    3. CF Debugger Settings: uncheck 'Use Target Initialization File', 'Use Memory Configuration File' (?), everything under 'Program Download Options'
    4. CF Reset: uncheck 'Initialize target after Reset' (unsure whether to fetch SP and PC, or select 'Do not set...')
    5. Apply settings
  4. Physically connect to BDM header of unpowered target.
  5. Menu=>Debug=>Connect (unsure of any dialogs/options/intermediate steps that might appear when BDM is physically connected)
  6. Menu=>Debug=>ColdFire=>Load/Save Memory (again, unsure of dialogs/options/next steps)

 

This is my first time working with an older version of CW, so I would greatly appreciate comments and advice!

Labels (1)
Tags (3)
0 Kudos
3 Replies

607 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Nathan,

If you are not familiar with CodeWarrior 7.2 you can also use CodeWarrior 10.6 and take a look to the below posts created by our colleague Erich Styger:

https://mcuoneclipse.com/2012/10/10/attach-connect-download/

https://mcuoneclipse.com/2012/05/04/dump-my-device-memory/

The first one explains how to connect to a running target without programming it using the "Connect" option in CodeWarrior:

pastedImage_3.png

The second one shows how to dump the memory of the device using the "Memory view" once you have connected to the device.

Regarding the special edition limit of 128Kb, this limit is only for the compiler and debugger, you can use the flash programmer to overwrite the existing code with the repaired binary.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

607 Views
natew
Contributor I

Thanks Carlos! Unfortunately the BDM interfacing device I have isn't compatible with the Eclipse-based versions of CodeWarrior (and I'm having trouble getting it to function with 7.2 for that matter), but the information you've provided is still valuable. It looks like debugging even in assembly probably won't be possible without the source, but I should at least be able to dump memory and maybe disassemble the thing, assuming I can get the BDM device to work.

0 Kudos

607 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Nathan,

It should be possible to debug in assembly after connecting to the device.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

0 Kudos