Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usbd_cdc_if.c lacking function definition for CDC_TransmitCplt_FS #34

Open
kaptptrx opened this issue Feb 14, 2024 · 2 comments
Open

usbd_cdc_if.c lacking function definition for CDC_TransmitCplt_FS #34

kaptptrx opened this issue Feb 14, 2024 · 2 comments
Assignees
Labels
projects Projects-related (demos, applications, examples) issue or pull-request. question Further information is requested usb USB-related (host or device) issue or pull-request

Comments

@kaptptrx
Copy link

kaptptrx commented Feb 14, 2024

The file USB_DEVICE/App/usbd_cdc_if.c in the stm32L0 HAL, as generated by CubeMX doesn't contain support registering a callback for USB transmit complete, whereas this functionality does exist in stm32L4, among other HALs. Instead of registering a callback, we're forced to call a function in the application main loop.

This is the function that is defined in L4 but not L0.

static int8_t CDC_TransmitCplt_FS(uint8_t *pbuf, uint32_t *Len, uint8_t epnum);

It looks like the lower level USB HAL supports this callback, and the L0 reference manual indicates the transmit complete interrupt is supported by the hardware. Curious as to why it is not supported in the USB_DEVICE layer.

Our team has considered adding this functionality to the usbd_cdc_if.c file, but would prefer not to maintain code instead of just using autogenerated CubeMX code.

Is this a feature that you could add to the stm32CubeL0 HAL? Or if our team created a pull request adding this feature would you consider adding?

Thanks.

@ALABSTM ALABSTM self-assigned this Feb 16, 2024
@ALABSTM ALABSTM added this to To do in stm32cube-mcu-fw-dashboard via automation Feb 16, 2024
@ALABSTM ALABSTM added usb USB-related (host or device) issue or pull-request question Further information is requested projects Projects-related (demos, applications, examples) issue or pull-request. labels Feb 16, 2024
@ALABSTM
Copy link
Contributor

ALABSTM commented Feb 19, 2024

Hi @kaptptrx,

I had a look into STM32CubeL4 firmware and could not find the CDC_TransmitCplt_FS() callback you mentioned. Rather, I found mention of a CDC_Itf_TransmitCplt() callback here for instance. I suppose they refer to the same thing.

Anyway, your question has been forwarded to our development teams. I will keep you updated.

With regards,

@ALABSTM ALABSTM moved this from To do to Analyzed in stm32cube-mcu-fw-dashboard Feb 19, 2024
@kaptptrx
Copy link
Author

kaptptrx commented Feb 20, 2024

Hi @ALABSTM

Thanks for your response.

It looks like the usbd_cdc_if.c file is generated using the usbd_cdc_if_template.c file? The L4 version of that file contains a definition for static int8_t TEMPLATE_TransmitCplt(uint8_t *pbuf, uint32_t *Len, uint8_t epnum); whereas the L0 version does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
projects Projects-related (demos, applications, examples) issue or pull-request. question Further information is requested usb USB-related (host or device) issue or pull-request
Projects
Development

No branches or pull requests

2 participants