Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
USB rework
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
  • Loading branch information
fpistm committed Feb 20, 2017
commit 6ac0cdc358fa10ddddc99a59a8e13e4c7a9f70a0
73 changes: 0 additions & 73 deletions cores/arduino/usb/stm32f4xx_hal_msp.c

This file was deleted.

4 changes: 2 additions & 2 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.elf2hex.extra_flags=

compiler.libs.c.flags="-I{build.system.path}/libstm32f4" "-I{build.system.path}/libstm32f4/include" "-I{build.system.path}/Drivers/STM32F4xx_HAL_Driver/Inc/" "-I{build.system.path}/Drivers/CMSIS/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/STM32F4xx/Include" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.core.path}/usb" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/"
compiler.libs.c.flags="-I{build.system.path}/libstm32f4" "-I{build.system.path}/libstm32f4/include" "-I{build.system.path}/Drivers/STM32F4xx_HAL_Driver/Inc/" "-I{build.system.path}/Drivers/CMSIS/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/STM32F4xx/Include" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.variant.path}/usb" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/"

compiler.warning_flags=-w
compiler.warning_flags.none=-w
Expand All @@ -73,7 +73,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mcpu={b
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"

## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--whole-archive "{build.variant.path}/{build.variant_system_lib}" -Wl,--no-whole-archive "{build.path}/{archive_file}" -Wl,--end-group
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/syscalls.c.o" {object_files} -Wl,--whole-archive "{build.variant.path}/{build.variant_system_lib}" -Wl,--no-whole-archive "{build.path}/{archive_file}" -Wl,--end-group

## Create eeprom
recipe.objcopy.eep.pattern=
Expand Down
21 changes: 14 additions & 7 deletions system/libstm32f4/build_gcc/stm32f4.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ CFLAGS += -D$(CHIP) -DHSE_VALUE=8000000
PROJECT_BASE_PATH = ..
CMSIS_ROOT_PATH = $(PROJECT_BASE_PATH)/../Drivers/CMSIS
HAL_ROOT_PATH = $(PROJECT_BASE_PATH)/../Drivers/STM32F4xx_HAL_Driver
MIDDLEWARES_ROOT_PATH = $(PROJECT_BASE_PATH)/../Middlewares/ST
MIDDLEWARES_USBD_ROOT_PATH = $(MIDDLEWARES_ROOT_PATH)/STM32_USB_Device_Library
MIDDLEWARES_USBD_CORE_PATH = $(MIDDLEWARES_USBD_ROOT_PATH)/Core
MIDDLEWARES_USBD_CDC_CLASS_PATH = $(MIDDLEWARES_USBD_ROOT_PATH)/Class/CDC

CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/Include
CMSIS_ST_PATH=$(CMSIS_ROOT_PATH)/Device/ST/
CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ST/$(CHIP_SERIE)
#STARTUP_FILE_PATH=$(CMSIS_CHIP_PATH)/Source/Templates/gcc
STARTUP_FILE_PATH=$(VARIANTS_PATH)

#-------------------------------------------------------------------------------
# Files
Expand All @@ -67,18 +69,21 @@ VPATH+=$(PROJECT_BASE_PATH)/source
VPATH+=$(CMSIS_ARM_PATH)
VPATH+=$(CMSIS_CHIP_PATH)/Include
VPATH+=$(CMSIS_CHIP_PATH)/Source/
VPATH+=$(STARTUP_FILE_PATH)

VPATH+=$(MIDDLEWARES_USBD_CDC_CLASS_PATH)/Src
VPATH+=$(MIDDLEWARES_USBD_CDC_CLASS_PATH)/Inc
VPATH+=$(MIDDLEWARES_USBD_CORE_PATH)/Src
VPATH+=$(MIDDLEWARES_USBD_CORE_PATH)/Inc

INCLUDES = -I$(PROJECT_BASE_PATH)
INCLUDES += -I$(HAL_ROOT_PATH)/Inc
#INCLUDES += -I$(PROJECT_BASE_PATH)/include
INCLUDES += -I$(CMSIS_ARM_PATH)
INCLUDES += -I$(CMSIS_ST_PATH)
INCLUDES += -I$(CMSIS_CHIP_PATH)/Include
INCLUDES += -I$(STARTUP_FILE_PATH)
#INCLUDES += -I$(MIDDLEWARES_USBD_HID_CLASS_PATH)/Inc
INCLUDES += -I$(MIDDLEWARES_USBD_HID_CORE_PATH)/Inc
INCLUDES += -I$(MIDDLEWARES_USBD_CDC_CLASS_PATH)/Inc
INCLUDES += -I$(MIDDLEWARES_USBD_CORE_PATH)/Inc
INCLUDES += -I$(VARIANTS_PATH)
INCLUDES += -I$(VARIANTS_PATH)/usb

#-------------------------------------------------------------------------------
ifdef DEBUG
Expand Down Expand Up @@ -133,6 +138,8 @@ C_SRC= stm32f4xx_hal_adc.c stm32f4xx_hal_dcmi.c stm32f4xx_hal_fmpi2c.c\
C_SRC+=$(wildcard $(PROJECT_BASE_PATH)/source/*.c)
C_SRC+=$(wildcard $(CMSIS_CHIP_PATH)/source/*.c)
C_SRC+=$(wildcard $(CMSIS_CHIP_PATH)/source/gcc/*.c)
C_SRC+= usbd_core.c usbd_ctlreq.c usbd_ioreq.c usbd_cdc.c
#C_SRC+=$(wildcard $(MIDDLEWARES_USBD_CDC_CLASS_PATH)/Src/usbd_hid.c)



Expand Down
Binary file modified variants/otto/libstm32f4_otto_gcc_rel.a
Binary file not shown.
141 changes: 139 additions & 2 deletions variants/otto/libstm32f4_otto_gcc_rel.a.txt
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ stm32f4xx_hal_dma.o:
00000000 T HAL_DMA_UnRegisterCallback
U HAL_GetTick
U SystemCoreClock
00000000 r flagBitshiftOffset.9605
00000000 r flagBitshiftOffset.9686

stm32f4xx_hal_hash_ex.o:

Expand Down Expand Up @@ -548,7 +548,7 @@ stm32f4xx_ll_usb.o:
00000000 T USB_StopDevice
00000000 T USB_StopHost
00000000 T USB_WritePacket
00000000 b debug.9541
00000000 b debug.9622

stm32f4xx_hal_cortex.o:
00000000 T HAL_MPU_ConfigRegion
Expand All @@ -574,6 +574,45 @@ stm32f4xx_hal_dma_ex.o:
00000000 T HAL_DMAEx_MultiBufferStart_IT

stm32f4xx_hal_hcd.o:
00000000 W HAL_HCD_Connect_Callback
00000000 T HAL_HCD_DeInit
00000000 W HAL_HCD_Disconnect_Callback
00000000 T HAL_HCD_GetCurrentFrame
00000000 T HAL_HCD_GetCurrentSpeed
00000000 T HAL_HCD_GetState
00000000 T HAL_HCD_HC_GetState
00000000 T HAL_HCD_HC_GetURBState
00000000 T HAL_HCD_HC_GetXferCount
00000000 T HAL_HCD_HC_Halt
00000000 T HAL_HCD_HC_Init
00000000 W HAL_HCD_HC_NotifyURBChange_Callback
00000000 T HAL_HCD_HC_SubmitRequest
00000000 T HAL_HCD_IRQHandler
00000000 T HAL_HCD_Init
00000000 W HAL_HCD_MspDeInit
00000000 W HAL_HCD_MspInit
00000000 T HAL_HCD_ResetPort
00000000 W HAL_HCD_SOF_Callback
00000000 T HAL_HCD_Start
00000000 T HAL_HCD_Stop
U USB_CoreInit
U USB_DisableGlobalInt
U USB_DriveVbus
U USB_EnableGlobalInt
U USB_GetCurrentFrame
U USB_GetHostSpeed
U USB_GetMode
U USB_HC_Halt
U USB_HC_Init
U USB_HC_ReadInterrupt
U USB_HC_StartXfer
U USB_HostInit
U USB_InitFSLSPClkSel
U USB_ReadInterrupts
U USB_ReadPacket
U USB_ResetPort
U USB_SetCurrentMode
U USB_StopHost

stm32f4xx_hal_nand.o:

Expand Down Expand Up @@ -1098,3 +1137,101 @@ stm32f4xx_hal_pwr.o:
stm32f4xx_hal_sdram.o:

stm32f4xx_hal_usart.o:

usbd_core.o:
00000000 T USBD_ClrClassConfig
U USBD_CtlContinueRx
U USBD_CtlContinueSendData
U USBD_CtlReceiveStatus
U USBD_CtlSendStatus
00000000 T USBD_DeInit
00000000 T USBD_Init
00000000 T USBD_LL_DataInStage
00000000 T USBD_LL_DataOutStage
U USBD_LL_DeInit
00000000 T USBD_LL_DevConnected
00000000 T USBD_LL_DevDisconnected
U USBD_LL_Init
00000000 T USBD_LL_IsoINIncomplete
00000000 T USBD_LL_IsoOUTIncomplete
U USBD_LL_OpenEP
U USBD_LL_PrepareReceive
00000000 T USBD_LL_Reset
00000000 T USBD_LL_Resume
00000000 T USBD_LL_SOF
00000000 T USBD_LL_SetSpeed
00000000 T USBD_LL_SetupStage
U USBD_LL_StallEP
U USBD_LL_Start
U USBD_LL_Stop
00000000 T USBD_LL_Suspend
U USBD_ParseSetupRequest
00000000 T USBD_RegisterClass
00000000 T USBD_RunTestMode
00000000 T USBD_SetClassConfig
00000000 T USBD_Start
U USBD_StdDevReq
U USBD_StdEPReq
U USBD_StdItfReq
00000000 T USBD_Stop

usbd_ctlreq.o:
U USBD_ClrClassConfig
00000000 T USBD_CtlError
U USBD_CtlSendData
U USBD_CtlSendStatus
00000000 T USBD_GetString
U USBD_LL_ClearStallEP
U USBD_LL_IsStallEP
U USBD_LL_SetUSBAddress
U USBD_LL_StallEP
00000000 T USBD_ParseSetupRequest
U USBD_SetClassConfig
00000000 T USBD_StdDevReq
00000000 T USBD_StdEPReq
00000000 T USBD_StdItfReq
00000000 b cfgidx.10192

usbd_ioreq.o:
00000000 T USBD_CtlContinueRx
00000000 T USBD_CtlContinueSendData
00000000 T USBD_CtlPrepareRx
00000000 T USBD_CtlReceiveStatus
00000000 T USBD_CtlSendData
00000000 T USBD_CtlSendStatus
00000000 T USBD_GetRxCount
U USBD_LL_GetRxDataSize
U USBD_LL_PrepareReceive
U USBD_LL_Transmit

usbd_cdc.o:
00000000 D USBD_CDC
00000000 D USBD_CDC_CfgFSDesc
00000000 D USBD_CDC_CfgHSDesc
00000000 t USBD_CDC_DataIn
00000000 t USBD_CDC_DataOut
00000000 t USBD_CDC_DeInit
00000000 d USBD_CDC_DeviceQualifierDesc
00000000 t USBD_CDC_EP0_RxReady
00000000 T USBD_CDC_GetDeviceQualifierDescriptor
00000000 t USBD_CDC_GetFSCfgDesc
00000000 t USBD_CDC_GetHSCfgDesc
00000000 t USBD_CDC_GetOtherSpeedCfgDesc
00000000 t USBD_CDC_Init
00000000 D USBD_CDC_OtherSpeedCfgDesc
00000000 T USBD_CDC_ReceivePacket
00000000 T USBD_CDC_RegisterInterface
00000000 T USBD_CDC_SetRxBuffer
00000000 T USBD_CDC_SetTxBuffer
00000000 t USBD_CDC_Setup
00000000 T USBD_CDC_TransmitPacket
U USBD_CtlPrepareRx
U USBD_CtlSendData
U USBD_LL_CloseEP
U USBD_LL_GetRxDataSize
U USBD_LL_OpenEP
U USBD_LL_PrepareReceive
U USBD_LL_Transmit
U free
00000000 b ifalt.10186
U malloc
2 changes: 1 addition & 1 deletion variants/otto/stm32f4xx_hal_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
// #define HAL_WWDG_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_PCD_MODULE_ENABLED
// #define HAL_HCD_MODULE_ENABLED
#define HAL_HCD_MODULE_ENABLED
// #define HAL_FMPI2C_MODULE_ENABLED
// #define HAL_SPDIFRX_MODULE_ENABLED
// #define HAL_DFSDM_MODULE_ENABLED
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/usb/stm32f4xx_it.c → variants/otto/usb/stm32f4xx_it.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
extern PCD_HandleTypeDef hpcd;

/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/

/******************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/usb/stm32f4xx_it.h → variants/otto/usb/stm32f4xx_it.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#ifdef __cplusplus
extern "C" {
#endif
#endif

/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
Expand Down
10 changes: 5 additions & 5 deletions cores/arduino/usb/usb_device.c → variants/otto/usb/usb_device.c
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
******************************************************************************
* @file : USB_DEVICE
* @file : USB_DEVICE
* @version : v1.0_Cube
* @brief : This file implements the USB Device
* @brief : This file implements the USB Device
******************************************************************************
*
* COPYRIGHT(c) 2016 STMicroelectronics
Expand Down Expand Up @@ -43,19 +43,19 @@
/* USB Device Core handle declaration */
//USBD_HandleTypeDef hUsbDeviceFS;

/* init function */
/* init function */
void MX_USB_DEVICE_Init(void)
{

/* Init Device Library */
USBD_Init(&hUsbDeviceFS, &FS_Desc, DEVICE_FS);

/* Add Supported Class */
USBD_RegisterClass(&hUsbDeviceFS, &USBD_CDC);

/* Add CDC Interface Class */
USBD_CDC_RegisterInterface(&hUsbDeviceFS, &USBD_Interface_fops_FS);

/* Start Device Process */
USBD_Start(&hUsbDeviceFS);

Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/usb/usb_device.h → variants/otto/usb/usb_device.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

extern USBD_HandleTypeDef hUsbDeviceFS;

/* USB_Device init function */
/* USB_Device init function */
void MX_USB_DEVICE_Init(void);

#ifdef __cplusplus
Expand Down
Loading