Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:03 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 with Raspberry Pi .....

Author Message
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 06:59pm 19 Aug 2020
Copy link to clipboard 
Print this post

Using :

http://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=12171

The Pi sees the CMM2 , but seems not to recognize it as DFU capable ?


pi@raspberrypi:~ $ lsusb # no cmm2

Bus 001 Device 008: ID 058f:9420 Alcor Micro Corp.
Bus 001 Device 006: ID 058f:6254 Alcor Micro Corp. USB Hub
Bus 001 Device 004: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 007: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

pi@raspberrypi:~ $ lsusb # with cmm2

Bus 001 Device 009: ID 04d8:00dd Microchip Technology, Inc.
Bus 001 Device 008: ID 058f:9420 Alcor Micro Corp.
Bus 001 Device 006: ID 058f:6254 Alcor Micro Corp. USB Hub
Bus 001 Device 004: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 007: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

pi@raspberrypi:~ $ sudo dfu-util -l

dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

pi@raspberrypi:~ $ sudo dfu-util -h

Usage: dfu-util [options] ...
 -h --help Print this help message
 -V --version Print the version number
 -v --verbose Print verbose debug statements
 -l --list List currently attached DFU capable devices
 -e --detach Detach currently attached DFU capable devices
 -E --detach-delay seconds Time to wait before reopening a device after detach
 -d --device <vendor>:<product>[,<vendor_dfu>:<product_dfu>]
Specify Vendor/Product ID(s) of DFU device
 -p --path <bus-port. ... .port> Specify path to DFU device
 -c --cfg <config_nr> Specify the Configuration of DFU device
 -i --intf <intf_nr> Specify the DFU Interface number
 -S --serial <serial_string>[,<serial_string_dfu>]
Specify Serial String of DFU device
 -a --alt <alt> Specify the Altsetting of the DFU Interface
by name or by number
 -t --transfer-size <size> Specify the number of bytes per USB Transfer
 -U --upload <file> Read firmware from device into <file>
 -Z --upload-size <bytes> Specify the expected upload size in bytes
 -D --download <file> Write firmware from <file> into device
 -R --reset Issue USB Reset signalling once we're finished
 -s --dfuse-address <address> ST DfuSe mode, specify target address for
raw file download or upload. Not applicable for
DfuSe file (.dfu) downloads

pi@raspberrypi:~ $ dmesg

 256.359060] usb 1-1.3: USB disconnect, device number 5
[  514.962924] usb 1-1.3: new full-speed USB device number 9 using dwc_otg
[  515.105676] usb 1-1.3: New USB device found, idVendor=04d8, idProduct=00dd, bcdDevice= 1.00
[  515.105693] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  515.105703] usb 1-1.3: Product: MCP2221 USB-I2C/UART Combo
[  515.105712] usb 1-1.3: Manufacturer: Microchip Technology Inc.
[  515.108208] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[  515.115243] hid-generic 0003:04D8:00DD.0005: hiddev96,hidraw1: USB HID v1.11 Device [Microchip Technology Inc. MCP2221 USB-I2C/UART Combo] on usb-3f980000.usb-1.3/input2

pi@raspberrypi:~ $

Edited 2020-08-20 06:42 by hitsware2
my site
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 11:34am 20 Aug 2020
Copy link to clipboard 
Print this post

I did mine under windows, see here, but it was with  dfu-utils, so it may still be helpful.

Your issue looked like what i saw when I tried to use the USB B connection for the update.

I haven't tried putting it into update mode using the jumper, did you try using the update firmware command, which is what i used?

Then I had a choice between the CMM2's USB B connection (in place of power) and its USB A connection (in place of the keyboard).

