-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
FSDEV: Implement dcd_edpt_close_all() #2592
Conversation
USB->DADDR = 0u; // disable USB peripheral by clearing the EF flag | ||
|
||
for (uint32_t i = 0; i < STFSDEV_EP_COUNT; i++) { | ||
// Clear all EPREG (or maybe this is automatic? I'm not sure) | ||
pcd_set_endpoint(USB, i, 0u); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed with oldest F1 datasheet and actual behavior.
} | ||
|
||
// Reset PMA allocation | ||
ep_buf_ptr = DCD_STM32_BTABLE_BASE + 8 * MAX_EP_COUNT + 2 * CFG_TUD_ENDPOINT0_SIZE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since EP0 size is always aligned to buffer size, I didn't put more check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is totally fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect, thank you
Describe the PR
Implement dcd_edpt_close_all()
Tested with
net_lwip_webserver
on NUCLEO-G0B1RE , with command:echo 1 | sudo tee /sys/bus/usb/devices/3-5/bConfigurationValue echo 2 | sudo tee /sys/bus/usb/devices/3-5/bConfigurationValue
Can't test with L053 as RAM too small.