diff --git a/Downstream/Downstream Debug.launch b/Downstream/Downstream Debug.launch index 0db9354..5183485 100644 --- a/Downstream/Downstream Debug.launch +++ b/Downstream/Downstream Debug.launch @@ -16,7 +16,7 @@ - + diff --git a/Downstream/Downstream Release.launch b/Downstream/Downstream Release.launch index ff869a2..a494c21 100644 --- a/Downstream/Downstream Release.launch +++ b/Downstream/Downstream Release.launch @@ -16,7 +16,7 @@ - + diff --git a/Downstream/Inc/downstream_spi.h b/Downstream/Inc/downstream_spi.h index 5e6f0fb..6f59a6f 100644 --- a/Downstream/Inc/downstream_spi.h +++ b/Downstream/Inc/downstream_spi.h @@ -17,7 +17,7 @@ #define DOWNSTREAM_PACKET_HEADER_LEN (2) //Min length = CommandClass & Command bytes -#define DOWNSTREAM_PACKET_LEN (DOWNSTREAM_PACKET_HEADER_LEN + USBH_MAX_DATA_BUFFER) +#define DOWNSTREAM_PACKET_LEN (DOWNSTREAM_PACKET_HEADER_LEN + BOT_PAGE_LENGTH) #define DOWNSTREAM_PACKET_LEN_MIN (DOWNSTREAM_PACKET_HEADER_LEN) #define DOWNSTREAM_PACKET_HEADER_LEN_16 (DOWNSTREAM_PACKET_HEADER_LEN / 2) @@ -59,7 +59,7 @@ typedef struct uint16_t Length16 __ALIGN_END; //Packet length includes CommandClass, Command, and Data uint8_t CommandClass; uint8_t Command; - uint8_t Data[USBH_MAX_DATA_BUFFER]; //Should (must?) be word-aligned, for USB copy routine + uint8_t Data[BOT_PAGE_LENGTH]; //Should (must?) be word-aligned, for USB copy routine } DownstreamPacketTypeDef; diff --git a/Downstream/Inc/usbh_config.h b/Downstream/Inc/usbh_config.h index 59e70eb..9552859 100644 --- a/Downstream/Inc/usbh_config.h +++ b/Downstream/Inc/usbh_config.h @@ -75,9 +75,10 @@ /*---------- -----------*/ #define USBH_USE_OS 0 + - - +#define BOT_PAGE_LENGTH 512 //Moved here from usbh_msc_bot.h to avoid a circular include loop :( + /****************************************/ /* #define for FS and HS identification */ diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h index 1f292f3..40f7790 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h @@ -35,8 +35,8 @@ /* Includes ------------------------------------------------------------------*/ #include "usbh_core.h" -#include "usbh_hid_mouse.h" -#include "usbh_hid_keybd.h" +//#include "usbh_hid_mouse.h" +//#include "usbh_hid_keybd.h" /** @addtogroup USBH_LIB * @{ diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc.h b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc.h index 83d2a3f..d184b7a 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc.h +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc.h @@ -144,7 +144,7 @@ MSC_HandleTypeDef; /* Interface Descriptor field values for MSC Protocol */ #define MSC_BOT 0x50 -#define MSC_TRANSPARENT 0x06 +#define MSC_TRANSPARENT 0x06 /** * @} */ diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc_bot.h b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc_bot.h index 2c8e805..3067d30 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc_bot.h +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc_bot.h @@ -38,7 +38,6 @@ /* Includes ------------------------------------------------------------------*/ #include "usbh_core.h" -#include "usbh_msc_bot.h" #include "downstream_spi.h" @@ -177,8 +176,6 @@ BOT_HandleTypeDef; #define BOT_DIR_OUT 1 #define BOT_DIR_BOTH 2 -#define BOT_PAGE_LENGTH 512 - #define BOT_CBW_CB_LENGTH 16 diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c index e49aafc..65f7f13 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c @@ -243,7 +243,7 @@ USBH_StatusTypeDef USBH_MSC_BOT_Process (USBH_HandleTypeDef *phost, uint8_t lun) { //Dispatch current bot_packet, then get a new one if (Downstream_MSC_PutStreamDataPacket(MSC_Handle->hbot.bot_packet, - (BOT_PAGE_LENGTH - MSC_Handle->hbot.bot_packet_bytes_remaining)) != HAL_OK) + BOT_PAGE_LENGTH) != HAL_OK) { MSC_Handle->hbot.state = BOT_ERROR_IN; break; diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_ctlreq.h b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_ctlreq.h index 8b2f7c2..59042d9 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_ctlreq.h +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Core/Inc/usbh_ctlreq.h @@ -88,7 +88,7 @@ /** @defgroup USBH_CTLREQ_Exported_Variables * @{ */ -extern uint8_t USBH_CfgDesc[512]; +//extern uint8_t USBH_CfgDesc[512]; /** * @} */ diff --git a/Downstream/Src/downstream_statemachine.c b/Downstream/Src/downstream_statemachine.c index 75ea5b3..a693a76 100644 --- a/Downstream/Src/downstream_statemachine.c +++ b/Downstream/Src/downstream_statemachine.c @@ -16,6 +16,7 @@ #include "downstream_msc.h" #include "usbh_core.h" #include "usbh_msc.h" +#include "usbh_hid.h" #include "led.h" @@ -190,7 +191,7 @@ void Downstream_HostUserCallback(USBH_HandleTypeDef *phost, uint8_t id) } //Called from main() - if (id == HOST_USER_CLASS_SELECTED) + if (id == HOST_USER_CLASS_ACTIVE) { switch (phost->pActiveClass->ClassCode) { @@ -201,6 +202,13 @@ void Downstream_HostUserCallback(USBH_HandleTypeDef *phost, uint8_t id) } break; + case USB_HID_CLASS: + + //FIXME! + + newActiveClass = COMMAND_CLASS_HID_MOUSE; + break; + //Add other classes here... diff --git a/OpenOCD_scripts/README b/OpenOCD_scripts/README index d91fa55..8913e8a 100644 --- a/OpenOCD_scripts/README +++ b/OpenOCD_scripts/README @@ -1,7 +1,9 @@ -Copy these files into your OpenOCD/scripts directory, then configure Eclipse and OpenOCD to use them. +The OpenOCD scripts in ./board/ are used in-place by the Eclipse debug configurations. You +don't need to copy them anywhere. -Example OpenOCD options: --f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f board/OpenOCD_USG_v1.0.cfg +If your OpenOCD version is <= 0.8, you will need to copy ./target/stm32f4x.cfg to your OpenOCD +installation's /scripts/target/ folder, replacing the version currently there. +If you have OpenOCD >= 0.9, this is not necessary. More info for Eclipse OpenOCD configuration: http://gnuarmeclipse.github.io/debug/openocd/ diff --git a/Upstream/Upstream Debug.launch b/Upstream/Upstream Debug.launch index 3cb0dd2..33e69f3 100644 --- a/Upstream/Upstream Debug.launch +++ b/Upstream/Upstream Debug.launch @@ -16,7 +16,7 @@ - + diff --git a/Upstream/Upstream Release.launch b/Upstream/Upstream Release.launch index 345f6aa..985eda2 100644 --- a/Upstream/Upstream Release.launch +++ b/Upstream/Upstream Release.launch @@ -16,7 +16,7 @@ - +