tbdml.dll version problems - using Axiom CSMB12

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

tbdml.dll version problems - using Axiom CSMB12

6,989 Views
NoICE
Contributor I

I am using tbdml.dll with NoICE and an Axiom CSMB12 with integrated TBDML.  I started out with version tbdml.dll version 2.01 from the combined tbdml/osbdm project.

 

Works fine the first time I open the interface.  However, if I restart NoICE, the function tbdml_set_target_type returns error 3.  Yes, I call tbdml_close efore exiting. 

 

The only way to restore operation is to unplug and re-plug the USB cable.
Any ideas as to what is going on?

If I use tbdml version 1.04 or earlier from the original tbdml project, it all works fine, but then my Witztronics pod won't work.

I just tried the new version 3 of the combined tbdml/osbdm project.  It gives a warning about obsolete pod firmware, but then seems to work just fine.

The firmware updates in 3.0 are for 20 and 28-pin JB16, but this board is using 32-pin version, and the port pin assignments don't seem to be quite identical.

0 Kudos
Reply
11 Replies

3,901 Views
pgo
Senior Contributor V

Dear NoICE,

 

I can't find a version of tbdml.dll included in the USBDM code that reports itself as 2.01  (Assuming you are referring to USBDM).  Could you try the latest version available here (page 4 of discussion):


Combined TBDML/OSBDM Code

 

I was unable to re-produce the problem you have reported with the above.

 

Please note that the while I have tried to maintain compatibility, the version of TBDML provided with USBDM may be  incompatible with hardware other than that specifically tested.

 

The firmware supplied with USBDM is not compaible with the the Axiom hardware you are using.

 

If the problem persists please post here again and I'll ask you to do some debugging if you're willing!

 

bye

 

PS. The NoICE software appears to do some things in a unusual way.  In particular it doesn't appear to actually ask the BDM to connect to the target and insists upon setting the speed - even though TBDML automatically does so in most cases.

 

Message Edited by pgo on 2009-11-12 07:07 PM
Message Edited by pgo on 2009-11-12 07:15 PM
0 Kudos
Reply

3,901 Views
NoICE
Contributor I

I'm a bit puzzled.  I followed your link, and in message 39 of 79, downloaded
 http://www.freescale.com/files/community_files/TBDML/msg320_installation.zip.  The version of tbdml.dll in this zip is 131077 bytes long.  When NoICE calls tbdml_dll_version(), the return code is 0x21, which the docs tell me is 2.1.  The annoying dialog that pops up every time to ask about VDD and connection control claims version 2.1.2. (All this, even though the forum messagerefes to version 1.4)

 

NoICE explicitly sets the BDM speed because it works with older non-S HC12 parts that don't support SYNC.  I suppose that I could call tbdml_target_sync on the S parts, but setting the speed manually should work as well, should it not?  And the failure I observe happens in tbdm_set_target_type, which I presume that I should set before trying to communicate with the part.

 

Using this dll, the first-time sequence is

tbdml_init() returns 1
tbdml_open(0) returns 0
tbdml_dll_version() returns 0x21
tbdml_get_version() returns 0x00001110
tbdml_set_target_type( HC12 )
   shows dialog to set CLKSW, etc.  Press OK
   returns 0
tbdml_target_reset(SPECIAL_MODE) returns 0
tbdml_set_speed(4.000000) returns 0
tbdml_read_byte(B) returns 00
tbdml_read_bd(FF01) returns C0

etc., working normally

 

Exit (calling tbdml_close), then try again

tbdml_init() returns 1
tbdml_open(0) returns 0
tbdml_dll_version() returns 0x21
tbdml_get_version() returns 0x00000000
tbdml_set_target_type( HC12 )
   shows dialog to set CLKSW, etc.  Press OK
   returns 3
The only way to restore normal operation is to unplug the usb from the pod/board.

 

If you can suggest a better sequence of operation, I would be delighted to hear of it.  Thanks.

 

 

Message Edited by NoICE on 2009-11-13 03:03 AM
Message Edited by NoICE on 2009-11-13 03:25 AM
0 Kudos
Reply

3,901 Views
NoICE
Contributor I

And SOMEWHERE in these forums a few days ago I found 750_1_1_Installation_2_0_0.zip (and the _2_2 and_3_3 parts with source and PCB).  Heck if I can find them now.

 

The version of tbdml.dll contained therein reports as version 3, even though the name of the zip filewould indicate version 2.

 

When I run NoICE (same sequence of calls as above), I call tbdml_open and get a message box:

 

    The BDM Firmware is incompatible with the interface DLL being used.
    Please update the BDM firmware or use the correct version DLL.
    The interface will operate with limited features.
 

Seems to work just fine (including any second run, which breaks with dll version 2).  I just wish I knew what the "limited features" do and do not include.  (I also wish I make the message box not show up)

 

Message Edited by NoICE on 2009-11-13 03:36 AM
0 Kudos
Reply

3,901 Views
pgo
Senior Contributor V

Dear NoICE,

 

Sorry about the confusing version numbers.

 

There are three independent versions involved:

 

The BDM Firmware

The Interface DLL

The Hardware

 

The uploads are named after the BDM firmware.

 

In part these are inherited from the original TBDML which was (I think) firmware version version 0.3 with DLL version 1.4. and hardware version 0 :smileyhappy:

 

I increased both of these by 1 when producing the first version of USBDM.

Perhaps I should have gone straight to version 2 for the firmware!

 

====================================================

You are quite correct in saying that the connection method would appear to have no bearing

on the error you are having.

 

However I would suggest the following strategy for NoICE - I believe this would also work with the original TBDML and be more convenient for the user.

 

When initially connecting or when  suspecting loss of communication:

1.   try tbdml_target_sync()

If the the above fails:

2.   try tbdml_set_speed()

 

In most cases (for more modern chips) this will save the user from having to manually provide a clock value.  This is especially convenient if the target is changing speed.  USBDM also has a stategy for determining the connection speed on  (some) earlier targets that do not support SYNC.

 

====================================================

The trace you have provided seem to indicate that BDM firmware is not responding at all after it is closed.  I can't think of a reason why this should be affected by the DLL in use.

 

Could you try either of the following (your choice!) :

- Update the BDM software to the version included in the Zip files referenced above and see whether is affects the results.  I'm unclear what version the firmware is.  (The information in your log is only the hardware version for some reason).

 

- Stick with the same firmware but change to the Debug version of the interface DLL included above.  Run your example and post the .log file that appears in the root of the C drive.

 

- If worse comes to worse I'll supply the latest DLL without the nag message but I would prefer to know what is wrong!  The main missing features are the RS08 support and some lack of compatibility testing.

 

Thanks for your patience.

 

 

0 Kudos
Reply

3,901 Views
pgo
Senior Contributor V

Dear NoICE,

 

A followup to the above:

 

USBDM was tested with various versions of Codewarrior.  NoICE uses the DLL in a rather different fashion that was not anticipated.  The following highlights some of these differences:

 

Codewarrior only calls open() and set_target() when initially connecting to the DLL/target.  USBDM takes advantage of this to display the "annoying dialogue" once only in Codewarrior.  NoICE appears to do the above whenever it is resetting the target so, yes, the dialogue is very annoying.  I can't do much about this.  Setting a flag to prevent it would interfere with the desired operation with codewarrior. Note - I can't change the operation of codewarrior since I don't have access to the DLLs involved.

 

Codewarrior uses target_sync() to connect to the target.  It only uses set_speed() when having trouble connecting.  Using set_speed() turns off the autosync function of the BDM so it cannot cope with speed changes on the BDM interface.  target_sync() should be tried first.  This applies equally well to the original TBDML.dll.  Using set_speed() works but is undesirable.

 

I have downloaded and installed NoICE.  It appears to include version  v2.1 of tbdml.dll that was available as part of USBDM.  I'm unsure why this was done. AFAIK this DLL is compatible with existing TBDML BDMs but I certainly can't test this extensively.

 

I have tried NoICE with the 1.4 version of the BDM with the original TBDML.dll and the 2.1 version shipped with NoICE.  I haven't found any problems apart from the two alluded to above.  Using the original TBDML.dll requires using the TBDML compatible version of the BDM ie. the version that identifies itself as a TBDML BDM rather than a OSBDM.  I can't produce a single BDM that can appear as both!

 

I would recommend checking the firmware version of the BDM.

 

I hope the above helps rather than confuses.

 

bye

 

0 Kudos
Reply

3,901 Views
NoICE
Contributor I
I can't update the pod firmware: the Axiom CSMB12 devo board includes a TBDML pod using a 32-pin version of the JB16, and the port pins in use don't entirely match those in the distro.  Further, these boards are used in bulk by schools, so updating them all isn't practical - much easier to swap the DLL.

Like CodeWarrior, NoICE calls open() and set_target() only once.  The problem occurs when the user closes NoICE, and then runs it again.  NoICE calls close() before it exits.

Attached are two log files from the debug dll.
- usbdm_dll1.log shows a normal open
- usbdm_dll2.log shows a second open, with the failure returned to set_target

NoICE interfaces to a variety of pods, from P&E, SofTec, TBDML, etc.  Each version includes the latest DLL.  For P&E and SofTec, this DLL supports both current and legacy pods (back to the parallel-port wiggler days in the case of P&E).  I naively assumed that TBDML.DLL worked the same way.  Clearly, TBMDL.DLL needs to be matched to the pod version. 

