USBDM - Version 4-Beta (JB16/JS16/JMxx Hardware Versions)

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

USBDM - Version 4-Beta (JB16/JS16/JMxx Hardware Versions)

14,488 Views
pgo
Senior Contributor V

Dear All,

 

The latest version of the hardware/software & firmware for the above is available at this location.

 

http://opax.swin.edu.au/~3340694/USBDM/USBDM/html/

 

 

History

  • V4.0 (September 2010) - Significant changes in some areas - Please read carefully
  • Support for Linux and Windows7 64-bit (Eclipse version of Codewarrior only)
  • To support the 64-bit version of Windows it has been necessary to update to using libusb-V1 drivers. For consistency this is also done on Linux. As part of this process the VID/PID for the hardware (BDM) has been changed. This will allow the co-existence of Freescale's OSBDM-JM60 hardware while using a new driver for USBDM. Formerly both these BDMs used the same VID/PID and changes to the driver would not be possible.
  • Programming utilities for RS08, HCS08 and CFV1 are now (officially) included.
  • Support for MC56F800x (digital signal controllers) added. This is only available on USBDM_CF BDMs and the Axiom MC56F8006 Demoboard.
  • Minor bug fixes
  • The addition of DSC support has pushed the firmware size to greater than 16K on the USBDM_JMxx-CF version. This means that MC9S08JM32/60 chip must be used.
  • Changed to wxWidgets for common GUI code on Windows and Linux

Please note that these design are different from the Freescale OSBDM-JM60 design which was proceeding independently while I was doing the above designs.

 

Linux files will be uploaded in the next few days.

Its a BETA because there have been lots of changes in how it operates so probably some undiscovered bugs.

 

Enjoy.

 

bye

Tags (2)
0 Kudos
110 Replies

1,055 Views
Mickey
Contributor III

Dear pgo

  Under the Win7 x64 version 4.2, JM60_CLD recognized properly, but in the x86, such as XP or Win7, only the first time when using any FlashProgrammer be detected, and then will not respond.

0 Kudos

1,055 Views
Mickey
Contributor III

I use vmware visual machine, PC with the general do not have this problem, have any suggestions?

0 Kudos

1,055 Views
Mickey
Contributor III

In USBDM 4.2 version, use DSC MC56F8006, that download and execute excruciatingly slow, any suggestions?

0 Kudos

1,055 Views
pgo
Senior Contributor V

Dear Mickey,

 

I've compared a USBDM with a Freescale USB Tap - They are both excruciatingly slow when single-stepping and similar operations.

 

I would expect USBDM to be slightly slower that OSBDM-JM60 since the former uses an interpreter to execute sequences of JTAG operations while the latter has them hard coded in the BDM firmware.  This would be a small penalty - may 20% slower on executing a sequence.  The advantage of the first approach is that is is much more flexible.

 

In any case the above is pretty irrelevant.  The main bottleneck is the method used by the debugger when single-stepping or starting execution with breakpoints.  It reprograms blocks of the MC56F8006 flash every time to set or remove breakpoints in the target program.  It does this even when single-stepping (at the C-source level).  This is a slow operation involving quite a lot of waiting.  I believe this is the main cause of the sluggish behaviour on these chips.

 

The DSC chips do have a single breakpoint but it appears to not be used.  Enabling this feature on the USBDM code did not work properly - I suspect due to the deep pipeline of the chip and problems with inexact  exceptions.  You can try this by changing the breakpoint type in the debugger but I found it unworkable.  They also have single-step hardware but it is not used - probably for the same reason?

 

The HCS08/HCS12/Coldfire chips have multiple breakpoint hardware and a workable single instruction step hardware that is used so are much more snappy after the initial download.

 

I don't see any way of improving this.

 

Do you have anything to compare the speed to?  I would like some confirmation :smileyhappy:

 

PS For reference here is a similar complaint about the USBTAP:

https://community.freescale.com/message/66674#66674

 

bye

 

0 Kudos

1,055 Views
Mickey
Contributor III

Hi pgo

  4.2 version of the firmware in a single step is about 6 ~ 7 seconds, version 4.1 is about 2 ~ 3 seconds. this is the normal state of it?

0 Kudos

1,055 Views
pgo
Senior Contributor V

Dear Mickey,

 

I did not realise that you were meaning that there had been a slow down with the latest version.  I though it was a general complaint on how slow it was :smileyhappy:.

 

I know the reason for the change and I will rectify it in the next version.  Basically I was trying to reduce the USB polling when busy but the threshold is too large.  I hadn't noticed the change in the quick check I performed.

 

bye

 

0 Kudos

1,055 Views
PadelisGR
Contributor III

Dear pgo,

 

I am writing here to ask for help or suggestions!

I am working with CPU16 and CPU32 processors a lot and i am using the traditional PD_BDM with a WinXP program that i have coded! The last weeks i am trying to build a usb bdm for that processors using a FT245 ic but i can't get it to work. I can enter BDM but all the other commands fail! Anyway this is another project!

The day before i found a USBDM that i bought from ebay 1 or 2 years ago. Here is a link to a similar one : Ebay USBDM.

Searching on this forum i found out that this is a USBDM for hcs12 and uses a HC908JB16. It seems that i can flash the newer firmware for the combined processors! I haven't tried it yet!

Well my thought is to rewrite the firmware so that the USBDM that i have will work on the CPU16 and CPU32 processors! I don't mind the software on the PC side, i can write a new one! All i need is the USBDM  to work with that processors!

The lines that i need in order this to work are :

DSO,

DSI,

DSCLK/BKPT,

RESET and

FREEZE.

On the USBDM there are 6 pin connector and a 16 pin connector which is not soldered! Do you think that the 16pin connector will cover my needs? If yes, then please provide me a lint to the latest source code for the JB16 and tell me what IDE i need to open the source files in order to modify them! If you want i can start a new thread on the 16bit forum and start the progress from there!

 

Thank you in advance

Padelis

0 Kudos

1,055 Views
pgo
Senior Contributor V

Dear padelis,

 

The link you provided appears to be for a TBDML based programmer using the JB16 - This is different from USBDM!  There is a version of the USBDM software that MAY work with this hardware and provided some additional features such as programming Coldfire V1 chips but there are no guarantees and you would need to obtain (or trace out) the schematic before attempting this.  You would also need to know how to get the device into bootloader mode or have access to a MON08 programmer.

 

The additional connector on your board is probably a MON08 interface and does connect to some of the other JB16 pins but it would be much simplier to start over with a MC9S08JS16 than try to adapt the board.

 

The interface for the HCS08/HCS12/CFV1 and the CFV2/3/4 are significantly different and different again from the CPU16/32 devices.  They require different hardware especially in light of the differing voltage levels that may be used by the JB16 in the programmer and the target device.

 

I don't know of any 'current' CPU16/32 programmers but I haven't really looked for them :smileyhappy:

 

bye

 

 

 

0 Kudos

1,055 Views
rafael_freedom
Contributor I

 

Dear Pgo,

  • Support for Linux and Windows7 64-bit (Eclipse version of Codewarrior only)

Linux files will be uploaded in the next few days.

 

 

I'm testing the Linux distribution. I see you are using the debug version of the wxsmith files and 32-bit versions. I would like to test it with my Lunux 64-bit. Are the binaries reproducible with the source code?

 

Regards,

 

 

0 Kudos

1,055 Views
pgo
Senior Contributor V

 

Dear Rafael,

 

The LInux and the Win32 versions are nearly identical except for:

 

  • Different build environment - Both the Linux and WIN32 versions are built with Eclipse and the GCC compiler but the way wxWidgets is linked is different and they require quite a bit of platform specific tweaking to build on each.  The Linux one is considerably easier to set up. Basically add the wxconfig command in the usual fashion.
  • The GDIs on Linux  need to have the entry points re-named with an underscore!  This is a pain as it means different files are needed or some ugly MACRO pre-processing

Otherwise the files for LInux and WIN32 are the same - there are some platform dependent macros in the code to handle the differences.

 

I don't know what wxsmith is?

 

I have only built under the 32-bit LInux,  I would hope that it would be straightforward to do the same under 64-bit .  I have no idea whether CWV10 support 64-bit Linux.

 

I am looking into uploading the source files to a sourceforge using GIT but I have some problems with using sourceforge in general due to the firewall being used here - I'm waiting for IT to solve this (if possible).  At the moment only the WIN32 source files have been uploaded and they are already out of date.

 

