Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
5dd455d0
Commit
5dd455d0
authored
11 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
Change VID/PID info so USB works on Windows.
parent
fee89d52
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
stm/lib/usbd_desc.c
+18
-4
18 additions, 4 deletions
stm/lib/usbd_desc.c
stm/lib/usbd_pyb_core.c
+7
-5
7 additions, 5 deletions
stm/lib/usbd_pyb_core.c
with
25 additions
and
9 deletions
stm/lib/usbd_desc.c
+
18
−
4
View file @
5dd455d0
...
@@ -52,13 +52,10 @@
...
@@ -52,13 +52,10 @@
/** @defgroup USBD_DESC_Private_Defines
/** @defgroup USBD_DESC_Private_Defines
* @{
* @{
*/
*/
/*
#define USBD_VID 0x0483 // TODO set VID
#define USBD_VID 0x0483 // TODO set VID
#define USBD_PID 0x5720 // TODO set PID
#define USBD_PID 0x5720 // TODO set PID
/** @defgroup USB_String_Descriptors
* @{
*/
#define USBD_LANGID_STRING 0x409
#define USBD_LANGID_STRING 0x409
#define USBD_MANUFACTURER_STRING "STMicroelectronics" // TODO set
#define USBD_MANUFACTURER_STRING "STMicroelectronics" // TODO set
#define USBD_PRODUCT_HS_STRING "VCP/MSC in HS Mode" // TODO set
#define USBD_PRODUCT_HS_STRING "VCP/MSC in HS Mode" // TODO set
...
@@ -69,10 +66,27 @@
...
@@ -69,10 +66,27 @@
#define USBD_INTERFACE_HS_STRING "VCP/MSC Interface" // TODO set
#define USBD_INTERFACE_HS_STRING "VCP/MSC Interface" // TODO set
#define USBD_CONFIGURATION_FS_STRING "VCP/MSC Config" // TODO set
#define USBD_CONFIGURATION_FS_STRING "VCP/MSC Config" // TODO set
#define USBD_INTERFACE_FS_STRING "VCP/MSC Interface" // TODO set
#define USBD_INTERFACE_FS_STRING "VCP/MSC Interface" // TODO set
*/
/**
/**
* @}
* @}
*/
*/
// seems we need to use this VID/PID to get it to work on windows
#define USBD_VID 0x0483
#define USBD_PID 0x5740
#define USBD_LANGID_STRING 0x409
#define USBD_MANUFACTURER_STRING "STMicroelectronics"
#define USBD_PRODUCT_HS_STRING "STM32 Virtual ComPort in HS mode"
#define USBD_SERIALNUMBER_HS_STRING "00000000050B"
#define USBD_PRODUCT_FS_STRING "STM32 Virtual ComPort in FS Mode"
#define USBD_SERIALNUMBER_FS_STRING "00000000050C"
#define USBD_CONFIGURATION_HS_STRING "VCP Config"
#define USBD_INTERFACE_HS_STRING "VCP Interface"
#define USBD_CONFIGURATION_FS_STRING "VCP Config"
#define USBD_INTERFACE_FS_STRING "VCP Interface"
/** @defgroup USBD_DESC_Private_Macros
/** @defgroup USBD_DESC_Private_Macros
* @{
* @{
...
...
This diff is collapsed.
Click to expand it.
stm/lib/usbd_pyb_core.c
+
7
−
5
View file @
5dd455d0
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
#include
"usbd_msc_bot.h"
#include
"usbd_msc_bot.h"
#include
"usbd_msc_mem.h"
#include
"usbd_msc_mem.h"
#define USB_PYB_CONFIG_DESC_SIZ 98
#define USB_PYB_CONFIG_DESC_SIZ
(
98
)
#define MSC_EPIN_SIZE MSC_MAX_PACKET
#define MSC_EPIN_SIZE MSC_MAX_PACKET
#define MSC_EPOUT_SIZE MSC_MAX_PACKET
#define MSC_EPOUT_SIZE MSC_MAX_PACKET
...
@@ -150,7 +150,7 @@ __ALIGN_BEGIN static uint8_t usbd_pyb_CfgDesc[USB_PYB_CONFIG_DESC_SIZ] __ALIGN_E
...
@@ -150,7 +150,7 @@ __ALIGN_BEGIN static uint8_t usbd_pyb_CfgDesc[USB_PYB_CONFIG_DESC_SIZ] __ALIGN_E
HIBYTE
(
USB_PYB_CONFIG_DESC_SIZ
),
HIBYTE
(
USB_PYB_CONFIG_DESC_SIZ
),
0x03
,
// bNumInterfaces: 3 interfaces
0x03
,
// bNumInterfaces: 3 interfaces
0x01
,
// bConfigurationValue: Configuration value
0x01
,
// bConfigurationValue: Configuration value
0x0
0
,
// iConfiguration: Index of string descriptor describing the configuration
0x0
4
,
// iConfiguration: Index of string descriptor describing the configuration
0x80
,
// bmAttributes: bus powered; 0xc0 for self powered
0x80
,
// bmAttributes: bus powered; 0xc0 for self powered
0xfa
,
// bMaxPower: in units of 2mA
0xfa
,
// bMaxPower: in units of 2mA
...
@@ -163,7 +163,7 @@ __ALIGN_BEGIN static uint8_t usbd_pyb_CfgDesc[USB_PYB_CONFIG_DESC_SIZ] __ALIGN_E
...
@@ -163,7 +163,7 @@ __ALIGN_BEGIN static uint8_t usbd_pyb_CfgDesc[USB_PYB_CONFIG_DESC_SIZ] __ALIGN_E
0x00
,
// bFunctionClass: ?
0x00
,
// bFunctionClass: ?
0x00
,
// bFunctionSubClass: ?
0x00
,
// bFunctionSubClass: ?
0x00
,
// bFunctionProtocol: ?
0x00
,
// bFunctionProtocol: ?
0x0
0
,
// iFunction: index of string for this function
0x0
4
,
// iFunction: index of string for this function
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// Interface Descriptor
// Interface Descriptor
...
@@ -252,9 +252,9 @@ __ALIGN_BEGIN static uint8_t usbd_pyb_CfgDesc[USB_PYB_CONFIG_DESC_SIZ] __ALIGN_E
...
@@ -252,9 +252,9 @@ __ALIGN_BEGIN static uint8_t usbd_pyb_CfgDesc[USB_PYB_CONFIG_DESC_SIZ] __ALIGN_E
USB_INTERFACE_DESCRIPTOR_TYPE
,
// bDescriptorType: interface descriptor
USB_INTERFACE_DESCRIPTOR_TYPE
,
// bDescriptorType: interface descriptor
0x02
,
// bInterfaceNumber: Number of Interface
0x02
,
// bInterfaceNumber: Number of Interface
0x00
,
// bAlternateSetting: Alternate setting
0x00
,
// bAlternateSetting: Alternate setting
0x02
,
// bNumEndpoints
*/
0x02
,
// bNumEndpoints
0x08
,
// bInterfaceClass: MSC Class
0x08
,
// bInterfaceClass: MSC Class
0x06
,
// bInterfaceSubClass : SCSI transparent
*/
0x06
,
// bInterfaceSubClass : SCSI transparent
0x50
,
// nInterfaceProtocol
0x50
,
// nInterfaceProtocol
0x00
,
// iInterface:
0x00
,
// iInterface:
...
@@ -397,6 +397,7 @@ static uint8_t usbd_pyb_Setup(void *pdev, USB_SETUP_REQ *req) {
...
@@ -397,6 +397,7 @@ static uint8_t usbd_pyb_Setup(void *pdev, USB_SETUP_REQ *req) {
// Standard Device Request ---------------------------------------------
// Standard Device Request ---------------------------------------------
case
(
USB_REQ_TYPE_STANDARD
|
USB_REQ_RECIPIENT_DEVICE
):
case
(
USB_REQ_TYPE_STANDARD
|
USB_REQ_RECIPIENT_DEVICE
):
/*
switch (req->bRequest) {
switch (req->bRequest) {
case USB_REQ_GET_DESCRIPTOR:
case USB_REQ_GET_DESCRIPTOR:
{
{
...
@@ -409,6 +410,7 @@ static uint8_t usbd_pyb_Setup(void *pdev, USB_SETUP_REQ *req) {
...
@@ -409,6 +410,7 @@ static uint8_t usbd_pyb_Setup(void *pdev, USB_SETUP_REQ *req) {
return USBD_CtlSendData(pdev, pbuf, len);
return USBD_CtlSendData(pdev, pbuf, len);
}
}
}
}
*/
break
;
break
;
// Standard Interface Request ------------------------------------------
// Standard Interface Request ------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment