How to use stm32f103 as usb hid (Assembly language) ? I want to learn everything about usb hid protocol...
Thanks for your replies,already.
Thanks for your replies,already.
As predecesors says: It makes (almost) no sense to study USB (or any other protocols) from assembly language for specific CPU/microcontroller. But If you really want this:
I'm using gcc suite for building of projects, and there is a tool/binary named objdump, which is able disasembly of binary target and part of Makefile looks like:
#######################################
# binaries
#######################################
BINPATH = /opt/arm-tools/arm-none-eabi/bin
PREFIX = arm-none-eabi-
CC = $(BINPATH)/$(PREFIX)gcc
AS = $(BINPATH)/$(PREFIX)gcc -x assembler-with-cpp
CP = $(BINPATH)/$(PREFIX)objcopy
AR = $(BINPATH)/$(PREFIX)ar
SZ = $(BINPATH)/$(PREFIX)size
OBJDUMP = $(BINPATH)/$(PREFIX)objdump
HEX = $(CP) -O ihex
BIN = $(CP) -O binary -S
...
$(BUILD_DIR)/$(TARGET).uasm: $(BUILD_DIR)/$(TARGET).elf Makefile.linux
$(OBJDUMP) -d $(BUILD_DIR)/$(TARGET).elf > $@And result looks like (this is non related to USB_HID but USB_CDC/Serial Comm port)
08004380 <MX_USB_DEVICE_Init>:
8004380: b510 push {r4, lr}
8004382: 4c09 ldr r4, [pc, #36] ; (80043a8 <MX_USB_DEVICE_Init+0x28>)
8004384: 2200 movs r2, #0
8004386: 4909 ldr r1, [pc, #36] ; (80043ac <MX_USB_DEVICE_Init+0x2c>)
8004388: 4620 mov r0, r4
800438a: f004 fe1c bl 8008fc6 <USBD_Init>
800438e: 4908 ldr r1, [pc, #32] ; (80043b0 <MX_USB_DEVICE_Init+0x30>)
8004390: 4620 mov r0, r4
8004392: f004 fe2d bl 8008ff0 <USBD_RegisterClass>
8004396: 4620 mov r0, r4
8004398: 4906 ldr r1, [pc, #24] ; (80043b4 <MX_USB_DEVICE_Init+0x34>)
800439a: f004 fc40 bl 8008c1e <USBD_CDC_RegisterInterface>
800439e: 4620 mov r0, r4
80043a0: e8bd 4010 ldmia.w sp!, {r4, lr}
80043a4: f004 be2b b.w 8008ffe <USBD_Start>Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.