cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube CDC new Endpoint

z1060
Associate II
Posted on October 21, 2014 at 08:53

I creat new USB CDC project and add new IN Endpoint (0x83). I correct USBD_CDC_TransmitPacket for new Endpoint (0x83). Yet data transfer not working.

What should I do

to my IN Endpoint (0x83) worked?

#stm32cube #usb
4 REPLIES 4
Posted on October 21, 2014 at 09:56

Hi, 

Are there any changes that impact the descriptor ? Have you made any modifications on the descriptor ?

With any STM32Cube FW package are you working ?

Regards,

Heisenberg.

z1060
Associate II
Posted on October 21, 2014 at 10:12

I add new endpoint in descriptor (

function

USBD_CDC_CfgFSDesc) and

initialized

endpoint in USBD_CDC_Init

function

.

I replaced the CDC_IN_EP for a new IN endpoint (0x83)

in

function

USBD_LL_Transmit (inside USBD_CDC_TransmitPacket).

I use 1.3.0 version FW.

Posted on October 21, 2014 at 16:24

Hi,

Can you provide your usbd_conf.c file, the CDC class modified files, and also your main.c file, to have enough insight into what specifically you are doing, and how.

Regards,

Heisenberg.

z1060
Associate II
Posted on October 22, 2014 at 07:50

I just

changed the

function

USBD_CDC_TransmitPacket.

uint8_t USBD_CDC_TransmitPacket(USBD_HandleTypeDef *pdev, uint8_t ep_num)
{ 
USBD_CDC_HandleTypeDef *hcdc = pdev->pClassData;
if(pdev->pClassData != NULL)
{
if(hcdc->TxState == 0)
{
/* Tx Transfer in progress */
hcdc->TxState = 1;
/* Transmit next packet */
USBD_LL_Transmit(pdev,
ep_num,//CDC_IN_EP
hcdc->TxBuffer,
hcdc->TxLength);
/* Tx Transfer in progress */
// hcdc->TxState = 1;
return USBD_OK;
}
else
{
return USBD_BUSY;
}
}
else
{
return USBD_FAIL;
}
}

If you call

ep_num

=0x81,

the transmission

operates. If

ep_num=0x82 (or 0x83), 

the transmission

does not work

.

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Attachments/1751/files.7z

________________

Attachments :

files.7z : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzSz&d=%2Fa%2F0X0000000bME%2FNADvGkWiUyzgQ6DK4ie.J5L2zqeRPaaff0f3hKx_uoI&asPdf=false