bye

0 Kudos

1,055 Views
GeV
Contributor I

I'd like to try it in Linux, but installing USBDM with the provided script is enough to make Eclipse segfault on my Ubuntu 10 64bit. I would like to help fixing this... once the source code is available of course.

0 Kudos

1,055 Views
Kopone
Contributor IV

Hello,

 

i built the JS16 for CF V2-4 hardware and I am using it on a project for a MCF52254 with CodeWarrior 7.2 (plus the latest patches).

The problem I am encountering is that with the default software package, i can not use it at all. When I try to run the debugger in CW,  I get a messagebox about something missing in the tblcf_gdi.dll or one of it's references (the message doesnt specify the exact source of error).

 

I updated the tblcf.dll and the usbdm.4.dll in the CW plugins/..../usbdm folder with the latest versions from the sourceforge erratas. I can now run the debugger and flash the MCU (or upload and run something from the MCUs RAM) however this works only once. As soon as i quit the debugger or the flash tool, CW crashes. It simply disappears without any messages and leaves more than 30 "MEM_FREE....dump" files in the project's folder.

 

I am pretty lost on what to do here, i tried a complete fresh install of everything including CW and even on a different machine but to no avail (I run Win XP SP3 on all of them). Is there anything i can do/check or should i just try and get my project over to CW 10?

 

Regards,

 Sven

0 Kudos

1,055 Views
asin
Contributor I

Hello!I'm a student who has much trouble in building JS16 BDM...Can you give a hand?I don't quite understan the steps I should follow.Thanks a lot.My email is 505236890@qq.com...

0 Kudos

1,055 Views
pgo
Senior Contributor V

 

Hopefully the following steps will be useful:

 

  • Build the hardware :smileyhappy: A documentation web page describing the minimal version of the JS16 USBDM hardware is available here:

http://usbdm.sourceforge.net/USBDM_V4.3/USBDM_JS16/html/index.html

There are links on that page to schematics and such as well as description  of various requirements.

 

  • Program the flash.  The required files are available on sourceforge as part of the installation directory

http://sourceforge.net/projects/usbdm/files/Version%204.3/1.%20Installation_4_3/

See  Installation & Initial Programming of BDM Firmware in the documentation above.

 

  • Install the USB drivers and the interface DLL for the codewarrior software tools.  Available at the above link and described in the documentation.

bye

 

 

0 Kudos

1,055 Views
wrljet
Contributor II

I am using CodeWarrior for Microcontrollers.  version 6.2.

 

In the dropdown list of debugger targets, Open Source BDM shows up for projects using HCS08

parts, but it is missing for CodeFire V1.  (JM128, AC256, etc)

 

Any idea why, and how to get it to show up?

 

Bill

 

0 Kudos

1,055 Views
wrljet
Contributor II

 

