USBDM - Version 3 (JB16/JS16/JMxx Hardware Versions)

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

USBDM - Version 3 (JB16/JS16/JMxx Hardware Versions)

14,705 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/

 

V3.0 (May 2010) - Significant changes in some areas - Please read

  • Support for Codewarrior V10 (Eclipse version) has been introduced. This has required the development of specific GDI Dlls for each target type i.e. RS08, HCS08, CFV1 and CFV2-4.
  • The handling of RS08 devices has been further changed and now no RS08 derivative specific code is contained in the BDM firmware or USBDM.dll. RS08 code is handled by the GDI layer for Codewarrior V10 or in the OpenSourceBDM.dll for the older version of Codewarrior. This should mean that further devices may be added with no changes to either USBDM.dll or BDM Firmware.
  • Minor bug fixes in the BDM Firmware.

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

 

Enjoy.

 

bye

 

Tags (2)
0 Kudos
Reply
64 Replies

3,325 Views
osorakunakamori
Contributor I

Dear pgo,

 

I wonder if you could share any insight about the use of the USB protocol for the USBDM JM60 f/w? I am wondering why all the BDM messaging was put on endpoint 0, as opposed to leaving ep 0 strictly for control/enumeration and putting BDM traffic on its own ep? 

 

Also, what is the history of the USB stack in use on the JM60? (Freescale has been recently recommending my company to use their so called "medical" USB stack).

 

As always, thanks for the terrific work.

0 Kudos
Reply

3,325 Views
pgo
Senior Contributor V

Dear osoraku,

 

I'm a bit unclear what you are asking, I hope the following answers your questions:

 

History:

The USB stack on the JB16 is basically that used on the original TBDML - I have no idea what its origin is.  It originally was available in a couple of flavours - One where all the USB trafffic was on EP0 and another where the BDM stuff was on additional endpoints.  The second version is no longer used since it breaches the USB protocol (packet size is greater than that allowed on a low-speed device) and was not useable on Vista or later.

 

The stack on the JMxx and JS16 devices was written from scratch by me but obviously influenced by various example codes available (though I have carefully avoided looking too closely as the Freescale examples.)

 

I felt uncomfortable in using the Freescale stack on a GPLed device since I have no idea what the license ramifications would be.

 

I would NOT recommend the stack for use with a commercial product.  It has some know minor bugs (at least known by me) and is limited by my (limited) understanding of the USB protocol and the USB hardware of the devices.

 

Use of Endpoints:

I'm puzzled by your question.  On the JMxx/JS16 devices EP0 is used (mostly) for the enumeration etc.  The only BDM functions are associated with EP0 are the ICP_GET_VER, CMD_USBDM_ICP_BOOT and ALL transactions when in ICP mode.  EP1/2 are used for bulk endpoints for BDM traffic.  This seems a sensible choice to me.

 

I can't offer any opinion on the Freescale medical stack as I have not used it.

 

bye

 

 

0 Kudos
Reply

3,325 Views
osorakunakamori
Contributor I

Dear pgo,

 

Thanks for the info. I based my observation about using only ep0 on version 1 of USBDM (the JM60 pod f/w version was 1.3 IIRC). I do see in v3 that there are now also bulk endpoints 1 and 2. I agree with you this seems very reasonable.

 

Could you elaborate on what the known deficiencies might be?

 

Again, thanks very much.

 

Best Regards

 

 

0 Kudos
Reply

3,325 Views
huzeyfe
Contributor I

hi, i printed the same circuit , which is  available for JS16, . then i downloaded bootloader utility and driver files for js16.  actually there is no problem till program .s19 file into js16 .  driver successufuly installed..  then i can see  on bootloader gui that "JM60 is connected and in bootloader mode". then i can see the color of  figure is green. that is, there is no obstacle to program it. i used "USBDM_JS16CWJ.s19" file which is available. and when i clicked "mass erase " on bootloader v1.0 , again ther is no problem. but the problem is when tried to program . i encounter a kind of problem that says...

