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

chore(usb): cdc_queue now use uint32_t length #2550

Closed
wants to merge 1 commit into from

Conversation

warmonkey
Copy link
Contributor

@warmonkey warmonkey commented Nov 4, 2024

raise cdc buffer size 32KB limit due to uint16_t length variables.

This PR fixes bug: cdc queue limited
Now CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER and/or CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER both can be greater than 512. which every buffer size is 64B, 64*512=32768

which allows CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER>512 or
CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER>512.

Signed-off-by: warmonkey <[email protected]>
@warmonkey warmonkey closed this Nov 5, 2024
@fpistm fpistm reopened this Nov 5, 2024
@fpistm fpistm changed the title cdc_queue.cpp change to uint32_t length chore(usb): cdc_queue now use uint32_t length Nov 5, 2024
@fpistm fpistm added the enhancement New feature or request label Nov 5, 2024
@fpistm fpistm added this to the 2.9.0 milestone Nov 5, 2024
@fpistm fpistm removed this from the 2.9.0 milestone Nov 22, 2024
@fpistm
Copy link
Member

fpistm commented Feb 18, 2025

Hi @warmonkey
Sorry for the delay. 😢
I've dig into HAL to see why it was uint16_t and found the reason, even if changed to uint32_t it will be always truncated to uint16_t when accessing the PMA (R/W).

void USB_WritePMA(USB_TypeDef const *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes)

So I will not merge this PR, sorry.

@fpistm fpistm closed this Feb 18, 2025
@fpistm fpistm added the invalid This doesn't seem right label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
Development

Successfully merging this pull request may close these issues.

2 participants