OK, correction -- it does show up for JM128.  Just not for AC256.
(not sure why I didn't see it before for the JM128)

wrljet wrote:

I am using CodeWarrior for Microcontrollers.  version 6.2.

 

In the dropdown list of debugger targets, Open Source BDM shows up for projects using HCS08

parts, but it is missing for CodeFire V1.  (JM128, AC256, etc)

 

Any idea why, and how to get it to show up?

 

Bill

 


 

0 Kudos

1,055 Views
pgo
Senior Contributor V

Dear Bill,

 

USBDM 'pretends' to be a OSBDM for V6.3 Codewarrior.  Unfortunately OSBDM (and hence USBDM) is no longer supported by Freescale for newer targets includig the ones you mentioned.

 

If you update to Codewarrior V10 then USBDM (not OSBDM) is available on those targets.

 

You can try the following process under V6.3.

  • Set up a project for one of the other debug connections (CFV1 FSL ...)
  • Start the debugger - the debugger will be unable to find the missing interface. Just cancel.
  • Within the debugger select Component->Set Connection... and select CFV1 Open Source BDM 
  • Exit the debugger
  • Restart the debugger from the IDE.  You should find that it now is using the OSBDM/USBDM connection.  This should persist unless you change the connection with the IDE in which case you will need to re-do the above steps.

I have only tried this (recenty) with a CN128 but it should work for other targets.

This has not been tested very much so there may be other problems.

 

bye

 

PS. Just saw your updated post - This is a more elegant solution :smileyhappy: but I would have the same reservations.  In the long run it is probably better to consider moving to the Eclipse version.

 

bye

0 Kudos

1,055 Views
wrljet
Contributor II

 


pgo wrote:

 

<snip>

PS. Just saw your updated post - This is a more elegant solution :smileyhappy: but I would have the same reservations.  In the long run it is probably better to consider moving to the Eclipse version.

 

bye


 

I have slowly been trying the new Eclipse version (on a new laptop, which unfortunately is Windoze 7 64-bit).

Eclipse seems bloated and slow compared to the classic CodeWarrior.  But I'll get there eventually.  I do want to use the refactoring tools it provides.

 

I'm quite pleased at the moment.  After soldering microscopic components and fighting configs and DLL hell all day, things are working.

 

Bill

 

0 Kudos

1,055 Views
wrljet
Contributor II

I'm using the JM60 hardware.  4.3 software.   The BDM works.  Programs and debugs targets fine.

 

But I can't seem to get the Bootloader utility to work.


It connects properly initially, and reads the serial number.

Reflashing or verifying I get the msgbox "Device failed to re-open after reboot".


This is with Windows XP SP3, 32-bit.

 

usbdm.log is attached.

 

I ran Bootloader under Eclipse.  This code here...

 

   // Connection is lost so close it.   USBDM_Close();        // Connection is lost on reboot so close it.   retry = 10;   do { // Retry connection to allow for reboot and re-enumeration time      wxMilliSleep(1000);      (void)USBDM_FindDevices(&numDevices);   } while ((numDevices == 0) && (retry-- >0));   rc = USBDM_Open(0);   if (rc == BDM_RC_OK) {      // Check version & in ICP mode      rc = USBDM_GetVersion(&USBDM_Version);   }   if (rc != BDM_RC_OK) {      errMessage = _("Device failed to re-open after reboot");      return FLASH_ERR_FAIL;      }

 

 

It is the  rc = USBDM_Open(0); call that returns failure.

(not the rc = USBDM_GetVersion(&USBDM_Version); that follows.)

 

Any ideas?

 

Thanks,

Bill

 

 

 

0 Kudos

1,055 Views
pgo
Senior Contributor V

Dear Bill,

 

I accidently built some of the Flash images with the CDC (USB Serial code) enabled.  I have found that this can extend the enumeration time of the device since it nows appears as a composite device.  This may also be complicated by whether the drivers were installed when the device was composite or a simple device.  Unfortunately Windows remembers this information which complicates things.

 

I have had some trouble with the rather brute force re-boot done as part of  re-flashing when the device would be changing from a simple device (in ICP mode) to a composite device (in BDM mode).  I think this is just a case of not waiting long enough for re-enumeration.

 

In any case could I check the following?

 

If you remove the device and re-plug does it  function correctly? 

Is the serial number correctly changed?

 

The error message you get is late in the process after the re-flashing has been confirmed before the attempt to reboot. You would get a different error if the re-flashing failed.  Removing and re-plugging the device should fix any temporary problem.

 

If the device fails to function after a manual re-plug then it is likely that the Flash image being programmed does not have a valid checksum or is broken in some way.  The checksum is updated by the bootloader when the serial number is changed.  Let me know if the update actualy fails and I will check further.  Otherwise it will probably sit at the bottom of the list :smileyhappy:

 

bye

 

PS. I think I may have mis-interpreted your post.  Is it the first re-boot that is failing?  If so you can try adding a delay to the code you posted or a simply retry loop to give more time for re-enumeration.

 

bye again

0 Kudos

1,055 Views
wrljet
Contributor II

I didn't reflash.  I only asked it to Verify.  (Is that a legit thing to do?)

 

The code snippet I post shows the spot where it was giving the error.

It was right after the forced reboot where it tries to reopen.

doFirmware(), line ~ 494.

 

I do have the CDC drivers installed.

 

It does function correctly after being unplugged and plugged back in. (without closing

Bootloader.exe)   It retrieves the serial number.

 

Curiously though, when it's in this mode, when I unplug and replug I only hear

one set of beeps, not double for BDM and CDC.

 

I also added a 4 second sleep after the renumeration but before the Open call.

That did nothing helpful.

 

Bill

 

0 Kudos