" .Erasing ... 0x0    Done
Programming ... 0xFFFA    Done
Doing CRC ... CRC Checksum Error    Error while doing CRC"

 

what can i do to solve this problem , if you help me i really appreciate it..

thanks...

 

(OS Windows XP Service Pack 2)

 

0 Kudos
Reply

3,325 Views
joncas
Contributor II

hello huzeyfe

 

I'm not an expert, but I have seen this error when the s19 file tries to program some address outside of the flash memory range of the target mcu -- when trying to read it back for verification, it get's 0xFF or 0x00 instead of the programmed byte, so the checksum doesn't match.

 

Good Luck!

Robert

0 Kudos
Reply

3,325 Views
huzeyfe
Contributor I

thank you four answer but there is sth that i'm confused..

i am using MC9S08JS16, and the same .s19 file given. what can be the reason of this problem while the others didnt encounter.?? i controlled circuit , it seems to be alright but  is it possible that my circuit has a problem ??,

0 Kudos
Reply

3,325 Views
pgo
Senior Contributor V

Dear huzeyfu,

 

I'm sorry but there is a misunderstanding here.  I should have made things clearer.

 

I think the Freescale Bootloader software is complaining about a checksum in the .S19 file not in the programming result.  The file doesn't have a checksum because it's not needed - I'm not even sure how it needs to be calculated.  USBDM does not use the CRC function available in the JS16 devices.

 

Is the JS16 recognized as being a USBDM after programming?  Check this in the hardware manager or alternatively try using the USBDM Bootloader or setboot programs to see if they can find the BDM.

 

bye

 

0 Kudos
Reply

3,325 Views
huzeyfe
Contributor I

whenever i try to run  HCS08_FlashProgrammer or setBoot exes,   it gives an error " no usbdm devices found". i think there is sth wrong that i  am missing.  then whenever i connect usb to board, it is asking new hardware found , when i tie "BL" to ground, then it remembers that my device's driver installed before  as Freescale JS Family Bootloader. do i need to tie it to ground for every connection?? or this is just because of another problem??  what can be the solution...??  it seems not to be programmed , or there is still sth wrong that i must fix it..

0 Kudos
Reply

3,325 Views
pgo
Senior Contributor V

Dear huzeyfe,

 

You should remove the link to use the hardware as a BDM.

 

It is normal for the "New Hardware Wizard" to appear when you plug in the BDM after programming.  Follow the instructions on this page to install the driver:

 

http://opax.swin.edu.au/~3340694/USBDM/USBDM_V3.2/USBDM_JS16/html/driverpage.html

 

bye

0 Kudos
Reply

3,325 Views
huzeyfe
Contributor I

THANK TOU PGO, YOU ARE GREAT... ALL PROBLEMS ARE SOLVED...

 

I CREATED MY FIRST PROJECT WITH OSBDM AND PROGRAMMED AND DEBUGGED TARGET WITH NO PROBLEM...

 

THANK YOU SOOOOO MUCH...

 

BYE.

huzeyfe

0 Kudos
Reply

3,325 Views
Master_col
Contributor III

Hi PGO and thanks again.

 

I could program the JS16 (minimal version) by the ICP header i couldn't by USB well. I followed the steps to install druver and it's ok, when i plug the  USBDM windows recognized it and i run the USBDM_test and prompts 1 device found, so i think it's ok.

 

The problem is that i created an OBDM project for HCS08QG8 and tried to debbug but an error ocurred that says that cannot connect with the target i turn off and on, and it propomts the same error. I don't  know if there's an error on hardware or something i am missing. By the way i copied the  .dll files on the codewarrior folder.

 

There's other thing that makes me confuse and is that i put a led indicator on the Vcc_BDM. and it turns on a bit when i plug it to USB and there's nothing connected on the BDM header. So i don't know if this is normal cause ther's nothing on BDM header and the Led turns on.

 

Thank you a lot for your time and excuse my poor english.

 

Best regards.

0 Kudos
Reply

3,325 Views
pgo
Senior Contributor V

Dear master_col,

 

There shouldn't be any voltage on target Vdd for the minimal JS16 USBDM. I just confirmed this - I did think it was possible there would be some small feed through from gate inputs to Vdd of the 74LV125D but this was not the case.

 

I can only suggest you check the following ( I apologise for stating the obvious!)

  • Are you using a 74LV125 - This was a carefully chosen device that has specific characteristics that don't apply to similar devices e.g. 74HC125 or 74AC125).  In particular I would expect some feed through for these devices.
  • The wiring on the 'LV124.  In particular that none of the outputs have been incorrectly connected to the JS16.
  • If you have access to a CRO or logic probe I would suggest checking that the signals change on inputs and outputs of the LV125 when you try to connect to the target.

That's about it - There isn't much to go wrong with such as simple circuit.

 

bye

0 Kudos
Reply

3,325 Views
Master_col
Contributor III

Thank you for your answer PGO.

I am using the SN74LV125APWRG4 exactly.  I am going to probe with other PCB, may be there's some bad contact or something. But do you think is a 100% hardware problem?

 

Best regards

0 Kudos
Reply

3,325 Views
Master_col
Contributor III

well i desolder the LV125 and solder a new one and by accident i desolder the 2.2Kohm( instead of the 1.5Kohm cause on my town was hard to find it) Resistance .

and it works.... im so happyyyyyyyyyyyyyyy !!!!

 

Thank you  thank you a lot PGO what a great job ! =). What could be the problem may be the resistance of 2.2 K?? 

0 Kudos
Reply

3,325 Views
pgo
Senior Contributor V

Dear master_col,

 

The change in resistor value would have little effect.  Its only purpose is to speed up the rise time at the output of the gate.  Is it possible that there was a short circuit?  Or, if your eyesight is like mine, that the resistor value was mis-read or defective?

 

bye

0 Kudos
Reply

3,325 Views
bendjy
Contributor I

Dear pgo!

 

I have trouble to use command line interface of  HCS08_FlashProgrammer.exe with MC13213 and WinXP SP2.

After I write the suitable command line, i.e.. "HCS08_FlashProgrammer.exe stef.s19 device=MC13213 /program /secure", nothing is not produce. No errors on command line command, just new line. In such moment the programming trough GUI interface is OK.

The hardware is USBDM-JS16.

 

Any idea about this?

 

10x in advance!

 

bendjy

 

0 Kudos
Reply

3,325 Views
pgo
Senior Contributor V

Dear benjy,

 

Sorry the command line support is currently broken due to the significant changes in V4.

 

(This is mentioned in the fine print somewhere!)

 

bye

0 Kudos
Reply

3,325 Views
bendjy
Contributor I

Dear pgo!

 

Thank You for Answer!

I reading about this in v4 utilities but  thought in v3 this functionality is not broken.

 

Thank You again!

 

Bye

 

bendjy

 

0 Kudos
Reply

3,325 Views
simonqian
Contributor I

I've read all the codes related to BDM in USBDM. Really complex!!!

 

I provide a simpler method:

Output: PWM + DMA,

Input: Capture + DMA.

 

For example, sending 8-bit command and receive ack:

DMA for input capture is set to receive 9 data.

DMA for pwm output is set to send 9 data(first 8 data is the command, the last is 0).

When the 2 DMAs complete, the 9th data of DMA for input capture is the length of ACK.

 

Interrupt can be enabled while doing BDM transaction. And everything can be implemented in C.

 

Related code:

http://code.google.com/p/vsprog/source/browse/trunk/dongle/firmware/Interfaces/BDM/BDM.c.

It's tested on HCS08 and HCS12.

0 Kudos
Reply

3,325 Views
pgo
Senior Contributor V

Dear simonqian,

 

Please keep in mind that the USBDM software runs on JB16/JS16 or JMxx chips.  These don't have DMA so your approach is not really an option.

 

Please start another thread if you want to discuss your software/hardware - This thread is meant to be about USBDM and was really intended to provide support and enable questions to be answered.  They're getting lost in the off-topic stuff.

 

bye

0 Kudos
Reply