Combined TBDML/OSBDM Code for the JM16/32/60 (USBDM)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Combined TBDML/OSBDM Code for the JM16/32/60 (USBDM)

24,866 次查看
pgo
Senior Contributor V
Dear All,

Attached is the latest version of the USBDM code and hardware description.


Enjoy.

USBDM_JM60_Distribution1.zip
Message Edited by t.dowe on 2009-08-28 04:59 PM
标记 (2)
0 项奖励
回复
102 回复数

2,216 次查看
byron
Contributor I

dear pgo,

 

  did you check if the OSBDM(based on JM**) support the "MC9S08FL16/LG32"?

These ECU is rather new and supported by P&E multilink. And the freescale has just released a small mending package for CW6.2 to support them.:)

 

I have some difficulties on them, it seems that the OSBDM is not supporting them.:( 

 

thank you.

0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

Dear Byron,

 

I'm a bit unclear what you are asking.  I hope the following is a useful reply!

 

Looking at CW 6.3 (The only one I have available) the support appears as follows:

 

MC9S08FL8 - original OSBDM-JB16, USBDM-JB16, USBDM-JMxx

MC9S08FL16/LG16/LG32 -OSBDM-JM60 (The 'new' freescale version)

 

If you are using the new Freescale debugger OSBDM-JM60 I can't make any comment since I haven't used it.

 

If the OSBDM you are using is the old one or USBDM you have try the following approach:

 

Set up the a Codewarrior project for the Full Chip Simulator.

Start the debugger (using the simulator).

Inside the debugger change the connection to the debugger you are using

Component->Set Connection

Choose (HCS08 Open Source BDM).

Exit the debugger

You should be now able to debug providing you don't change the target in Codewarrior.

 

bye

 

0 项奖励
回复

2,216 次查看
byron
Contributor I
dear pgo,

thank you for your reply. I will try the new CW6.3. And I used the old Usbdm and the CW6.2. It seems that I can't download the program to the referred target.:smileyhappy:

I will try it again.

thank you again.
0 项奖励
回复

2,216 次查看
Macias
Contributor I

Dear Pgo,

It's possible to make your software compatible with Freescale FreeMaster? I think about your USBDM version with support ColdFire V2,3,4.

 

Best Regards,

Macias

0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

Dear Macias,

 

Previously I briefly looked at the Freemaster software but I don't have time to pursue this.  I'm not even sure what is possible.

 

Sorry!

0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

New Version of USBDM available.

 

Please note that there is a new version of the USBDM firmware available in a different thread.

 

Please only post questions here that relate to the 1.5 version.

 

Thanks

 

 

0 项奖励
回复

2,216 次查看
thiag007
Contributor I

Hello Pgo,

 

Could you please tell the software used to design this PCB for Combined TBDML/OSBDM Code for the JM16/32/60 (USBDM).i want that so that i can edit the design with the package i had in my hand.

 

with regards

Thiag

0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

Dear thiag007,

 

The board design are done with Alium Designer  6 (http://www.altium.com/).  Commercial software I'm afraid.

 

bye

0 项奖励
回复

2,216 次查看
thiag007
Contributor I
Hai pgo dont afraid i want to edit the design only for my learning purpose only and to substitute some of the package with the one i had
0 项奖励
回复

2,216 次查看
UcTechnoGeek
Contributor II

pgo,

 

would it be possible to add the "save trim" function to the HCS08 family?  I noticed that the RS08 devices have the option.

 

great work on this.

 

Regards,

UcTechnoGeek

0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

Dear ucTechnoGeek,

 

Unfortunately not. The programming of HCS08 devices is done indirectly by Codewarrior downloading and executing Flash programming code in RAM. It's impossible for the BDM to intercept this.

 

The RS08 is programmed directly by the BDM code so it can be 'fiddled' with.

 

It is possible to control the value programmed to the trim by defining appropriate constants in, for example, C code but this doesn't achieve the same thing.

 

In any case, are the HCS08 devices factory trimmed? In other words, is there a trim value to preserve?

 

The commercial P&E Programmer can calculates the trim value each time a device is programmed.  It seems that this option was intended for the OSBDM programmer but was not implemented - It appears on the setup dialogue (2nd page) but doesn't do anything as far as I can tell.

 

bye

0 项奖励
回复

2,216 次查看
peg
Senior Contributor IV

Hi pgo,

 

S08 devices do come with a factory programmed trim value. It is only helpful if you are operating under the same conditions as they set it up for or you just want a rough trim.

 

I understood that the OSDBDM can't do the trim calc because it has insufficient resources and speed to calculate the BKGD signal timing to a sufficient degree of accuracy. Mind you this was back when it used a JB16.

 

P&E now have algorithms for some devices that include a preserve trim function.

I am not familiar with the RS08. What function does the OSDBDM provide in this regard?

 

0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

Dear peg,

 

Thanks for that information.  I wasn't aware that the HCS08s were factory trimmed.  At one time I tried to check this but couldn't confirm it.  

 

I forget what support OSBDM had for trim values in RS08 devices.  USBDM can calculate trim values from the connection speed.   The accuracy is limited by the input capture clock speed but seems OK for 8MHz devices.  The JMxx version of the USBDM would be more accurate.

 

I've written code to calculate trim values for specific HCS08 devices using connection speed but as explained above, it's not possible to include this in a general fashion for USBDM.  I don't have access to the GDI code for OSBDM which is also used by USBDM.

 

The limitation of accuracy doesn't affect ucTechnoGeek's question.  There is no real reason why the trim value can't be protected by codewarrior.  Trim setting options do appear on the setup dialogue for OSBDM but seem to have no affect.

 

bye

0 项奖励
回复

2,216 次查看
UcTechnoGeek
Contributor II

thanks for the info.

 

My understanding is that the S08 is factory trimmed, but the OSBDM/USBDM (via Codewarrior) does a mass erase before programming, so the trim values are erased.

 

Any way to read them first, program the firmware and then re-load the original trim values?

 

Regards,

UcTechnoGeek

0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

Dear UcTechnoGeek,

 

 It is not possible for the BDM or the driver DLL to do this as it doesn't know when the device is being erased or programmed.  In addition, it doesn't even know which S08 device is being dealt with so it wouldn't know where to look for the Trim value (However, this may be uniform for all S08 devices I haven't checked).  For the same reason it can't know how to program the device.  Basically, it's at the wrong level of the hierarchy!  This is the responsibility of the Codewarrior software not the driver.

 

If you are asking about a manual workaround it is possible to do the following:

 

Firstly either

*  Determine the  required trim value for the device using the USBDM BDM, Test_USBDM.exe software and a Target device specific script.

OR

* Use  Test_USBDM.exe software to read the trim value before 1st programming the device.

 

You may then either:

*  Modify you program to incorporate the trim value into the Image loaded into the device.

OR

* Use  Test_USBDM.exe software and a Target device specific script to program the trim value into a device already programmed with the main program.

 

 

Either of the above approaches if very clumsy!

 

Attached are some example scripts.  Use them as follows:

 

Test_USBDM <MC9S08SH8 Calculate.trim

 

bye

 

Utilities.zip

 

 

 

 

 

 

Message Edited by t.dowe on 2009-10-13 10:26 AM
0 项奖励
回复

2,216 次查看
idiao
Contributor I

Dear pgo:

      How Support KA4 and KA8?Thanks!

0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

Dear idiao,

 

From the USBDM help file:

 

  • Derivative (Experimental) - The current version of the Codewarror tools only appears to support KA1 and KA2 version of the RS08. This option allows testing of the KA4 and KA8 versions. To use, create a project in Codewarrior for the KA4 or KA8. Save the .prm file and then change the target to KA1. Replace the .prm file with the saved one. In the debugger, change the target to the appropriate version as well as selecting the appropriate derivative from the above dialogue.

 

Try the above.

 

bye

0 项奖励
回复

2,216 次查看
enrico
Contributor I

Dear pgo,

 

This is the list of USB controllers:

 

My board works on:

    - Intel 82801g(ICH7 family), intel driver, USB2.0, WinXP

    - Via PCI to USB, microsoft driver, USB2.0(i'm not sure on this), Win2K server

    - Controller universal host VIA USB, microsoft driver, USB2.0, Win2K pro

It doesn't work on:

    - SIS7001, microsoft driver, USB2.0, Win2K pro

    - Open Host Ali PCI to USB, microsoft driver, USB1.0, WinXP

    - Open Host Ali PCI to USB, microsoft driver, USB1.0, Win2K pro

 

I've tried to watch USB lines with scope and signals "seems" ok (good shape, no overshoot, about

3.3 volts of amplitude) on both working and not working PC's. USB voltages are also ok;

crystal starts to oscillate about 1ms after power-up, and the signal amplitude seems very good

(I have not yet tested if oscillation stabilizes in a reasonable time).

I'm trying to find a (working) USB analyzer software to see the first USB packets of the transaction;

the programs that I've already tried seems to work only if the USB device has been correctly

recognized, otherwise they shows me nothing... If I can get some useful data I'll post it.

 

Thank you very much

Enrico

0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

Dear enrico,

 

Attached is a S19 file and absolute file from a Freescale USB example for the JM60.  Could you program one of these into your BDM?  

 

The BDM won't work as a BDM but should enumerate as a HID device on the PC.

 

If this works on all machines we will know that the problem is in my enumeration software - If the problem persists it must be in the BDM hardware or PCs.

 

bye

Message Edited by pgo on 2009-04-25 11:19 AM
Message Edited by t.dowe on 2009-08-28 05:14 PM
0 项奖励
回复

2,216 次查看
enrico
Contributor I

Dear pgo,

 

I have tried the firmware you posted and it works on all PCs.

I have attached the log I've made with this firmware,

on a PC that was "faulty" with the USBDM code, if it could be useful...

 

Observing the traces I've posted in the previous thread, I've seen that the USBDM at

a certain point sends (if I'm not wrong) a "STALL" message... Is it normal or it could be

related with the enumeration failure?

 

Thank you very much

Enrico

 

Test_HID.zip

Message Edited by t.dowe on 2009-08-28 05:16 PM
0 项奖励
回复

2,216 次查看
pgo
Senior Contributor V

Dear enrico,

 

Yes - my code is sending a stall in response to a set address pkt.  It shouldn't be doing this!  About the only other significant difference b/w the traces you supplied was the timing of the ACK/NAK pkts on the two machines so I think this is leading to the problem.  The failing machine is polling for a response more often.  This should not cause any differences but it appears that it does.

 

I'll make some changes and get you to test them soon (if conveninet).

 

Thank you for the time spent doing this - the  USB traces are very useful.  Otherwise I would be looking for a needle in a haystack.

 

bye

 

0 项奖励
回复