T48B4 000:011.210 SEGGER J-Link V7.22b Log File
T48B4 000:011.565 DLL Compiled: Jun 17 2021 17:22:49
T48B4 000:011.573 Logging started @ 2022-03-01 10:47
T48B4 000:011.579 - 11.583ms
T48B4 000:011.592 JLINK_SetWarnOutHandler(...)
T48B4 000:011.602 - 0.013ms
T48B4 000:011.611 JLINK_OpenEx(...)
T48B4 000:013.816 Firmware: J-Link V9 compiled May 7 2021 16:26:12
T48B4 000:014.190 Firmware: J-Link V9 compiled May 7 2021 16:26:12
T48B4 000:014.429 Decompressing FW timestamp took 195 us
T48B4 000:020.617 Hardware: V9.60
T48B4 000:020.645 S/N: 69662118
T48B4 000:020.655 OEM: SEGGER
T48B4 000:020.663 Feature(s): RDI, GDB, FlashDL, FlashBP, JFlash
T48B4 000:021.546 TELNET listener socket opened on port 19021
T48B4 000:021.672 WEBSRV Starting webserver
T48B4 000:021.922 WEBSRV Webserver running on local port 19080
T48B4 000:021.937 - 10.329ms returns "O.K."
T48B4 000:021.951 JLINK_GetEmuCaps()
T48B4 000:021.959 - 0.011ms returns 0xB9FF7BBF
T48B4 000:021.970 JLINK_TIF_GetAvailable(...)
T48B4 000:022.137 - 0.177ms
T48B4 000:022.155 JLINK_SetErrorOutHandler(...)
T48B4 000:022.163 - 0.011ms
T48B4 000:022.184 JLINK_ExecCommand("ProjectFile = "E:\cubemx-project\vcp-405\MDK-ARM\JLinkSettings.ini"", ...).
T48B4 000:032.651 - 10.479ms returns 0x00
T48B4 000:036.350 JLINK_ExecCommand("Device = STM32F405RGTx", ...).
T48B4 000:042.205 Device "STM32F405RG" selected.
T48B4 000:043.597 - 7.239ms returns 0x00
T48B4 000:043.619 JLINK_GetHardwareVersion()
T48B4 000:043.625 - 0.008ms returns 96000
T48B4 000:043.631 JLINK_GetDLLVersion()
T48B4 000:043.636 - 0.007ms returns 72202
T48B4 000:043.642 JLINK_GetOEMString(...)
T48B4 000:043.648 JLINK_GetFirmwareString(...)
T48B4 000:043.659 - 0.013ms
T48B4 000:063.132 JLINK_GetDLLVersion()
T48B4 000:063.156 - 0.027ms returns 72202
T48B4 000:063.163 JLINK_GetCompileDateTime()
T48B4 000:063.168 - 0.007ms
T48B4 000:066.572 JLINK_GetFirmwareString(...)
T48B4 000:066.586 - 0.016ms
T48B4 000:069.784 JLINK_GetHardwareVersion()
T48B4 000:069.794 - 0.013ms returns 96000
T48B4 000:072.951 JLINK_GetSN()
T48B4 000:072.962 - 0.013ms returns 69662118
T48B4 000:076.153 JLINK_GetOEMString(...)
T48B4 000:084.227 JLINK_TIF_Select(JLINKARM_TIF_SWD)
T48B4 000:084.759 - 0.541ms returns 0x00
T48B4 000:084.774 JLINK_HasError()
T48B4 000:084.786 JLINK_SetSpeed(5000)
T48B4 000:084.841 - 0.060ms
T48B4 000:084.851 JLINK_GetId()
T48B4 000:088.143 InitTarget() start
T48B4 000:088.156 J-Link Script File: Executing InitTarget()
T48B4 000:098.915 InitTarget() end
T48B4 000:105.196 Found SW-DP with ID 0x2BA01477
T48B4 000:110.876 DPIDR: 0x2BA01477
T48B4 000:114.635 Scanning AP map to find all available APs
T48B4 000:118.349 AP[1]: Stopped AP scan as end of AP map has been reached
T48B4 000:121.572 AP[0]: AHB-AP (IDR: 0x24770011)
T48B4 000:124.820 Iterating through AP map to find AHB-AP to use
T48B4 000:131.366 AP[0]: Core found
T48B4 000:136.654 AP[0]: AHB-AP ROM base: 0xE00FF000
T48B4 000:140.847 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
T48B4 000:145.818 Found Cortex-M4 r0p1, Little endian.
T48B4 000:246.716 -- Max. mem block: 0x00010C40
T48B4 000:246.910 CPU_ReadMem(4 bytes @ 0xE000EDF0)
T48B4 000:247.210 CPU_ReadMem(4 bytes @ 0xE0002000)
T48B4 000:253.006 FPUnit: 6 code (BP) slots and 2 literal slots
T48B4 000:253.071 CPU_ReadMem(4 bytes @ 0xE000EDFC)
T48B4 000:253.416 CPU_WriteMem(4 bytes @ 0xE000EDFC)
T48B4 000:253.717 CPU_ReadMem(4 bytes @ 0xE0001000)
T48B4 000:253.989 CPU_WriteMem(4 bytes @ 0xE0001000)
T48B4 000:254.267 CPU_ReadMem(4 bytes @ 0xE000ED88)
T48B4 000:254.549 CPU_WriteMem(4 bytes @ 0xE000ED88)
T48B4 000:254.845 CPU_ReadMem(4 bytes @ 0xE000ED88)
T48B4 000:255.218 CPU_WriteMem(4 bytes @ 0xE000ED88)
T48B4 000:260.513 CoreSight components:
T48B4 000:264.120 ROMTbl[0] @ E00FF000
T48B4 000:264.177 CPU_ReadMem(64 bytes @ 0xE00FF000)
T48B4 000:264.709 CPU_ReadMem(32 bytes @ 0xE000EFE0)
T48B4 000:269.190 ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
T48B4 000:269.343 CPU_ReadMem(32 bytes @ 0xE0001FE0)
T48B4 000:273.269 ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
T48B4 000:273.287 CPU_ReadMem(32 bytes @ 0xE0002FE0)
T48B4 000:277.249 ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
T48B4 000:277.280 CPU_ReadMem(32 bytes @ 0xE0000FE0)
T48B4 000:281.611 ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
T48B4 000:281.628 CPU_ReadMem(32 bytes @ 0xE0040FE0)
T48B4 000:285.509 ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
T48B4 000:285.525 CPU_ReadMem(32 bytes @ 0xE0041FE0)
T48B4 000:289.250 ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
T48B4 000:289.508 - 204.678ms returns 0x2BA01477
T48B4 000:289.538 JLINK_GetDLLVersion()
T48B4 000:289.543 - 0.007ms returns 72202
T48B4 000:289.549 JLINK_CORE_GetFound()
T48B4 000:289.554 - 0.007ms returns 0xE0000FF
T48B4 000:289.602 JLINK_GetDebugInfo(0x100 = JLINKARM_ROM_TABLE_ADDR_INDEX)
T48B4 000:289.638 Value=0xE00FF000
T48B4 000:289.645 - 0.046ms returns 0
T48B4 000:292.937 JLINK_GetDebugInfo(0x100 = JLINKARM_ROM_TABLE_ADDR_INDEX)
T48B4 000:292.948 Value=0xE00FF000
T48B4 000:292.955 - 0.020ms returns 0
T48B4 000:292.961 JLINK_GetDebugInfo(0x101 = JLINKARM_DEBUG_INFO_ETM_ADDR_INDEX)
T48B4 000:292.967 Value=0xE0041000
T48B4 000:292.973 - 0.014ms returns 0
T48B4 000:292.982 JLINK_ReadMemEx(0xE0041FD0, 0x20 Bytes, Flags = 0x02000004)
T48B4 000:293.008 CPU_ReadMem(32 bytes @ 0xE0041FD0)
T48B4 000:293.417 Data: 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
T48B4 000:293.429 - 0.449ms returns 32 (0x20)
T48B4 000:293.437 JLINK_GetDebugInfo(0x102 = JLINKARM_DEBUG_INFO_MTB_ADDR_INDEX)
T48B4 000:293.442 Value=0x00000000
T48B4 000:293.449 - 0.014ms returns 0
T48B4 000:293.455 JLINK_GetDebugInfo(0x103 = JLINKARM_DEBUG_INFO_TPIU_ADDR_INDEX)
T48B4 000:293.460 Value=0xE0040000
T48B4 000:293.467 - 0.014ms returns 0
T48B4 000:293.472 JLINK_GetDebugInfo(0x104 = JLINKARM_DEBUG_INFO_ITM_ADDR_INDEX)
T48B4 000:293.477 Value=0xE0000000
T48B4 000:293.484 - 0.014ms returns 0
T48B4 000:293.490 JLINK_GetDebugInfo(0x105 = JLINKARM_DEBUG_INFO_DWT_ADDR_INDEX)
T48B4 000:293.495 Value=0xE0001000
T48B4 000:293.501 - 0.014ms returns 0
T48B4 000:293.507 JLINK_GetDebugInfo(0x106 = JLINKARM_DEBUG_INFO_FPB_ADDR_INDEX)
T48B4 000:293.512 Value=0xE0002000
T48B4 000:293.519 - 0.014ms returns 0
T48B4 000:293.524 JLINK_GetDebugInfo(0x107 = JLINKARM_DEBUG_INFO_NVIC_ADDR_INDEX)
T48B4 000:293.529 Value=0xE000E000
T48B4 000:293.536 - 0.014ms returns 0
T48B4 000:293.541 JLINK_GetDebugInfo(0x10C = JLINKARM_DEBUG_INFO_DBG_ADDR_INDEX)
T48B4 000:293.546 Value=0xE000EDF0
T48B4 000:293.553 - 0.014ms returns 0
T48B4 000:293.559 JLINK_GetDebugInfo(0x01 = Unknown)
T48B4 000:293.564 Value=0x00000001
T48B4 000:293.571 - 0.014ms returns 0
T48B4 000:293.576 JLINK_ReadMemU32(0xE000ED00, 0x1 Items)
T48B4 000:293.586 CPU_ReadMem(4 bytes @ 0xE000ED00)
T48B4 000:293.859 Data: 41 C2 0F 41
T48B4 000:293.872 Debug reg: CPUID
T48B4 000:293.887 - 0.313ms returns 1 (0x1)
T48B4 000:293.895 JLINK_GetDebugInfo(0x10F = JLINKARM_DEBUG_INFO_HAS_CORTEX_M_SECURITY_EXT_INDEX)
T48B4 000:293.901 Value=0x00000000
T48B4 000:293.907 - 0.015ms returns 0
T48B4 000:293.924 JLINK_HasError()
T48B4 000:293.930 JLINK_SetResetType(JLINKARM_CM3_RESET_TYPE_NORMAL)
T48B4 000:293.935 - 0.007ms returns JLINKARM_CM3_RESET_TYPE_NORMAL
T48B4 000:293.941 JLINK_Reset()
T48B4 000:293.964 CPU is running
T48B4 000:293.973 CPU_WriteMem(4 bytes @ 0xE000EDF0)
T48B4 000:294.252 CPU is running
T48B4 000:294.276 CPU_WriteMem(4 bytes @ 0xE000EDFC)
T48B4 000:301.594 Reset: Halt core after reset via DEMCR.VC_CORERESET.
T48B4 000:305.865 Reset: Reset device via AIRCR.SYSRESETREQ.
T48B4 000:305.889 CPU is running
T48B4 000:305.901 CPU_WriteMem(4 bytes
Stm32F405虚拟串口+HID设备
需积分: 0 12 浏览量
更新于2022-03-14
收藏 21.94MB RAR 举报
STM32F405是意法半导体(STMicroelectronics)推出的一款基于ARM Cortex-M4内核的微控制器,它在嵌入式开发领域广泛应用,特别是在单片机设计中。这款芯片具有高性能、低功耗的特点,适用于各种复杂的嵌入式系统。在本项目中,我们将探讨如何利用STM32F405实现虚拟串口(CDC)和人机接口设备(HID)的复合功能。
虚拟串口是通过USB接口模拟传统的串行通信接口,如COM端口,使得用户可以像操作串口一样与STM32进行数据传输。这一特性在需要远程监控或调试时非常有用,因为许多计算机操作系统都内置了对串口的支持。
人机接口设备(HID)是USB设备类之一,常见于键盘、鼠标等输入设备以及游戏控制器、触摸屏等输出设备。STM32F405可以通过USB接口实现HID功能,为用户提供直接与硬件交互的通道,例如控制LED灯、读取传感器数据等。
要实现STM32F405作为虚拟串口和HID设备的复合设备,我们需要以下步骤:
1. **配置USB控制器**:STM32F405内部集成了USB OTG全速控制器,支持USB 2.0协议。我们需要在固件中设置相关的寄存器,使能USB时钟,并配置USB控制器工作在设备模式。
2. **编写设备描述符**:设备描述符是USB设备向主机报告其属性的结构体,包括设备类型、版本、配置等信息。对于复合设备,需要定义一个包含VCP和HID两个接口的配置描述符。
3. **实现类驱动**:STM32F405需要实现CDC和HID的类驱动,以便处理相应的USB通信。CDC驱动主要负责虚拟串口的数据传输,HID驱动则处理输入和输出报告。
4. **中断处理**:当USB主机发送数据或者请求状态时,STM32F405会接收到中断。我们需要编写中断服务程序来处理这些事件,如读写请求、设备枚举等。
5. **固件框架**:为了方便管理各个功能,通常会使用如ChibiOS、FreeRTOS等实时操作系统,或者HAL库提供的API来构建固件框架。这有助于提高代码的可读性和可维护性。
6. **软件工具链**:使用IDE如Keil MDK或IAR Embedded Workbench进行编程,同时可能需要STM32CubeMX配置工具来生成初始化代码。
在`usb-composite-vcp&hid-405`这个项目文件中,包含了实现上述功能的源代码、头文件、配置文件等。开发者可以通过阅读和分析这些代码,了解STM32F405如何实现虚拟串口和HID的复合功能,并将其应用到自己的项目中。
STM32F405虚拟串口+HID设备的实现涉及到USB协议的理解、设备描述符的设计、类驱动的编写以及中断处理等多个环节,需要扎实的嵌入式系统知识和实践经验。通过学习和实践,开发者不仅可以掌握STM32的USB功能,还能对USB复合设备有更深入的认识。
_等风
- 粉丝: 4
- 资源: 7
最新资源
- 没用333333333333333333333333333333
- 基于Vue和SpringBoot的企业员工管理系统2.0版本设计源码
- 【C++初级程序设计·配套源码】第2期-基本数据类型
- 基于Java和Vue的kopsoftKANBAN车间电子看板设计源码
- 影驰战将PS3111 东芝芯片TT18G23AIN开卡成功分享,图片里面画线的选项很重要
- 【C++初级程序设计·配套源码】第1期-语法基础
- 基于JavaScript、CSS、HTML的简易DOM版飞机游戏设计源码
- 基于Java开发的日程管理FlexTime应用设计源码
- SM2258XT-BGA144-4BGA180-6L-R1019 三星KLUCG4J1CB B0B1颗粒开盘工具 , EC, 3A, 94, 43, A4, CA 七彩虹SL300这个固件有用
- GJB 5236-2004 军用软件质量度量