Electronics > Beginners

CS32F103C8T6 datasheet and tests (was:"UNEXPECTED idcode" flashing bluepill)

<< < (9/10) > >>

Macbeth:
I found the examples at %userprofile%/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.0/Projects/STM32CubeProjectsList.html

ebastler:
Hey, thank you very much for digging!
I'm heading home from the office right now to check on my computer.  :)

ak634:

--- Quote from: Macbeth on October 11, 2019, 11:58:10 am ---I haven't had a chance to do any further USB testing, but I did get this version of mecrisp Forth with USB serial console working on the "991KA". See if that works and if so perhaps there is a clue in the source code.

--- End quote ---

I tried it on one of my boards and unfortunately it did not work. Although it makes some progress during USB enumeration, it doesn't make it to create the console. The USB packet dump is full of truncated or empty packets sent from the device. I was able to make some progress with my code too, but essentially seeing similar problems.


--- Code: --->:~/stm32-test$ dmesg | tail
[833568.806235] usb 1-4: config index 0 descriptor too short (expected 67, got 64)
[833568.806240] usb 1-4: config 1 has an invalid descriptor of length 7, skipping remainder of the config
[833568.806245] usb 1-4: config 1 interface 1 altsetting 0 has 1 endpoint descriptor, different from the interface descriptor's value: 2
[833568.807532] usb 1-4: New USB device found, idVendor=0483, idProduct=5740
[833568.807535] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[833568.807537] usb 1-4: Product: Forth Serial Port
[833568.807539] usb 1-4: Manufacturer: Mecrisp (STM32F10x)
[833568.807712] usb 1-4: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[833568.808141] cdc_acm 1-4:1.0: This device cannot do calls on its own. It is not a modem.
[833568.808149] cdc_acm: probe of 1-4:1.0 failed with error -22
>:~/stm32-test$ dmesg | tail
[833568.806235] usb 1-4: config index 0 descriptor too short (expected 67, got 64)
[833568.806240] usb 1-4: config 1 has an invalid descriptor of length 7, skipping remainder of the config
[833568.806245] usb 1-4: config 1 interface 1 altsetting 0 has 1 endpoint descriptor, different from the interface descriptor's value: 2
[833568.807532] usb 1-4: New USB device found, idVendor=0483, idProduct=5740
[833568.807535] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[833568.807537] usb 1-4: Product: Forth Serial Port
[833568.807539] usb 1-4: Manufacturer: Mecrisp (STM32F10x)
[833568.807712] usb 1-4: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[833568.808141] cdc_acm 1-4:1.0: This device cannot do calls on its own. It is not a modem.
[833568.808149] cdc_acm: probe of 1-4:1.0 failed with error -22
>:~/stm32-test$ dmesg | tail
[833568.807712] usb 1-4: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[833568.808141] cdc_acm 1-4:1.0: This device cannot do calls on its own. It is not a modem.
[833568.808149] cdc_acm: probe of 1-4:1.0 failed with error -22
[833613.885577] usb 1-4: USB disconnect, device number 58
[833614.157665] usb 1-4: new full-speed USB device number 59 using xhci_hcd
[833614.269936] usb 1-4: Device not responding to setup address.
[833614.473905] usb 1-4: Device not responding to setup address.
[833614.678026] usb 1-4: device not accepting address 59, error -71
[833615.198306] usb 1-4: new full-speed USB device number 60 using xhci_hcd
[833615.310424] usb 1-4: device descriptor read/64, error -71
>:~/stm32-test$ dmesg | tail
[833568.807712] usb 1-4: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[833568.808141] cdc_acm 1-4:1.0: This device cannot do calls on its own. It is not a modem.
[833568.808149] cdc_acm: probe of 1-4:1.0 failed with error -22
[833613.885577] usb 1-4: USB disconnect, device number 58
[833614.157665] usb 1-4: new full-speed USB device number 59 using xhci_hcd
[833614.269936] usb 1-4: Device not responding to setup address.
[833614.473905] usb 1-4: Device not responding to setup address.
[833614.678026] usb 1-4: device not accepting address 59, error -71
[833615.198306] usb 1-4: new full-speed USB device number 60 using xhci_hcd
[833615.310424] usb 1-4: device descriptor read/64, error -71

--- End code ---

adamfxtion:
I am also having similar problems with USB enumeration and recent STM32 blue pill boards.
I did however find that using the opencm3 CDC example compiled in Platformio/VSC,  (all updated to most recent version, source code from https://raw.githubusercontent.com/libopencm3/libopencm3-examples/master/examples/stm32/f1/stm32-maple/usb_cdcacm/cdcacm.c) did allow these modules to enumerate successfully for me in Windows 10 (See screenshot), with it coming up as a Serial port in device manager. It does not actually work once I try to open it with a terminal, but I think that is because the example does not actually have the necessary support. I have also attached a compiled version for test purposes.

Macbeth:
@ak634 - Hmm, I've been using Windows 10 and putty to connect. So I decided to test it on Ubuntu 18.04 and it works for me. Tested using sudo screen /dev/ttyACM0

dmesg:

--- Code: ---[   69.229951] usb 1-5: new full-speed USB device number 6 using xhci_hcd
[   69.490083] usb 1-5: New USB device found, idVendor=0483, idProduct=5740, bcdDevice= 2.00
[   69.490087] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   69.490089] usb 1-5: Product: Forth Serial Port
[   69.490091] usb 1-5: Manufacturer: Mecrisp (STM32F10x)
[   69.490092] usb 1-5: SerialNumber: 1D686BD9
[   69.507525] cdc_acm 1-5:1.0: ttyACM0: USB ACM device

--- End code ---

@adamfxtion - Thanks for this! I hadn't tried libopencm3 yet, just Arduino and CubeMX.

This one nearly works in Win 10 (as you say it enumerates and allocates a COM port in device manager) but I can't connect to it. However it works fine in linux as /dev/ttyACM0. It's dmesg is pretty much as above.

Wireshark logs of this example vs mecrisp shows Windows is sending USBCOM protocol GET LINE CODING Requests and this code example is not returning anything, while the mecrisp is answering these requests with an "Unknown type 21 Status" packet.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod