Hi,
I'm having problems using USBDM. I'm using CodeWarrior 10.1. When I try to debug I get message: "Connection with the target has failed. Please cycle power to the target. Retry connection?". Cycling the power doesn't solve anything. What is more confusing I succeded in programming the target once. But after restarting CodeWarrior project didn't work again. My processor works because I used this one chance I had and made a LED blink, and it still works. Maybe there is something wrong with my hardware (see attachments). I don't know what to do. Please help.
Dear phoenix_fire,
I don't have a MCF52221 to test against but I have had no problems when using similar chips e.g. MCF52210 or MCF52233.
I can't see any problems with your circuits apart from it being recommended to supply external pull-ups/downs for the RCON & JTAG_EN signals.
Could you consider the following suggestions/questions:
Thats about all I can suggest at the moment.
bye
Hi,
first of all thank You for replay.
After Your email I pulled up/down RCON and JTAG_EN but it made no difference. Device still behaves the same. As for the questions I’m using BDM in version 4.6. I’ve checked it on Windows 7 and XP with similar results. I assume that device shouldn’t be secured but I’ve tried connecting it with JTAG (after making all necessary hardware changes) in order to unsecure it by CFUnlocker. Unfortunately this program also can’t communicate with controller (it detects programmer but when I try to detect controller it finds one device but it describes it as ‘non Freescale’).
As for the activity on pins I don’t really know what to expect. I’ve checked by oscilloscope and pins react for pushing ‘Debug’ button by changing state for few hundred milliseconds. Should I expect more complex signal ?
I attach debug log to this message (after changing extension).
To sum up, as far as I can tell the programmer works and there must be some problem with my device. My circuit seems OK so my current guess is that I must have done some soldering bugs. Because I can’t really locate it I’ve decided to solder it once again without all unnecessary things. If You had any ideas please let me know. I’ll try to update this post as soon as I have any new info.
Dear phoenix_fire,
I have found some problems in the CFVx connection sequence that may account for the problems you are having.
I suggest you update your installation with the late fixes located here:
https://sourceforge.net/projects/usbdm/files/Version%204.6/Late%20Updates/
Please let me know if this fixes your problems.
bye
Hi,
archive seems to be corrupted. I've tried on two computers, different browsers and different file archivers (including latest WinZip). Today I’ll test programming on minimal copy of the device.
Sorry,
I've just uploaded a new copy.
bye
Hi,
tried it and it didn't solve the issue. But now the message says "Connection with the target has failed. Target reset done. Retry connection?". Still there is a chance that it's my soldering mistake because I've checked it on old board. I'll know how it behaves on new board in a few hours. I've noticed change though: earlier CF microcontroller started (led lights up) every time no matter if I powered programmer or target first. Now the microcontroller doesn't start when the programmer is powered first. I attach debug log.
I’m thinking that I should have pulled up/down RCON, JTAG_EN and CLKMOD0 although datasheet says that they are internally pulled but still strongly recommended. Now I have to do this with kynar cables witch feels kind of risky. I wonder if lack of externall pull up/ down may result in programming failure.
Hi,
on the new board it looked the same at first. But when I keeped trying it seemd to be partially working for a moment. I got new message: "Download Task Failure. Error: Auto-detection is successful. File is of type Elf Format 0x00001490 bytes of Target Memory at 0x20000500 is not within flash boundaries. Do you want to continue ?" And also debug log indicates that for the moment it worked. I attach it. My target ram adress is set to 0x20000000 with size 0x00004000. Any seggestions what might have gone wrong ?
attachment to previous message
Dear phoenix_fire,
The log file provided shows that the BDM is connecting correctly and appears to be working. (Some of the messages are a bit misleading - the "bdm_usb_recv_epIn() - Error Return 28 (Target reported - Error terminated bus cycle):" is the expected response when the BDM polls a running target.
The error message you quote is independent of the BDM. It indicates that the image load address is not within the Flash - it's actually in the RAM!
The only way I could get a similar message was to miss-configure the launch setup. In particular by configuring the Internal Flash launch to try programming the wrong elf file from the RAM build. This produces an almost identical error message.
I suggest you set you set up a new project with all default options including the actual program to load. You should not need to change any options for this to work (apart from the debug option if you want logging). If this works then its some option that was accidently changed when trying to find the original problem.
If this doesn't work, could you export the project from eclipse and post the resulting ZIP file for me to try to reproduce the problem.
bye
Hi,
the project is attached to this message. Still there have to be some hardware issues since most of the time I can't even start to debug or program (CW says "Connection with the target has failed"). But if additionally I'm making mistakes in CW project then let me know. Soldering another piece of device showed no effect so now I’m going to solder programmer once again. I’m almost sure there has to be some kind of simple and stupid mistake I’m making.
Dear phoenix_fire,
I made up a minimal board using a MCF52221CAE66 and tried it out with Codewarrior. It seems to work OK.
I also tested it with the V4.7 stand-alone programmer (V4.6 doesn't support MCF52221).
I've attached the schematic for the minimal board tested.
I hope it's of some use.
bye
Hi,
really thank You for your interest in the case also sorry for not replaying for such a long time. I didn't solve the problem. This had to be something with the programmer PCB or circuit (my mistake). Right now I'm using some third party Chinese version of USBDM but from what I can tell it is based on the original USBDM project (although it has different dlls). It's hard to say what I did mess up but I've noticed one thing that may be useful for other beginners like me - JTAG_EN must be pulled down/up although it is internally pulled in theory (don't laugh, for me it wasn't obvious so I'm not alone probably). Right now I'm kind of busy and don't really have time to investigate the problem. But next month I'll try to solve the issue and post it so nobody had problems similar to mine.
Dear phoenix_fire,
I tried your project with a MCF52210 and a USBDM_JS16/CF BDM and had no problems. I've ordered a MCF52221 chip and will check it again when it arrives. I can't see much else to do in the meantime. Sorry!
bye