My best bet is probably to not include ANY version of TBDML.DLL in the NoICE installer, and to let people provide their own dll compatible with their pod.

One suggestion: if the new DLL could at least TELL ME that the connected pod is old-school and needs the older DLL, NoICE could automatically switch from the new to the old DLL.  Maybe pod version is enough - if it was documented somewhere.

Thanks for all your work.  TBDML/USBDM is a great resource for the community.
0 Kudos
Reply

3,901 Views
pgo
Senior Contributor V

Dear NoICE,

I'm sorry I misread your first posting.  Am I correct that the problem you are describing occurs only when using the Axiom CSMB12?

If so, I've believe I've found the reason.  The USBDM version of TBDML.dll sets the target type to -1 when closing to turn off the power on the BDMs that have target power control.  I checked this against the original TBDML firmware and  it was basically ignored.  I've just checked a later version of OSBDM that was uploaded in the OSBDM discussion board.  It behaves differently.  If you set the target type to an unused value it stop responding to any instructions including the one to change the target type back to a legal value!

 

This was an unanticipated problem (obviously).

 

If this is the case I'll supply a DLL that checks a bit more carefully before doing this.

 

=======================================================

The comments about the detailed operation of NoICE were really unrelated to the problem.  I was just explaining why the config dialogue pops up so often.  It does appear that NoICE closes and re-opens the DLL on reset as well as setting the target type.  If this is not the case then I must be using NoICE incorrectly.  When using the debug version of tbdml.dll it seems to regenerate the log file on every reset which indicates the dll being re-opened. This was not something that Codewarrior does so wasn't seen as a problem.

 

Ideally the DLL should be entirely quiet with configuration dialogues and such handled by a higher level!  Unfortunately I don't have access to the 'higher levels' so have to include them in the tbdml.dll.   Having them pop-up when setting the target seemed the best approach since this was done once per-session with Codewarrior.

bye

0 Kudos
Reply

3,901 Views
NoICE
Contributor I

Thanks for your detailed answers

1) Yes, I have seen this only with the CSMB12 (although my only other tbdml pods are a Witztronics and a JB8 pod built by Daniel Malik shortly after the creation)

 

2) What else does close() do?  Would I be better off NOT calling it, at least until the DLL can be changed?

 

3) My mistake: NoICE 9.2 does indeed close and re-open tbdml for a reset command.  I have changed the code to avoid this, but that change has not yet been released.

 

4) Regarding the pop-op when tbml is opened: one option would be to add a function that can be called by the higer level to set the various options before calling open.  If the function ISN'T called before open, then the dialog is shown. Softec does something similar.  They also provide a function to invoke the dialog directly (say from a button in the higher-level program's configuration dialog), and a way to get the results of the dialog as a string, which can be saved and later passed to the configure-before-open function.

 

Since the mmost common interface to tbdml is probably CodeWarrior, it might not be worth the effort, but it would make me and a few NoICE users happy :smileyhappy:

 

 

0 Kudos
Reply

3,901 Views
pgo
Senior Contributor V

Dear NOICE,

 

I would appreciate it if you could try the dll attached to see if it works correctly with your hardware.

 

It should function as follows (I hope):

 

CSMB12, original TBDML  - No dialogues, basically the same as original TBDML.dll

Witztronics - A nag dialogue should appear with the option to suppress.  To restore the nagging delete the (obvious) file in %APPDATA%/usbdm.

 

If you have the time I would appreciate if you would try updating the witztronics BDM to USBDM V2.  See this posting:

USBDM - Version 2 (JB16 Version)

 

It should be straightforward to restore it to the earlier version from here (V1.4 lower down the page):

Combined TBDML/OSBDM Code

 

bye

 

tbdml.zip

Message Edited by t.dowe on 2009-11-18 10:49 AM
0 Kudos
Reply

3,901 Views
NoICE
Contributor I

I just updated the Witztronics pod.

 

NoICE now shows the TBDML startup-dialog, and then says dll version 3.00; pod version 0.0.5.32

 

I am a happy camper!  Many thanks.

0 Kudos
Reply

3,901 Views
NoICE
Contributor I

This is great!  I tried the new DLL with:

 

CSMB12 board: NoICE shows DLL version 3.00; pod version 0.0.17.16

Witztronics: NoICE shows DLL version 3.00; pod version 0.0.5.20, with one-time dialog.

 

Original JB8-based V 1.0A pod: NoICE shows DLL version 3.00; pod version 0.0.16.1

 

I will need to install ICP so that I can update the Witztronics pod.

 

0 Kudos
Reply