cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4xx HAL vs silicon USB endpoint numbers

conor
Associate II
Posted on May 22, 2014 at 20:21 After much digging, I discovered that while the reference manual for STM32F4xx says you can have 3 IN endpoints, it fails to prominently specify that these can only be the endpoints numbered 1, 2 or 3. The HAL library code allows the use of any endpoint number from 1 to I was able to choose endpoint 6 in my code and it compiled and executed without complaint, though, obviously endpoint 6 remained silent. Further digging revealed this caveat in the PCD Initialization Structure:

typedef struct
{
uint32_t dev_endpoints; /*!< 
Device
Endpoints number.
This parameter depends on the used USB core. 
This parameter must be a number between 
Min_Data
= 
1
and 
Max_Data
= 
15
*/ 
<SNIP>
}USB_OTG_CfgTypeDef;

I hope that my failure to R The FM might save someone else from making the same mistake that I did. Unfortunately, my application needs to use endpoint 6 in order to match an installed base of drivers. I don't see a way to do that using STM32F4 parts, but if someone can show me a way, that would make my day. Thanks, -- Conor #stm32f4-hal-usb-endpoint-rtfm
1 REPLY 1
Posted on May 29, 2014 at 16:42

Hi Conor,

The internal endpoint structure could handle up to 15 endpoints (generic for all the STM32 products), but the user has to set  a number <= of number of the endpoints supported by a product (F4 ep_num <= 3 for FS and <= 6 for HS) in the PCD init structure.

With regards.