(I didn't check inside for a micro B connection, I think only the waveshare models have that)

The USB B connection worked for making a serial terminal connection, but I had to use the USB A-A connection for the firmware update with dfu-utils.
Edited 2020-08-20 21:35 by capsikin
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 02:09pm 20 Aug 2020
Copy link to clipboard 
Print this post

Thanks !
I ' ve up dated it once with Windows ,
but using the ' Cube ' app .
I thought about trying the keyboard
connector , but don ' t have that type
cable .... Maybe I can figure out
something today .
my site
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 12:50am 21 Aug 2020
Copy link to clipboard 
Print this post

  hitsware2 said  Thanks !
I ' ve up dated it once with Windows ,
but using the ' Cube ' app .
I thought about trying the keyboard
connector , but don ' t have that type
cable .... Maybe I can figure out
something today .


I think there's two separate protocols, both supported by the Cube app, but dfu-util doesn't support the serial protocol used for the USB B connector (at least with how I had it set up - as I said, I didn't try the jumper). stm32flash on Ubuntu might, but I wouldn't know how to use that or safely test it.

And the micro-B socket probably works with dfu-util.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 01:18am 21 Aug 2020
Copy link to clipboard 
Print this post

I just tried stm32flash to no avail .....
Still don't have an A to A USB hookup though ...
my site
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 02:09am 21 Aug 2020
Copy link to clipboard 
Print this post

  hitsware2 said  I just tried stm32flash to no avail .....
Still don't have an A to A USB hookup though ...

And I saw your picture at https://www.thebackshed.com/forum/ViewTopic.php?TID=12513&PID=152103#152103
It doesn't look like you've got the USB micro-B option either.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 03:58am 21 Aug 2020
Copy link to clipboard 
Print this post

Yea ..... I ' ve got a kazillion USB cables ,
and not 1 A to A  
my site
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5089
Posted: 06:10am 21 Aug 2020
Copy link to clipboard 
Print this post

Since CMM2 is new, comming month SW updates may be coming, so prepare for a decent solution. Very logical is:

For an A-A cable, take 2 out of the Kazillion cables and cut the non-A part off.

On both A pieces solder wire to wire. Typically the wires are color coded. Solder same color together.

For Aussies and Brits:
Typically the wires are colour coded. Solder same colour together.

Or - you order from Ali or Ebay...
PicomiteVGA PETSCII ROBOTS
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 06:31am 21 Aug 2020
Copy link to clipboard 
Print this post

  Volhout said  Since CMM2 is new, comming month SW updates may be coming, so prepare for a decent solution. Very logical is:

For an A-A cable, take 2 out of the Kazillion cables and cut the non-A part off.

On both A pieces solder wire to wire. Typically the wires are color coded. Solder same color together.

For Aussies and Brits:
Typically the wires are colour coded. Solder same colour together.

Or - you order from Ali or Ebay...


I got mine from an electronics shop. I also wondered about soldering an additional socket, USB micro-B or C, to the board, but that would require some more consideration.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 06:43pm 21 Aug 2020
Copy link to clipboard 
Print this post

  Volhout said  
For an A-A cable, take 2 out of the Kazillion cables and cut the non-A part off.
On both A pieces solder wire to wire. Typically the wires are color coded.
Solder same color together.


Technology Marches On !

Good idea , but still no cigar ( back to Windows this time around )  
my site
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 07:56pm 21 Aug 2020
Copy link to clipboard 
Print this post

  hitsware2 said  Yea ..... I ' ve got a kazillion USB cables ,
and not 1 A to A  

In the U.S., you could have it in 3 days:

I used it directly, but you could plug it into a male-to-female cable.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 09:06pm 21 Aug 2020
Copy link to clipboard 
Print this post

Ordered a couple of these

I think I may be missing something besides hardware though  
my site
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 02:24am 22 Aug 2020
Copy link to clipboard 
Print this post

  hitsware2 said  Ordered a couple of these

I think I may be missing something besides hardware though  


Yeah, unless there's something wrong with your homemade cable I would think it should work like a bought one.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 03:52am 22 Aug 2020
Copy link to clipboard 
Print this post

We ' ll see .
I may just be in over my head .
( Wouldn ' t be the first time )
Edited 2020-08-22 13:53 by hitsware2
my site
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 11:54pm 25 Aug 2020
Copy link to clipboard 
Print this post

I was wondering if you had the CMM2 powered through the A-B connection, while you tried the raspberry pi USB A-A connection update. I think I needed to do that when I used Windows and USB A-A.

Not sure if you're using the jumper or the UPDATE FIRMWARE command. I've now tested both with dfu-util in the other thread (though still with Windows).
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 12:14am 26 Aug 2020
Copy link to clipboard 
Print this post

> I was wondering if you had the CMM2 powered through the A-B connection,
> while you tried the raspberry pi USB A-A connection update.
> I think I needed to do that when I used Windows and USB A-A.

The way that makes me blue in the face ....   ..... Well ..... Green

> Not sure if you're using the jumper or the UPDATE FIRMWARE command.
> I've now tested both with dfu-util in the other thread
> (though still with Windows).

I tried both . I ' ll have the proper wires in a couple of days ,
and start over .
my site
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 07:34am 26 Aug 2020
Copy link to clipboard 
Print this post

Looking back, it seems the RPi is only seeing the CMM2 as "ID 04d8:00dd Microchip Technology, Inc." which doesn't look right.

I don't know what UPDATE FIRMWARE does, but if the switches are right I'd expect an ID like 0483:df11

I suspect the RPi is just seeing the Microchip MCP2221.  (Which may be right for UPDATE FIRMWARE, but it may not.)

Once the STM32 is in DFU mode it is likely to just work (and have the ID I posted).

So, the RPi is happy and seeing things OK - but the STM32 just isn't in the right state (which suggests switch(es) in wrong setting / wrong cable / plugged in wrong).

John
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 02:26pm 26 Aug 2020
Copy link to clipboard 
Print this post

> it seems the RPi is only seeing the CMM2 as
> "ID 04d8:00dd Microchip Technology, Inc."

Right ... The RPi sees the CMM2
pi@raspberrypi:~ $ lsusb # with cmm2

> I don't know what UPDATE FIRMWARE does,
> but if the switches are right

Supposedly either moving the jumper or
UPDATE FIRMWARE should instill the DFU mode
Then
pi@raspberrypi:~ $ sudo dfu-util -l

should give

> an ID like 0483:df11

> STM32 just isn't in the right state
> (which suggests switch(es) in wrong
> setting / wrong cable / plugged in wrong).
my site
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 06:23pm 26 Aug 2020
Copy link to clipboard 
Print this post

Got it !  
I ' ll try it next update time .

i@raspberrypi:~ $ dfu-util -l
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [0483:df11] ver=0200, devnum=12, cfg=1, intf=0, path="1-1.3", alt=1, name="@Option Bytes   /0x5200201C/01*128 e", serial="200364500000"
Found DFU: [0483:df11] ver=0200, devnum=12, cfg=1, intf=0, path="1-1.3", alt=0, name="@Internal Flash   /0x08000000/16*128Kg", serial="200364500000"
pi@raspberrypi:~ $


>>UPDATE FIRMWARE
Then unplug keyboard and plug into RPi ....
My home brew wire evidently didn't work ...
Maybe Tx and Rx need to be crossed as with
some serial connections ?
my site
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025