Linux STM32F0发现:无tty

Linux STM32F0发现:无tty,linux,stm32,tty,usbserial,usart,Linux,Stm32,Tty,Usbserial,Usart,我目前正试图通过USART向我的STM32F0308板发送数据。 数据应该由使用PySerial的Python脚本发送 但是,当我插入电路板时,我找不到相应的/dev/ttyxxx 该板是分支的,我可以在其上闪存代码(通过USB的STLink),但没有可见的端口 dmesg显示计算机知道电路板: [10364.101554]usb 1-3:usb断开连接,设备编号10 [10368.044231]usb 1-3:使用XHCD的12号全新全速usb设备 [10368.173948]usb 1-3:

我目前正试图通过USART向我的STM32F0308板发送数据。 数据应该由使用PySerial的Python脚本发送

但是,当我插入电路板时,我找不到相应的/dev/ttyxxx

该板是分支的,我可以在其上闪存代码(通过USB的STLink),但没有可见的端口

dmesg
显示计算机知道电路板:

[10364.101554]usb 1-3:usb断开连接,设备编号10
[10368.044231]usb 1-3:使用XHCD的12号全新全速usb设备
[10368.173948]usb 1-3:找到新的usb设备,idVendor=0483,idProduct=3748
[10368.173956]usb 1-3:新的usb设备字符串:Mfr=1,Product=2,SerialNumber=3
[10368.173959]usb 1-3:产品:STM32 STLink
[10368.173962]usb 1-3:制造商:意法半导体
[10368.173965]usb 1-3:序列号:VÿnIxRT68\xfffffffc2\xfffffffff87
以下是
lsusb
的输出:

总线001设备012:ID 0483:3748 STMicroelectronics ST-LINK/V2 下面是ls/dev/tty*的输出:

tty tty12 tty17 tty21 tty26 tty30 tty35 tty4 tty44 tty49 tty53 tty58 tty62 ttyprintk ttyS12 ttyS17 ttyS21 ttyS26 ttyS30 ttyS7
tty0 tty13 tty18 tty22 tty27 tty31 tty36 tty40 tty45 tty5 tty54 tty59 tty63 ttyS0 ttyS13 ttyS18 ttyS22 ttyS27 ttyS31 ttyS8
tty1 tty14 tty19 tty23 tty28 tty32 tty37 tty41 tty46 tty50 tty55 tty6 tty7 ttyS1 ttyS14 ttyS19 ttyS23 ttyS28 ttyS4 ttyS9
tty10 tty15 tty2 tty24 tty29 tty33 tty38 tty42 tty47 tty51 tty56 tty60 tty8 ttyS10 ttyS15 ttyS2 ttyS24 ttyS29 ttyS5
tty11 tty16 tty20 tty25 tty3 tty34 tty39 tty43 tty48 tty52 tty57 tty61 tty9 ttyS11 ttyS16 ttyS20 ttyS25 ttyS3 ttyS6
下面是初始化串行端口的函数:

#初始化串行端口的函数
def init_serial():
必须在每个函数中声明全局ser#
#设置串行:端口、波特率、超时(端口未挂起)
ser=serial.serial(port=“/dev/ttyS3”,波特率=9600,超时=5)
如果ser.isOpen():
塞尔克洛斯()
#打开串行端口
爵士公开赛()
#打印:端口打开或关闭
如果ser.isOpen():
打印(“端口打开:+ser.portstr”)
其他:
打印(“端口未打开:我们有问题!”)
#函数到此结束
我使用的是Ubuntu15.04,但它在另一台使用Debian的计算机上也不起作用。 据ST称,STM32F0x0线路支持USB

编辑: 根据要求,
lsusb-v的输出:

Bus 001 Device 003: ID 0483:3748 STMicroelectronics ST-LINK/V2
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0483 STMicroelectronics
  idProduct          0x3748 ST-LINK/V2
  bcdDevice            1.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              4 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0

设备被发现,它是一个ST-Link调试接口


据我所知,STM32F0308 Discovery没有USB UART接口,并且ST Link不包括UART功能。如果没有额外的硬件,您试图做的事情似乎是不可能的。您必须获得一个带有单独连接器的USB UART接口,并将其连接到头上暴露的USART引脚。

您可以发布
lsusb-v
的输出吗?